summaryrefslogtreecommitdiff
path: root/fs/xfs/linux-2.6/xfs_file.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-06-09 17:00:52 +1000
committerNathan Scott <nathans@sgi.com>2006-06-09 17:00:52 +1000
commit67fcaa73adafb19139a7cd8ab133592b6a0a0901 (patch)
tree6e7b83e7c8b0a1d8b4776af1537d6f07ebe9435d /fs/xfs/linux-2.6/xfs_file.c
parentb83bd1388133e914c38bd31d69bc90143e6ab10c (diff)
[XFS] Resolve a namespace collision on vnode/vnodeops for FreeBSD porters.
SGI-PV: 953338 SGI-Modid: xfs-linux-melb:xfs-kern:26107a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_file.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c120
1 files changed, 44 insertions, 76 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 97615cc74ef5..89b1a7421357 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -58,15 +58,12 @@ __xfs_file_read(
{
struct iovec iov = {buf, count};
struct file *file = iocb->ki_filp;
- vnode_t *vp = vn_from_inode(file->f_dentry->d_inode);
- ssize_t rval;
+ bhv_vnode_t *vp = vn_from_inode(file->f_dentry->d_inode);
BUG_ON(iocb->ki_pos != pos);
-
if (unlikely(file->f_flags & O_DIRECT))
ioflags |= IO_ISDIRECT;
- VOP_READ(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL, rval);
- return rval;
+ return bhv_vop_read(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL);
}
STATIC ssize_t
@@ -100,15 +97,12 @@ __xfs_file_write(
struct iovec iov = {(void __user *)buf, count};
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
- vnode_t *vp = vn_from_inode(inode);
- ssize_t rval;
+ bhv_vnode_t *vp = vn_from_inode(inode);
BUG_ON(iocb->ki_pos != pos);
if (unlikely(file->f_flags & O_DIRECT))
ioflags |= IO_ISDIRECT;
-
- VOP_WRITE(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL, rval);
- return rval;
+ return bhv_vop_write(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL);
}
STATIC ssize_t
@@ -140,7 +134,7 @@ __xfs_file_readv(
loff_t *ppos)
{
struct inode *inode = file->f_mapping->host;
- vnode_t *vp = vn_from_inode(inode);
+ bhv_vnode_t *vp = vn_from_inode(inode);
struct kiocb kiocb;
ssize_t rval;
@@ -149,7 +143,8 @@ __xfs_file_readv(
if (unlikely(file->f_flags & O_DIRECT))
ioflags |= IO_ISDIRECT;
- VOP_READ(vp, &kiocb, iov, nr_segs, &kiocb.ki_pos, ioflags, NULL, rval);
+ rval = bhv_vop_read(vp, &kiocb, iov, nr_segs,
+ &kiocb.ki_pos, ioflags, NULL);
*ppos = kiocb.ki_pos;
return rval;
@@ -184,7 +179,7 @@ __xfs_file_writev(
loff_t *ppos)
{
struct inode *inode = file->f_mapping->host;
- vnode_t *vp = vn_from_inode(inode);
+ bhv_vnode_t *vp = vn_from_inode(inode);
struct kiocb kiocb;
ssize_t rval;
@@ -193,7 +188,8 @@ __xfs_file_writev(
if (unlikely(file->f_flags & O_DIRECT))
ioflags |= IO_ISDIRECT;
- VOP_WRITE(vp, &kiocb, iov, nr_segs, &kiocb.ki_pos, ioflags, NULL, rval);
+ rval = bhv_vop_write(vp, &kiocb, iov, nr_segs,
+ &kiocb.ki_pos, ioflags, NULL);
*ppos = kiocb.ki_pos;
return rval;
@@ -227,11 +223,8 @@ xfs_file_sendfile(
read_actor_t actor,
void *target)
{
- vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode);
- ssize_t rval;
-
- VOP_SENDFILE(vp, filp, pos, 0, count, actor, target, NULL, rval);
- return rval;
+ return bhv_vop_sendfile(vn_from_inode(filp->f_dentry->d_inode),
+ filp, pos, 0, count, actor, target, NULL);
}
STATIC ssize_t
@@ -242,11 +235,8 @@ xfs_file_sendfile_invis(
read_actor_t actor,
void *target)
{
- vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode);
- ssize_t rval;
-
- VOP_SENDFILE(vp, filp, pos, IO_INVIS, count, actor, target, NULL, rval);
- return rval;
+ return bhv_vop_sendfile(vn_from_inode(filp->f_dentry->d_inode),
+ filp, pos, IO_INVIS, count, actor, target, NULL);
}
STATIC ssize_t
@@ -257,11 +247,8 @@ xfs_file_splice_read(
size_t len,
unsigned int flags)
{
- vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode);
- ssize_t rval;
-
- VOP_SPLICE_READ(vp, infilp, ppos, pipe, len, flags, 0, NULL, rval);
- return rval;
+ return bhv_vop_splice_read(vn_from_inode(infilp->f_dentry->d_inode),
+ infilp, ppos, pipe, len, flags, 0, NULL);
}
STATIC ssize_t
@@ -272,11 +259,9 @@ xfs_file_splice_read_invis(
size_t len,
unsigned int flags)
{
- vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode);
- ssize_t rval;
-
- VOP_SPLICE_READ(vp, infilp, ppos, pipe, len, flags, IO_INVIS, NULL, rval);
- return rval;
+ return bhv_vop_splice_read(vn_from_inode(infilp->f_dentry->d_inode),
+ infilp, ppos, pipe, len, flags, IO_INVIS,
+ NULL);
}
STATIC ssize_t
@@ -287,11 +272,8 @@ xfs_file_splice_write(
size_t len,
unsigned int flags)
{
- vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode);
- ssize_t rval;
-
- VOP_SPLICE_WRITE(vp, pipe, outfilp, ppos, len, flags, 0, NULL, rval);
- return rval;
+ return bhv_vop_splice_write(vn_from_inode(outfilp->f_dentry->d_inode),
+ pipe, outfilp, ppos, len, flags, 0, NULL);
}
STATIC ssize_t
@@ -302,11 +284,9 @@ xfs_file_splice_write_invis(
size_t len,
unsigned int flags)
{
- vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode);
- ssize_t rval;
-
- VOP_SPLICE_WRITE(vp, pipe, outfilp, ppos, len, flags, IO_INVIS, NULL, rval);
- return rval;
+ return bhv_vop_splice_write(vn_from_inode(outfilp->f_dentry->d_inode),
+ pipe, outfilp, ppos, len, flags, IO_INVIS,
+ NULL);
}
STATIC int
@@ -314,24 +294,17 @@ xfs_file_open(
struct inode *inode,
struct file *filp)
{
- vnode_t *vp = vn_from_inode(inode);
- int error;
-
if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
return -EFBIG;
- VOP_OPEN(vp, NULL, error);
- return -error;
+ return -bhv_vop_open(vn_from_inode(inode), NULL);
}
STATIC int
xfs_file_close(
struct file *filp)
{
- vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode);
- int error;
-
- VOP_CLOSE(vp, 0, file_count(filp) > 1 ? L_FALSE : L_TRUE, NULL, error);
- return -error;
+ return -bhv_vop_close(vn_from_inode(filp->f_dentry->d_inode), 0,
+ file_count(filp) > 1 ? L_FALSE : L_TRUE, NULL);
}
STATIC int
@@ -339,12 +312,11 @@ xfs_file_release(
struct inode *inode,
struct file *filp)
{
- vnode_t *vp = vn_from_inode(inode);
- int error = 0;
+ bhv_vnode_t *vp = vn_from_inode(inode);
if (vp)
- VOP_RELEASE(vp, error);
- return -error;
+ return -bhv_vop_release(vp);
+ return 0;
}
STATIC int
@@ -353,17 +325,14 @@ xfs_file_fsync(
struct dentry *dentry,
int datasync)
{
- struct inode *inode = dentry->d_inode;
- vnode_t *vp = vn_from_inode(inode);
- int error;
+ bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
int flags = FSYNC_WAIT;
if (datasync)
flags |= FSYNC_DATA;
if (VN_TRUNC(vp))
VUNTRUNCATE(vp);
- VOP_FSYNC(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1, error);
- return -error;
+ return -bhv_vop_fsync(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1);
}
#ifdef CONFIG_XFS_DMAPI
@@ -374,7 +343,7 @@ xfs_vm_nopage(
int *type)
{
struct inode *inode = area->vm_file->f_dentry->d_inode;
- vnode_t *vp = vn_from_inode(inode);
+ bhv_vnode_t *vp = vn_from_inode(inode);
ASSERT_ALWAYS(vp->v_vfsp->vfs_flag & VFS_DMI);
if (XFS_SEND_MMAP(XFS_VFSTOM(vp->v_vfsp), area, 0))
@@ -390,7 +359,7 @@ xfs_file_readdir(
filldir_t filldir)
{
int error = 0;
- vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode);
+ bhv_vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode);
uio_t uio;
iovec_t iov;
int eof = 0;
@@ -425,7 +394,7 @@ xfs_file_readdir(
start_offset = uio.uio_offset;
- VOP_READDIR(vp, &uio, NULL, &eof, error);
+ error = bhv_vop_readdir(vp, &uio, NULL, &eof);
if ((uio.uio_offset == start_offset) || error) {
size = 0;
break;
@@ -475,18 +444,17 @@ xfs_file_mmap(
return 0;
}
-
STATIC long
xfs_file_ioctl(
struct file *filp,
unsigned int cmd,
- unsigned long arg)
+ unsigned long p)
{
int error;
struct inode *inode = filp->f_dentry->d_inode;
- vnode_t *vp = vn_from_inode(inode);
+ bhv_vnode_t *vp = vn_from_inode(inode);
- VOP_IOCTL(vp, inode, filp, 0, cmd, (void __user *)arg, error);
+ error = bhv_vop_ioctl(vp, inode, filp, 0, cmd, (void __user *)p);
VMODIFY(vp);
/* NOTE: some of the ioctl's return positive #'s as a
@@ -502,13 +470,13 @@ STATIC long
xfs_file_ioctl_invis(
struct file *filp,
unsigned int cmd,
- unsigned long arg)
+ unsigned long p)
{
- struct inode *inode = filp->f_dentry->d_inode;
- vnode_t *vp = vn_from_inode(inode);
int error;
+ struct inode *inode = filp->f_dentry->d_inode;
+ bhv_vnode_t *vp = vn_from_inode(inode);
- VOP_IOCTL(vp, inode, filp, IO_INVIS, cmd, (void __user *)arg, error);
+ error = bhv_vop_ioctl(vp, inode, filp, IO_INVIS, cmd, (void __user *)p);
VMODIFY(vp);
/* NOTE: some of the ioctl's return positive #'s as a
@@ -527,7 +495,7 @@ xfs_vm_mprotect(
struct vm_area_struct *vma,
unsigned int newflags)
{
- vnode_t *vp = vn_from_inode(vma->vm_file->f_dentry->d_inode);
+ bhv_vnode_t *vp = vn_from_inode(vma->vm_file->f_dentry->d_inode);
int error = 0;
if (vp->v_vfsp->vfs_flag & VFS_DMI) {
@@ -553,7 +521,7 @@ STATIC int
xfs_file_open_exec(
struct inode *inode)
{
- vnode_t *vp = vn_from_inode(inode);
+ bhv_vnode_t *vp = vn_from_inode(inode);
xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp);
int error = 0;
xfs_inode_t *ip;