Commit 67fcaa73 authored by Nathan Scott's avatar Nathan Scott

[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: default avatarNathan Scott <nathans@sgi.com>
parent b83bd138
...@@ -76,7 +76,7 @@ xfs_page_trace( ...@@ -76,7 +76,7 @@ xfs_page_trace(
int mask) int mask)
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
loff_t isize = i_size_read(inode); loff_t isize = i_size_read(inode);
loff_t offset = page_offset(page); loff_t offset = page_offset(page);
int delalloc = -1, unmapped = -1, unwritten = -1; int delalloc = -1, unmapped = -1, unwritten = -1;
...@@ -181,13 +181,12 @@ xfs_end_bio_unwritten( ...@@ -181,13 +181,12 @@ xfs_end_bio_unwritten(
void *data) void *data)
{ {
xfs_ioend_t *ioend = data; xfs_ioend_t *ioend = data;
vnode_t *vp = ioend->io_vnode; bhv_vnode_t *vp = ioend->io_vnode;
xfs_off_t offset = ioend->io_offset; xfs_off_t offset = ioend->io_offset;
size_t size = ioend->io_size; size_t size = ioend->io_size;
int error;
if (likely(!ioend->io_error)) if (likely(!ioend->io_error))
VOP_BMAP(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL, error); bhv_vop_bmap(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL);
xfs_destroy_ioend(ioend); xfs_destroy_ioend(ioend);
} }
...@@ -240,10 +239,10 @@ xfs_map_blocks( ...@@ -240,10 +239,10 @@ xfs_map_blocks(
xfs_iomap_t *mapp, xfs_iomap_t *mapp,
int flags) int flags)
{ {
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
int error, nmaps = 1; int error, nmaps = 1;
VOP_BMAP(vp, offset, count, flags, mapp, &nmaps, error); error = bhv_vop_bmap(vp, offset, count, flags, mapp, &nmaps);
if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE))) if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE)))
VMODIFY(vp); VMODIFY(vp);
return -error; return -error;
...@@ -1162,7 +1161,7 @@ xfs_vm_writepages( ...@@ -1162,7 +1161,7 @@ xfs_vm_writepages(
struct address_space *mapping, struct address_space *mapping,
struct writeback_control *wbc) struct writeback_control *wbc)
{ {
struct vnode *vp = vn_from_inode(mapping->host); struct bhv_vnode *vp = vn_from_inode(mapping->host);
if (VN_TRUNC(vp)) if (VN_TRUNC(vp))
VUNTRUNCATE(vp); VUNTRUNCATE(vp);
...@@ -1242,7 +1241,7 @@ __xfs_get_blocks( ...@@ -1242,7 +1241,7 @@ __xfs_get_blocks(
int direct, int direct,
bmapi_flags_t flags) bmapi_flags_t flags)
{ {
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
xfs_iomap_t iomap; xfs_iomap_t iomap;
xfs_off_t offset; xfs_off_t offset;
ssize_t size; ssize_t size;
...@@ -1252,8 +1251,8 @@ __xfs_get_blocks( ...@@ -1252,8 +1251,8 @@ __xfs_get_blocks(
offset = (xfs_off_t)iblock << inode->i_blkbits; offset = (xfs_off_t)iblock << inode->i_blkbits;
ASSERT(bh_result->b_size >= (1 << inode->i_blkbits)); ASSERT(bh_result->b_size >= (1 << inode->i_blkbits));
size = bh_result->b_size; size = bh_result->b_size;
VOP_BMAP(vp, offset, size, error = bhv_vop_bmap(vp, offset, size,
create ? flags : BMAPI_READ, &iomap, &niomap, error); create ? flags : BMAPI_READ, &iomap, &niomap);
if (error) if (error)
return -error; return -error;
if (niomap == 0) if (niomap == 0)
...@@ -1381,13 +1380,13 @@ xfs_vm_direct_IO( ...@@ -1381,13 +1380,13 @@ xfs_vm_direct_IO(
{ {
struct file *file = iocb->ki_filp; struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
xfs_iomap_t iomap; xfs_iomap_t iomap;
int maps = 1; int maps = 1;
int error; int error;
ssize_t ret; ssize_t ret;
VOP_BMAP(vp, offset, 0, BMAPI_DEVICE, &iomap, &maps, error); error = bhv_vop_bmap(vp, offset, 0, BMAPI_DEVICE, &iomap, &maps);
if (error) if (error)
return -error; return -error;
...@@ -1420,14 +1419,12 @@ xfs_vm_bmap( ...@@ -1420,14 +1419,12 @@ xfs_vm_bmap(
sector_t block) sector_t block)
{ {
struct inode *inode = (struct inode *)mapping->host; struct inode *inode = (struct inode *)mapping->host;
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
int error;
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
bhv_vop_rwlock(vp, VRWLOCK_READ);
VOP_RWLOCK(vp, VRWLOCK_READ); bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF);
VOP_FLUSH_PAGES(vp, (xfs_off_t)0, -1, 0, FI_REMAPF, error); bhv_vop_rwunlock(vp, VRWLOCK_READ);
VOP_RWUNLOCK(vp, VRWLOCK_READ);
return generic_block_bmap(mapping, block, xfs_get_blocks); return generic_block_bmap(mapping, block, xfs_get_blocks);
} }
......
...@@ -32,7 +32,7 @@ typedef struct xfs_ioend { ...@@ -32,7 +32,7 @@ typedef struct xfs_ioend {
unsigned int io_type; /* delalloc / unwritten */ unsigned int io_type; /* delalloc / unwritten */
int io_error; /* I/O error code */ int io_error; /* I/O error code */
atomic_t io_remaining; /* hold count */ atomic_t io_remaining; /* hold count */
struct vnode *io_vnode; /* file being written to */ struct bhv_vnode *io_vnode; /* file being written to */
struct buffer_head *io_buffer_head;/* buffer linked list head */ struct buffer_head *io_buffer_head;/* buffer linked list head */
struct buffer_head *io_buffer_tail;/* buffer linked list tail */ struct buffer_head *io_buffer_tail;/* buffer linked list tail */
size_t io_size; /* size of the extent */ size_t io_size; /* size of the extent */
......
...@@ -136,7 +136,7 @@ xfs_fs_get_dentry( ...@@ -136,7 +136,7 @@ xfs_fs_get_dentry(
struct super_block *sb, struct super_block *sb,
void *data) void *data)
{ {
vnode_t *vp; bhv_vnode_t *vp;
struct inode *inode; struct inode *inode;
struct dentry *result; struct dentry *result;
bhv_vfs_t *vfsp = vfs_from_sb(sb); bhv_vfs_t *vfsp = vfs_from_sb(sb);
...@@ -160,12 +160,12 @@ xfs_fs_get_parent( ...@@ -160,12 +160,12 @@ xfs_fs_get_parent(
struct dentry *child) struct dentry *child)
{ {
int error; int error;
vnode_t *vp, *cvp; bhv_vnode_t *vp, *cvp;
struct dentry *parent; struct dentry *parent;
cvp = NULL; cvp = NULL;
vp = vn_from_inode(child->d_inode); vp = vn_from_inode(child->d_inode);
VOP_LOOKUP(vp, &dotdot, &cvp, 0, NULL, NULL, error); error = bhv_vop_lookup(vp, &dotdot, &cvp, 0, NULL, NULL);
if (unlikely(error)) if (unlikely(error))
return ERR_PTR(-error); return ERR_PTR(-error);
......
...@@ -58,15 +58,12 @@ __xfs_file_read( ...@@ -58,15 +58,12 @@ __xfs_file_read(
{ {
struct iovec iov = {buf, count}; struct iovec iov = {buf, count};
struct file *file = iocb->ki_filp; struct file *file = iocb->ki_filp;
vnode_t *vp = vn_from_inode(file->f_dentry->d_inode); bhv_vnode_t *vp = vn_from_inode(file->f_dentry->d_inode);
ssize_t rval;
BUG_ON(iocb->ki_pos != pos); BUG_ON(iocb->ki_pos != pos);
if (unlikely(file->f_flags & O_DIRECT)) if (unlikely(file->f_flags & O_DIRECT))
ioflags |= IO_ISDIRECT; ioflags |= IO_ISDIRECT;
VOP_READ(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL, rval); return bhv_vop_read(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL);
return rval;
} }
STATIC ssize_t STATIC ssize_t
...@@ -100,15 +97,12 @@ __xfs_file_write( ...@@ -100,15 +97,12 @@ __xfs_file_write(
struct iovec iov = {(void __user *)buf, count}; struct iovec iov = {(void __user *)buf, count};
struct file *file = iocb->ki_filp; struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
ssize_t rval;
BUG_ON(iocb->ki_pos != pos); BUG_ON(iocb->ki_pos != pos);
if (unlikely(file->f_flags & O_DIRECT)) if (unlikely(file->f_flags & O_DIRECT))
ioflags |= IO_ISDIRECT; ioflags |= IO_ISDIRECT;
return bhv_vop_write(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL);
VOP_WRITE(vp, iocb, &iov, 1, &iocb->ki_pos, ioflags, NULL, rval);
return rval;
} }
STATIC ssize_t STATIC ssize_t
...@@ -140,7 +134,7 @@ __xfs_file_readv( ...@@ -140,7 +134,7 @@ __xfs_file_readv(
loff_t *ppos) loff_t *ppos)
{ {
struct inode *inode = file->f_mapping->host; 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; struct kiocb kiocb;
ssize_t rval; ssize_t rval;
...@@ -149,7 +143,8 @@ __xfs_file_readv( ...@@ -149,7 +143,8 @@ __xfs_file_readv(
if (unlikely(file->f_flags & O_DIRECT)) if (unlikely(file->f_flags & O_DIRECT))
ioflags |= IO_ISDIRECT; 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; *ppos = kiocb.ki_pos;
return rval; return rval;
...@@ -184,7 +179,7 @@ __xfs_file_writev( ...@@ -184,7 +179,7 @@ __xfs_file_writev(
loff_t *ppos) loff_t *ppos)
{ {
struct inode *inode = file->f_mapping->host; 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; struct kiocb kiocb;
ssize_t rval; ssize_t rval;
...@@ -193,7 +188,8 @@ __xfs_file_writev( ...@@ -193,7 +188,8 @@ __xfs_file_writev(
if (unlikely(file->f_flags & O_DIRECT)) if (unlikely(file->f_flags & O_DIRECT))
ioflags |= IO_ISDIRECT; 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; *ppos = kiocb.ki_pos;
return rval; return rval;
...@@ -227,11 +223,8 @@ xfs_file_sendfile( ...@@ -227,11 +223,8 @@ xfs_file_sendfile(
read_actor_t actor, read_actor_t actor,
void *target) void *target)
{ {
vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode); return bhv_vop_sendfile(vn_from_inode(filp->f_dentry->d_inode),
ssize_t rval; filp, pos, 0, count, actor, target, NULL);
VOP_SENDFILE(vp, filp, pos, 0, count, actor, target, NULL, rval);
return rval;
} }
STATIC ssize_t STATIC ssize_t
...@@ -242,11 +235,8 @@ xfs_file_sendfile_invis( ...@@ -242,11 +235,8 @@ xfs_file_sendfile_invis(
read_actor_t actor, read_actor_t actor,
void *target) void *target)
{ {
vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode); return bhv_vop_sendfile(vn_from_inode(filp->f_dentry->d_inode),
ssize_t rval; filp, pos, IO_INVIS, count, actor, target, NULL);
VOP_SENDFILE(vp, filp, pos, IO_INVIS, count, actor, target, NULL, rval);
return rval;
} }
STATIC ssize_t STATIC ssize_t
...@@ -257,11 +247,8 @@ xfs_file_splice_read( ...@@ -257,11 +247,8 @@ xfs_file_splice_read(
size_t len, size_t len,
unsigned int flags) unsigned int flags)
{ {
vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode); return bhv_vop_splice_read(vn_from_inode(infilp->f_dentry->d_inode),
ssize_t rval; infilp, ppos, pipe, len, flags, 0, NULL);
VOP_SPLICE_READ(vp, infilp, ppos, pipe, len, flags, 0, NULL, rval);
return rval;
} }
STATIC ssize_t STATIC ssize_t
...@@ -272,11 +259,9 @@ xfs_file_splice_read_invis( ...@@ -272,11 +259,9 @@ xfs_file_splice_read_invis(
size_t len, size_t len,
unsigned int flags) unsigned int flags)
{ {
vnode_t *vp = vn_from_inode(infilp->f_dentry->d_inode); return bhv_vop_splice_read(vn_from_inode(infilp->f_dentry->d_inode),
ssize_t rval; infilp, ppos, pipe, len, flags, IO_INVIS,
NULL);
VOP_SPLICE_READ(vp, infilp, ppos, pipe, len, flags, IO_INVIS, NULL, rval);
return rval;
} }
STATIC ssize_t STATIC ssize_t
...@@ -287,11 +272,8 @@ xfs_file_splice_write( ...@@ -287,11 +272,8 @@ xfs_file_splice_write(
size_t len, size_t len,
unsigned int flags) unsigned int flags)
{ {
vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode); return bhv_vop_splice_write(vn_from_inode(outfilp->f_dentry->d_inode),
ssize_t rval; pipe, outfilp, ppos, len, flags, 0, NULL);
VOP_SPLICE_WRITE(vp, pipe, outfilp, ppos, len, flags, 0, NULL, rval);
return rval;
} }
STATIC ssize_t STATIC ssize_t
...@@ -302,11 +284,9 @@ xfs_file_splice_write_invis( ...@@ -302,11 +284,9 @@ xfs_file_splice_write_invis(
size_t len, size_t len,
unsigned int flags) unsigned int flags)
{ {
vnode_t *vp = vn_from_inode(outfilp->f_dentry->d_inode); return bhv_vop_splice_write(vn_from_inode(outfilp->f_dentry->d_inode),
ssize_t rval; pipe, outfilp, ppos, len, flags, IO_INVIS,
NULL);
VOP_SPLICE_WRITE(vp, pipe, outfilp, ppos, len, flags, IO_INVIS, NULL, rval);
return rval;
} }
STATIC int STATIC int
...@@ -314,24 +294,17 @@ xfs_file_open( ...@@ -314,24 +294,17 @@ xfs_file_open(
struct inode *inode, struct inode *inode,
struct file *filp) 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) if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
return -EFBIG; return -EFBIG;
VOP_OPEN(vp, NULL, error); return -bhv_vop_open(vn_from_inode(inode), NULL);
return -error;
} }
STATIC int STATIC int
xfs_file_close( xfs_file_close(
struct file *filp) struct file *filp)
{ {
vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode); return -bhv_vop_close(vn_from_inode(filp->f_dentry->d_inode), 0,
int error; file_count(filp) > 1 ? L_FALSE : L_TRUE, NULL);
VOP_CLOSE(vp, 0, file_count(filp) > 1 ? L_FALSE : L_TRUE, NULL, error);
return -error;
} }
STATIC int STATIC int
...@@ -339,12 +312,11 @@ xfs_file_release( ...@@ -339,12 +312,11 @@ xfs_file_release(
struct inode *inode, struct inode *inode,
struct file *filp) struct file *filp)
{ {
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
int error = 0;
if (vp) if (vp)
VOP_RELEASE(vp, error); return -bhv_vop_release(vp);
return -error; return 0;
} }
STATIC int STATIC int
...@@ -353,17 +325,14 @@ xfs_file_fsync( ...@@ -353,17 +325,14 @@ xfs_file_fsync(
struct dentry *dentry, struct dentry *dentry,
int datasync) int datasync)
{ {
struct inode *inode = dentry->d_inode; bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
vnode_t *vp = vn_from_inode(inode);
int error;
int flags = FSYNC_WAIT; int flags = FSYNC_WAIT;
if (datasync) if (datasync)
flags |= FSYNC_DATA; flags |= FSYNC_DATA;
if (VN_TRUNC(vp)) if (VN_TRUNC(vp))
VUNTRUNCATE(vp); VUNTRUNCATE(vp);
VOP_FSYNC(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1, error); return -bhv_vop_fsync(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1);
return -error;
} }
#ifdef CONFIG_XFS_DMAPI #ifdef CONFIG_XFS_DMAPI
...@@ -374,7 +343,7 @@ xfs_vm_nopage( ...@@ -374,7 +343,7 @@ xfs_vm_nopage(
int *type) int *type)
{ {
struct inode *inode = area->vm_file->f_dentry->d_inode; 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); ASSERT_ALWAYS(vp->v_vfsp->vfs_flag & VFS_DMI);
if (XFS_SEND_MMAP(XFS_VFSTOM(vp->v_vfsp), area, 0)) if (XFS_SEND_MMAP(XFS_VFSTOM(vp->v_vfsp), area, 0))
...@@ -390,7 +359,7 @@ xfs_file_readdir( ...@@ -390,7 +359,7 @@ xfs_file_readdir(
filldir_t filldir) filldir_t filldir)
{ {
int error = 0; 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; uio_t uio;
iovec_t iov; iovec_t iov;
int eof = 0; int eof = 0;
...@@ -425,7 +394,7 @@ xfs_file_readdir( ...@@ -425,7 +394,7 @@ xfs_file_readdir(
start_offset = uio.uio_offset; 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) { if ((uio.uio_offset == start_offset) || error) {
size = 0; size = 0;
break; break;
...@@ -475,18 +444,17 @@ xfs_file_mmap( ...@@ -475,18 +444,17 @@ xfs_file_mmap(
return 0; return 0;
} }
STATIC long STATIC long
xfs_file_ioctl( xfs_file_ioctl(
struct file *filp, struct file *filp,
unsigned int cmd, unsigned int cmd,
unsigned long arg) unsigned long p)
{ {
int error; int error;
struct inode *inode = filp->f_dentry->d_inode; 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); VMODIFY(vp);
/* NOTE: some of the ioctl's return positive #'s as a /* NOTE: some of the ioctl's return positive #'s as a
...@@ -502,13 +470,13 @@ STATIC long ...@@ -502,13 +470,13 @@ STATIC long
xfs_file_ioctl_invis( xfs_file_ioctl_invis(
struct file *filp, struct file *filp,
unsigned int cmd, 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; 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); VMODIFY(vp);
/* NOTE: some of the ioctl's return positive #'s as a /* NOTE: some of the ioctl's return positive #'s as a
...@@ -527,7 +495,7 @@ xfs_vm_mprotect( ...@@ -527,7 +495,7 @@ xfs_vm_mprotect(
struct vm_area_struct *vma, struct vm_area_struct *vma,
unsigned int newflags) 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; int error = 0;
if (vp->v_vfsp->vfs_flag & VFS_DMI) { if (vp->v_vfsp->vfs_flag & VFS_DMI) {
...@@ -553,7 +521,7 @@ STATIC int ...@@ -553,7 +521,7 @@ STATIC int
xfs_file_open_exec( xfs_file_open_exec(
struct inode *inode) 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); xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp);
int error = 0; int error = 0;
xfs_inode_t *ip; xfs_inode_t *ip;
......
...@@ -28,7 +28,7 @@ fs_tosspages( ...@@ -28,7 +28,7 @@ fs_tosspages(
xfs_off_t last, xfs_off_t last,
int fiopt) int fiopt)
{ {
vnode_t *vp = BHV_TO_VNODE(bdp); bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
struct inode *ip = vn_to_inode(vp); struct inode *ip = vn_to_inode(vp);
if (VN_CACHED(vp)) if (VN_CACHED(vp))
...@@ -42,7 +42,7 @@ fs_flushinval_pages( ...@@ -42,7 +42,7 @@ fs_flushinval_pages(
xfs_off_t last, xfs_off_t last,
int fiopt) int fiopt)
{ {
vnode_t *vp = BHV_TO_VNODE(bdp); bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
struct inode *ip = vn_to_inode(vp); struct inode *ip = vn_to_inode(vp);
if (VN_CACHED(vp)) { if (VN_CACHED(vp)) {
...@@ -61,7 +61,7 @@ fs_flush_pages( ...@@ -61,7 +61,7 @@ fs_flush_pages(
uint64_t flags, uint64_t flags,
int fiopt) int fiopt)
{ {
vnode_t *vp = BHV_TO_VNODE(bdp); bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
struct inode *ip = vn_to_inode(vp); struct inode *ip = vn_to_inode(vp);
if (VN_DIRTY(vp)) { if (VN_DIRTY(vp)) {
......
...@@ -78,7 +78,7 @@ xfs_find_handle( ...@@ -78,7 +78,7 @@ xfs_find_handle(
xfs_handle_t handle; xfs_handle_t handle;
xfs_fsop_handlereq_t hreq; xfs_fsop_handlereq_t hreq;
struct inode *inode; struct inode *inode;
struct vnode *vp; bhv_vnode_t *vp;
if (copy_from_user(&hreq, arg, sizeof(hreq))) if (copy_from_user(&hreq, arg, sizeof(hreq)))
return -XFS_ERROR(EFAULT); return -XFS_ERROR(EFAULT);
...@@ -192,7 +192,7 @@ xfs_vget_fsop_handlereq( ...@@ -192,7 +192,7 @@ xfs_vget_fsop_handlereq(
xfs_mount_t *mp, xfs_mount_t *mp,
struct inode *parinode, /* parent inode pointer */ struct inode *parinode, /* parent inode pointer */
xfs_fsop_handlereq_t *hreq, xfs_fsop_handlereq_t *hreq,
vnode_t **vp, bhv_vnode_t **vp,
struct inode **inode) struct inode **inode)
{ {
void __user *hanp; void __user *hanp;
...@@ -202,7 +202,7 @@ xfs_vget_fsop_handlereq( ...@@ -202,7 +202,7 @@ xfs_vget_fsop_handlereq(
xfs_handle_t handle; xfs_handle_t handle;
xfs_inode_t *ip; xfs_inode_t *ip;
struct inode *inodep; struct inode *inodep;
vnode_t *vpp; bhv_vnode_t *vpp;
xfs_ino_t ino; xfs_ino_t ino;
__u32 igen; __u32 igen;
int error; int error;
...@@ -277,7 +277,7 @@ xfs_open_by_handle( ...@@ -277,7 +277,7 @@ xfs_open_by_handle(
struct file *filp; struct file *filp;
struct inode *inode; struct inode *inode;
struct dentry *dentry; struct dentry *dentry;
vnode_t *vp; bhv_vnode_t *vp;
xfs_fsop_handlereq_t hreq; xfs_fsop_handlereq_t hreq;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
...@@ -362,7 +362,7 @@ xfs_readlink_by_handle( ...@@ -362,7 +362,7 @@ xfs_readlink_by_handle(
struct uio auio; struct uio auio;
struct inode *inode; struct inode *inode;
xfs_fsop_handlereq_t hreq; xfs_fsop_handlereq_t hreq;
vnode_t *vp; bhv_vnode_t *vp;
__u32 olen; __u32 olen;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
...@@ -393,9 +393,11 @@ xfs_readlink_by_handle( ...@@ -393,9 +393,11 @@ xfs_readlink_by_handle(
auio.uio_segflg = UIO_USERSPACE; auio.uio_segflg = UIO_USERSPACE;
auio.uio_resid = olen; auio.uio_resid = olen;
VOP_READLINK(vp, &auio, IO_INVIS, NULL, error); error = bhv_vop_readlink(vp, &auio, IO_INVIS, NULL);
VN_RELE(vp); VN_RELE(vp);
if (error)
return -error;
return (olen - auio.uio_resid); return (olen - auio.uio_resid);
} }
...@@ -411,7 +413,7 @@ xfs_fssetdm_by_handle( ...@@ -411,7 +413,7 @@ xfs_fssetdm_by_handle(
xfs_fsop_setdm_handlereq_t dmhreq; xfs_fsop_setdm_handlereq_t dmhreq;
struct inode *inode; struct inode *inode;
bhv_desc_t *bdp; bhv_desc_t *bdp;
vnode_t *vp; bhv_vnode_t *vp;
if (!capable(CAP_MKNOD)) if (!capable(CAP_MKNOD))
return -XFS_ERROR(EPERM); return -XFS_ERROR(EPERM);
...@@ -452,7 +454,7 @@ xfs_attrlist_by_handle( ...@@ -452,7 +454,7 @@ xfs_attrlist_by_handle(
attrlist_cursor_kern_t *cursor; attrlist_cursor_kern_t *cursor;
xfs_fsop_attrlist_handlereq_t al_hreq; xfs_fsop_attrlist_handlereq_t al_hreq;
struct inode *inode; struct inode *inode;
vnode_t *vp; bhv_vnode_t *vp;
char *kbuf; char *kbuf;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
...@@ -472,8 +474,8 @@ xfs_attrlist_by_handle( ...@@ -472,8 +474,8 @@ xfs_attrlist_by_handle(
goto out_vn_rele; goto out_vn_rele;
cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; cursor = (attrlist_cursor_kern_t *)&al_hreq.pos;
VOP_ATTR_LIST(vp, kbuf, al_hreq.buflen, al_hreq.flags, error = bhv_vop_attr_list(vp, kbuf, al_hreq.buflen, al_hreq.flags,
cursor, NULL, error); cursor, NULL);
if (error) if (error)
goto out_kfree; goto out_kfree;
...@@ -490,7 +492,7 @@ xfs_attrlist_by_handle( ...@@ -490,7 +492,7 @@ xfs_attrlist_by_handle(
STATIC int STATIC int
xfs_attrmulti_attr_get( xfs_attrmulti_attr_get(
struct vnode *vp, bhv_vnode_t *vp,
char *name, char *name,
char __user *ubuf, char __user *ubuf,
__uint32_t *len, __uint32_t *len,
...@@ -505,7 +507,7 @@ xfs_attrmulti_attr_get( ...@@ -505,7 +507,7 @@ xfs_attrmulti_attr_get(
if (!kbuf) if (!kbuf)
return ENOMEM; return ENOMEM;
VOP_ATTR_GET(vp, name, kbuf, len, flags, NULL, error); error = bhv_vop_attr_get(vp, name, kbuf, len, flags, NULL);
if (error) if (error)
goto out_kfree; goto out_kfree;
...@@ -519,7 +521,7 @@ xfs_attrmulti_attr_get( ...@@ -519,7 +521,7 @@ xfs_attrmulti_attr_get(
STATIC int STATIC int
xfs_attrmulti_attr_set( xfs_attrmulti_attr_set(
struct vnode *vp, bhv_vnode_t *vp,
char *name, char *name,
const char __user *ubuf, const char __user *ubuf,
__uint32_t len, __uint32_t len,
...@@ -542,7 +544,7 @@ xfs_attrmulti_attr_set( ...@@ -542,7 +544,7 @@ xfs_attrmulti_attr_set(
if (copy_from_user(kbuf, ubuf, len)) if (copy_from_user(kbuf, ubuf, len))
goto out_kfree; goto out_kfree;
VOP_ATTR_SET(vp, name, kbuf, len, flags, NULL, error); error = bhv_vop_attr_set(vp, name, kbuf, len, flags, NULL);
out_kfree: out_kfree:
kfree(kbuf); kfree(kbuf);
...@@ -551,20 +553,15 @@ xfs_attrmulti_attr_set( ...@@ -551,20 +553,15 @@ xfs_attrmulti_attr_set(
STATIC int STATIC int
xfs_attrmulti_attr_remove( xfs_attrmulti_attr_remove(
struct vnode *vp, bhv_vnode_t *vp,
char *name, char *name,
__uint32_t flags) __uint32_t flags)
{ {
int error;
if (IS_RDONLY(&vp->v_inode)) if (IS_RDONLY(&vp->v_inode))
return -EROFS; return -EROFS;
if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode))
return EPERM; return EPERM;
return bhv_vop_attr_remove(vp, name, flags, NULL);
VOP_ATTR_REMOVE(vp, name, flags, NULL, error);
return error;
} }
STATIC int STATIC int
...@@ -578,7 +575,7 @@ xfs_attrmulti_by_handle( ...@@ -578,7 +575,7 @@ xfs_attrmulti_by_handle(
xfs_attr_multiop_t *ops; xfs_attr_multiop_t *ops;
xfs_fsop_attrmulti_handlereq_t am_hreq; xfs_fsop_attrmulti_handlereq_t am_hreq;
struct inode *inode; struct inode *inode;
vnode_t *vp; bhv_vnode_t *vp;
unsigned int i, size; unsigned int i, size;
char *attr_name; char *attr_name;
...@@ -658,7 +655,7 @@ xfs_attrmulti_by_handle( ...@@ -658,7 +655,7 @@ xfs_attrmulti_by_handle(
STATIC int STATIC int
xfs_ioc_space( xfs_ioc_space(
bhv_desc_t *bdp, bhv_desc_t *bdp,
vnode_t *vp, bhv_vnode_t *vp,
struct file *filp, struct file *filp,
int flags, int flags,
unsigned int cmd, unsigned int cmd,
...@@ -682,7 +679,7 @@ xfs_ioc_fsgeometry( ...@@ -682,7 +679,7 @@ xfs_ioc_fsgeometry(
STATIC int STATIC int
xfs_ioc_xattr( xfs_ioc_xattr(
vnode_t *vp, bhv_vnode_t *vp,
xfs_inode_t *ip, xfs_inode_t *ip,
struct file *filp, struct file *filp,
unsigned int cmd, unsigned int cmd,
...@@ -711,7 +708,7 @@ xfs_ioctl( ...@@ -711,7 +708,7 @@ xfs_ioctl(
void __user *arg) void __user *arg)
{ {
int error; int error;
vnode_t *vp; bhv_vnode_t *vp;
xfs_inode_t *ip; xfs_inode_t *ip;
xfs_mount_t *mp; xfs_mount_t *mp;
...@@ -962,7 +959,7 @@ xfs_ioctl( ...@@ -962,7 +959,7 @@ xfs_ioctl(
STATIC int STATIC int
xfs_ioc_space( xfs_ioc_space(
bhv_desc_t *bdp, bhv_desc_t *bdp,
vnode_t *vp, bhv_vnode_t *vp,
struct file *filp, struct file *filp,
int ioflags, int ioflags,
unsigned int cmd, unsigned int cmd,
...@@ -1153,7 +1150,7 @@ xfs_di2lxflags( ...@@ -1153,7 +1150,7 @@ xfs_di2lxflags(
STATIC int STATIC int
xfs_ioc_xattr( xfs_ioc_xattr(
vnode_t *vp, bhv_vnode_t *vp,
xfs_inode_t *ip, xfs_inode_t *ip,
struct file *filp, struct file *filp,
unsigned int cmd, unsigned int cmd,
...@@ -1173,7 +1170,7 @@ xfs_ioc_xattr( ...@@ -1173,7 +1170,7 @@ xfs_ioc_xattr(
case XFS_IOC_FSGETXATTR: { case XFS_IOC_FSGETXATTR: {
vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
XFS_AT_NEXTENTS | XFS_AT_PROJID; XFS_AT_NEXTENTS | XFS_AT_PROJID;
VOP_GETATTR(vp, vattr, 0, NULL, error); error = bhv_vop_getattr(vp, vattr, 0, NULL);
if (unlikely(error)) { if (unlikely(error)) {
error = -error; error = -error;
break; break;
...@@ -1206,7 +1203,7 @@ xfs_ioc_xattr( ...@@ -1206,7 +1203,7 @@ xfs_ioc_xattr(
vattr->va_extsize = fa.fsx_extsize; vattr->va_extsize = fa.fsx_extsize;
vattr->va_projid = fa.fsx_projid; vattr->va_projid = fa.fsx_projid;
VOP_SETATTR(vp, vattr, attr_flags, NULL, error); error = bhv_vop_setattr(vp, vattr, attr_flags, NULL);
if (likely(!error)) if (likely(!error))
__vn_revalidate(vp, vattr); /* update flags */ __vn_revalidate(vp, vattr); /* update flags */
error = -error; error = -error;
...@@ -1216,7 +1213,7 @@ xfs_ioc_xattr( ...@@ -1216,7 +1213,7 @@ xfs_ioc_xattr(
case XFS_IOC_FSGETXATTRA: { case XFS_IOC_FSGETXATTRA: {
vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
XFS_AT_ANEXTENTS | XFS_AT_PROJID; XFS_AT_ANEXTENTS | XFS_AT_PROJID;
VOP_GETATTR(vp, vattr, 0, NULL, error); error = bhv_vop_getattr(vp, vattr, 0, NULL);
if (unlikely(error)) { if (unlikely(error)) {
error = -error; error = -error;
break; break;
...@@ -1262,7 +1259,7 @@ xfs_ioc_xattr( ...@@ -1262,7 +1259,7 @@ xfs_ioc_xattr(
vattr->va_xflags = xfs_merge_ioc_xflags(flags, vattr->va_xflags = xfs_merge_ioc_xflags(flags,
xfs_ip2xflags(ip)); xfs_ip2xflags(ip));
VOP_SETATTR(vp, vattr, attr_flags, NULL, error); error = bhv_vop_setattr(vp, vattr, attr_flags, NULL);
if (likely(!error)) if (likely(!error))
__vn_revalidate(vp, vattr); /* update flags */ __vn_revalidate(vp, vattr); /* update flags */
error = -error; error = -error;
......
...@@ -114,7 +114,7 @@ xfs_compat_ioctl( ...@@ -114,7 +114,7 @@ xfs_compat_ioctl(
unsigned long arg) unsigned long arg)
{ {
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_dentry->d_inode;
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
int error; int error;
switch (cmd) { switch (cmd) {
...@@ -193,7 +193,7 @@ xfs_compat_ioctl( ...@@ -193,7 +193,7 @@ xfs_compat_ioctl(
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
VOP_IOCTL(vp, inode, file, mode, cmd, (void __user *)arg, error); error = bhv_vop_ioctl(vp, inode, file, mode, cmd, (void __user *)arg);
VMODIFY(vp); VMODIFY(vp);
return error; return error;
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
*/ */
xfs_inode_t * xfs_inode_t *
xfs_vtoi( xfs_vtoi(
struct vnode *vp) bhv_vnode_t *vp)
{ {
bhv_desc_t *bdp; bhv_desc_t *bdp;
...@@ -80,7 +80,7 @@ void ...@@ -80,7 +80,7 @@ void
xfs_synchronize_atime( xfs_synchronize_atime(
xfs_inode_t *ip) xfs_inode_t *ip)
{ {
vnode_t *vp; bhv_vnode_t *vp;
vp = XFS_ITOV_NULL(ip); vp = XFS_ITOV_NULL(ip);
if (vp) { if (vp) {
...@@ -202,12 +202,8 @@ xfs_validate_fields( ...@@ -202,12 +202,8 @@ xfs_validate_fields(
struct inode *ip, struct inode *ip,
struct vattr *vattr) struct vattr *vattr)
{ {
vnode_t *vp = vn_from_inode(ip);
int error;
vattr->va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS; vattr->va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS;
VOP_GETATTR(vp, vattr, ATTR_LAZY, NULL, error); if (!bhv_vop_getattr(vn_from_inode(ip), vattr, ATTR_LAZY, NULL)) {
if (likely(!error)) {
ip->i_nlink = vattr->va_nlink; ip->i_nlink = vattr->va_nlink;
ip->i_blocks = vattr->va_nblocks; ip->i_blocks = vattr->va_nblocks;
...@@ -225,7 +221,7 @@ xfs_validate_fields( ...@@ -225,7 +221,7 @@ xfs_validate_fields(
*/ */
STATIC int STATIC int
xfs_init_security( xfs_init_security(
struct vnode *vp, bhv_vnode_t *vp,
struct inode *dir) struct inode *dir)
{ {
struct inode *ip = vn_to_inode(vp); struct inode *ip = vn_to_inode(vp);
...@@ -241,7 +237,7 @@ xfs_init_security( ...@@ -241,7 +237,7 @@ xfs_init_security(
return -error; return -error;
} }
VOP_ATTR_SET(vp, name, value, length, ATTR_SECURE, NULL, error); error = bhv_vop_attr_set(vp, name, value, length, ATTR_SECURE, NULL);
if (!error) if (!error)
VMODIFY(vp); VMODIFY(vp);
...@@ -264,13 +260,12 @@ xfs_has_fs_struct(struct task_struct *task) ...@@ -264,13 +260,12 @@ xfs_has_fs_struct(struct task_struct *task)
STATIC inline void STATIC inline void
xfs_cleanup_inode( xfs_cleanup_inode(
vnode_t *dvp, bhv_vnode_t *dvp,
vnode_t *vp, bhv_vnode_t *vp,
struct dentry *dentry, struct dentry *dentry,
int mode) int mode)
{ {
struct dentry teardown = {}; struct dentry teardown = {};
int error;
/* Oh, the horror. /* Oh, the horror.
* If we can't add the ACL or we fail in * If we can't add the ACL or we fail in
...@@ -281,9 +276,9 @@ xfs_cleanup_inode( ...@@ -281,9 +276,9 @@ xfs_cleanup_inode(
teardown.d_name = dentry->d_name; teardown.d_name = dentry->d_name;
if (S_ISDIR(mode)) if (S_ISDIR(mode))
VOP_RMDIR(dvp, &teardown, NULL, error); bhv_vop_rmdir(dvp, &teardown, NULL);
else else
VOP_REMOVE(dvp, &teardown, NULL, error); bhv_vop_remove(dvp, &teardown, NULL);
VN_RELE(vp); VN_RELE(vp);
} }
...@@ -296,7 +291,7 @@ xfs_vn_mknod( ...@@ -296,7 +291,7 @@ xfs_vn_mknod(
{ {
struct inode *ip; struct inode *ip;
vattr_t vattr = { 0 }; vattr_t vattr = { 0 };
vnode_t *vp = NULL, *dvp = vn_from_inode(dir); bhv_vnode_t *vp = NULL, *dvp = vn_from_inode(dir);
xfs_acl_t *default_acl = NULL; xfs_acl_t *default_acl = NULL;
attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS; attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS;
int error; int error;
...@@ -330,10 +325,10 @@ xfs_vn_mknod( ...@@ -330,10 +325,10 @@ xfs_vn_mknod(
vattr.va_mask |= XFS_AT_RDEV; vattr.va_mask |= XFS_AT_RDEV;
/*FALLTHROUGH*/ /*FALLTHROUGH*/
case S_IFREG: case S_IFREG:
VOP_CREATE(dvp, dentry, &vattr, &vp, NULL, error); error = bhv_vop_create(dvp, dentry, &vattr, &vp, NULL);
break; break;
case S_IFDIR: case S_IFDIR:
VOP_MKDIR(dvp, dentry, &vattr, &vp, NULL, error); error = bhv_vop_mkdir(dvp, dentry, &vattr, &vp, NULL);
break; break;
default: default:
error = EINVAL; error = EINVAL;
...@@ -396,14 +391,14 @@ xfs_vn_lookup( ...@@ -396,14 +391,14 @@ xfs_vn_lookup(
struct dentry *dentry, struct dentry *dentry,
struct nameidata *nd) struct nameidata *nd)
{ {
struct vnode *vp = vn_from_inode(dir), *cvp; bhv_vnode_t *vp = vn_from_inode(dir), *cvp;
int error; int error;
if (dentry->d_name.len >= MAXNAMELEN) if (dentry->d_name.len >= MAXNAMELEN)
return ERR_PTR(-ENAMETOOLONG); return ERR_PTR(-ENAMETOOLONG);
VOP_LOOKUP(vp, dentry, &cvp, 0, NULL, NULL, error); error = bhv_vop_lookup(vp, dentry, &cvp, 0, NULL, NULL);
if (error) { if (unlikely(error)) {
if (unlikely(error != ENOENT)) if (unlikely(error != ENOENT))
return ERR_PTR(-error); return ERR_PTR(-error);
d_add(dentry, NULL); d_add(dentry, NULL);
...@@ -420,8 +415,8 @@ xfs_vn_link( ...@@ -420,8 +415,8 @@ xfs_vn_link(
struct dentry *dentry) struct dentry *dentry)
{ {
struct inode *ip; /* inode of guy being linked to */ struct inode *ip; /* inode of guy being linked to */
vnode_t *tdvp; /* target directory for new name/link */ bhv_vnode_t *tdvp; /* target directory for new name/link */
vnode_t *vp; /* vp of name being linked */ bhv_vnode_t *vp; /* vp of name being linked */
vattr_t vattr; vattr_t vattr;
int error; int error;
...@@ -432,7 +427,7 @@ xfs_vn_link( ...@@ -432,7 +427,7 @@ xfs_vn_link(
tdvp = vn_from_inode(dir); tdvp = vn_from_inode(dir);
vp = vn_from_inode(ip); vp = vn_from_inode(ip);
VOP_LINK(tdvp, vp, dentry, NULL, error); error = bhv_vop_link(tdvp, vp, dentry, NULL);
if (likely(!error)) { if (likely(!error)) {
VMODIFY(tdvp); VMODIFY(tdvp);
VN_HOLD(vp); VN_HOLD(vp);
...@@ -448,14 +443,14 @@ xfs_vn_unlink( ...@@ -448,14 +443,14 @@ xfs_vn_unlink(
struct dentry *dentry) struct dentry *dentry)
{ {
struct inode *inode; struct inode *inode;
vnode_t *dvp; /* directory containing name to remove */ bhv_vnode_t *dvp; /* directory containing name to remove */
vattr_t vattr; vattr_t vattr;
int error; int error;
inode = dentry->d_inode; inode = dentry->d_inode;
dvp = vn_from_inode(dir); dvp = vn_from_inode(dir);
VOP_REMOVE(dvp, dentry, NULL, error); error = bhv_vop_remove(dvp, dentry, NULL);
if (likely(!error)) { if (likely(!error)) {
xfs_validate_fields(dir, &vattr); /* size needs update */ xfs_validate_fields(dir, &vattr); /* size needs update */
xfs_validate_fields(inode, &vattr); xfs_validate_fields(inode, &vattr);
...@@ -470,27 +465,26 @@ xfs_vn_symlink( ...@@ -470,27 +465,26 @@ xfs_vn_symlink(
const char *symname) const char *symname)
{ {
struct inode *ip; struct inode *ip;
vattr_t vattr = { 0 }; vattr_t va = { 0 };
vnode_t *dvp; /* directory containing name of symlink */ bhv_vnode_t *dvp; /* directory containing name of symlink */
vnode_t *cvp; /* used to lookup symlink to put in dentry */ bhv_vnode_t *cvp; /* used to lookup symlink to put in dentry */
int error; int error;
dvp = vn_from_inode(dir); dvp = vn_from_inode(dir);
cvp = NULL; cvp = NULL;
vattr.va_mode = S_IFLNK | va.va_mode = S_IFLNK |
(irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO); (irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO);
vattr.va_mask = XFS_AT_TYPE|XFS_AT_MODE; va.va_mask = XFS_AT_TYPE|XFS_AT_MODE;
error = 0; error = bhv_vop_symlink(dvp, dentry, &va, (char *)symname, &cvp, NULL);
VOP_SYMLINK(dvp, dentry, &vattr, (char *)symname, &cvp, NULL, error);
if (likely(!error && cvp)) { if (likely(!error && cvp)) {
error = xfs_init_security(cvp, dir); error = xfs_init_security(cvp, dir);
if (likely(!error)) { if (likely(!error)) {
ip = vn_to_inode(cvp); ip = vn_to_inode(cvp);
d_instantiate(dentry, ip); d_instantiate(dentry, ip);
xfs_validate_fields(dir, &vattr); xfs_validate_fields(dir, &va);
xfs_validate_fields(ip, &vattr); xfs_validate_fields(ip, &va);
} else { } else {
xfs_cleanup_inode(dvp, cvp, dentry, 0); xfs_cleanup_inode(dvp, cvp, dentry, 0);
} }
...@@ -504,11 +498,11 @@ xfs_vn_rmdir( ...@@ -504,11 +498,11 @@ xfs_vn_rmdir(
struct dentry *dentry) struct dentry *dentry)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
vnode_t *dvp = vn_from_inode(dir); bhv_vnode_t *dvp = vn_from_inode(dir);
vattr_t vattr; vattr_t vattr;
int error; int error;
VOP_RMDIR(dvp, dentry, NULL, error); error = bhv_vop_rmdir(dvp, dentry, NULL);
if (likely(!error)) { if (likely(!error)) {
xfs_validate_fields(inode, &vattr); xfs_validate_fields(inode, &vattr);
xfs_validate_fields(dir, &vattr); xfs_validate_fields(dir, &vattr);
...@@ -524,15 +518,15 @@ xfs_vn_rename( ...@@ -524,15 +518,15 @@ xfs_vn_rename(
struct dentry *ndentry) struct dentry *ndentry)
{ {
struct inode *new_inode = ndentry->d_inode; struct inode *new_inode = ndentry->d_inode;
vnode_t *fvp; /* from directory */ bhv_vnode_t *fvp; /* from directory */
vnode_t *tvp; /* target directory */ bhv_vnode_t *tvp; /* target directory */
vattr_t vattr; vattr_t vattr;
int error; int error;
fvp = vn_from_inode(odir); fvp = vn_from_inode(odir);
tvp = vn_from_inode(ndir); tvp = vn_from_inode(ndir);
VOP_RENAME(fvp, odentry, tvp, ndentry, NULL, error); error = bhv_vop_rename(fvp, odentry, tvp, ndentry, NULL);
if (likely(!error)) { if (likely(!error)) {
if (new_inode) if (new_inode)
xfs_validate_fields(new_inode, &vattr); xfs_validate_fields(new_inode, &vattr);
...@@ -553,7 +547,7 @@ xfs_vn_follow_link( ...@@ -553,7 +547,7 @@ xfs_vn_follow_link(
struct dentry *dentry, struct dentry *dentry,
struct nameidata *nd) struct nameidata *nd)
{ {
vnode_t *vp; bhv_vnode_t *vp;
uio_t *uio; uio_t *uio;
iovec_t iov; iovec_t iov;
int error; int error;
...@@ -586,8 +580,8 @@ xfs_vn_follow_link( ...@@ -586,8 +580,8 @@ xfs_vn_follow_link(
uio->uio_resid = MAXPATHLEN; uio->uio_resid = MAXPATHLEN;
uio->uio_iovcnt = 1; uio->uio_iovcnt = 1;
VOP_READLINK(vp, uio, 0, NULL, error); error = bhv_vop_readlink(vp, uio, 0, NULL);
if (error) { if (unlikely(error)) {
kfree(link); kfree(link);
link = ERR_PTR(-error); link = ERR_PTR(-error);
} else { } else {
...@@ -618,12 +612,7 @@ xfs_vn_permission( ...@@ -618,12 +612,7 @@ xfs_vn_permission(
int mode, int mode,
struct nameidata *nd) struct nameidata *nd)
{ {
vnode_t *vp = vn_from_inode(inode); return -bhv_vop_access(vn_from_inode(inode), mode << 6, NULL);
int error;
mode <<= 6; /* convert from linux to vnode access bits */
VOP_ACCESS(vp, mode, NULL, error);
return -error;
} }
#else #else
#define xfs_vn_permission NULL #define xfs_vn_permission NULL
...@@ -636,7 +625,7 @@ xfs_vn_getattr( ...@@ -636,7 +625,7 @@ xfs_vn_getattr(
struct kstat *stat) struct kstat *stat)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
int error = 0; int error = 0;
if (unlikely(vp->v_flag & VMODIFIED)) if (unlikely(vp->v_flag & VMODIFIED))
...@@ -653,7 +642,7 @@ xfs_vn_setattr( ...@@ -653,7 +642,7 @@ xfs_vn_setattr(
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
unsigned int ia_valid = attr->ia_valid; unsigned int ia_valid = attr->ia_valid;
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
vattr_t vattr = { 0 }; vattr_t vattr = { 0 };
int flags = 0; int flags = 0;
int error; int error;
...@@ -697,7 +686,7 @@ xfs_vn_setattr( ...@@ -697,7 +686,7 @@ xfs_vn_setattr(
flags |= ATTR_NONBLOCK; flags |= ATTR_NONBLOCK;
#endif #endif
VOP_SETATTR(vp, &vattr, flags, NULL, error); error = bhv_vop_setattr(vp, &vattr, flags, NULL);
if (likely(!error)) if (likely(!error))
__vn_revalidate(vp, &vattr); __vn_revalidate(vp, &vattr);
return -error; return -error;
...@@ -718,7 +707,7 @@ xfs_vn_setxattr( ...@@ -718,7 +707,7 @@ xfs_vn_setxattr(
size_t size, size_t size,
int flags) int flags)
{ {
vnode_t *vp = vn_from_inode(dentry->d_inode); bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
char *attr = (char *)name; char *attr = (char *)name;
attrnames_t *namesp; attrnames_t *namesp;
int xflags = 0; int xflags = 0;
...@@ -748,7 +737,7 @@ xfs_vn_getxattr( ...@@ -748,7 +737,7 @@ xfs_vn_getxattr(
void *data, void *data,
size_t size) size_t size)
{ {
vnode_t *vp = vn_from_inode(dentry->d_inode); bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
char *attr = (char *)name; char *attr = (char *)name;
attrnames_t *namesp; attrnames_t *namesp;
int xflags = 0; int xflags = 0;
...@@ -777,7 +766,7 @@ xfs_vn_listxattr( ...@@ -777,7 +766,7 @@ xfs_vn_listxattr(
char *data, char *data,
size_t size) size_t size)
{ {
vnode_t *vp = vn_from_inode(dentry->d_inode); bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
int error, xflags = ATTR_KERNAMELS; int error, xflags = ATTR_KERNAMELS;
ssize_t result; ssize_t result;
...@@ -796,7 +785,7 @@ xfs_vn_removexattr( ...@@ -796,7 +785,7 @@ xfs_vn_removexattr(
struct dentry *dentry, struct dentry *dentry,
const char *name) const char *name)
{ {
vnode_t *vp = vn_from_inode(dentry->d_inode); bhv_vnode_t *vp = vn_from_inode(dentry->d_inode);
char *attr = (char *)name; char *attr = (char *)name;
attrnames_t *namesp; attrnames_t *namesp;
int xflags = 0; int xflags = 0;
......
...@@ -206,7 +206,7 @@ xfs_read( ...@@ -206,7 +206,7 @@ xfs_read(
xfs_fsize_t n; xfs_fsize_t n;
xfs_inode_t *ip; xfs_inode_t *ip;
xfs_mount_t *mp; xfs_mount_t *mp;
vnode_t *vp; bhv_vnode_t *vp;
unsigned long seg; unsigned long seg;
ip = XFS_BHVTOI(bdp); ip = XFS_BHVTOI(bdp);
...@@ -271,7 +271,7 @@ xfs_read( ...@@ -271,7 +271,7 @@ xfs_read(
} }
if (unlikely((ioflags & IO_ISDIRECT) && VN_CACHED(vp))) if (unlikely((ioflags & IO_ISDIRECT) && VN_CACHED(vp)))
VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(*offset)), bhv_vop_flushinval_pages(vp, ctooff(offtoct(*offset)),
-1, FI_REMAPF_LOCKED); -1, FI_REMAPF_LOCKED);
xfs_rw_enter_trace(XFS_READ_ENTER, &ip->i_iocore, xfs_rw_enter_trace(XFS_READ_ENTER, &ip->i_iocore,
...@@ -499,7 +499,7 @@ xfs_zero_last_block( ...@@ -499,7 +499,7 @@ xfs_zero_last_block(
int /* error (positive) */ int /* error (positive) */
xfs_zero_eof( xfs_zero_eof(
vnode_t *vp, bhv_vnode_t *vp,
xfs_iocore_t *io, xfs_iocore_t *io,
xfs_off_t offset, /* starting I/O offset */ xfs_off_t offset, /* starting I/O offset */
xfs_fsize_t isize, /* current inode size */ xfs_fsize_t isize, /* current inode size */
...@@ -626,7 +626,7 @@ xfs_write( ...@@ -626,7 +626,7 @@ xfs_write(
ssize_t ret = 0, error = 0; ssize_t ret = 0, error = 0;
xfs_fsize_t isize, new_size; xfs_fsize_t isize, new_size;
xfs_iocore_t *io; xfs_iocore_t *io;
vnode_t *vp; bhv_vnode_t *vp;
unsigned long seg; unsigned long seg;
int iolock; int iolock;
int eventsent = 0; int eventsent = 0;
...@@ -803,7 +803,7 @@ xfs_write( ...@@ -803,7 +803,7 @@ xfs_write(
if (need_flush) { if (need_flush) {
xfs_inval_cached_trace(io, pos, -1, xfs_inval_cached_trace(io, pos, -1,
ctooff(offtoct(pos)), -1); ctooff(offtoct(pos)), -1);
VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(pos)), bhv_vop_flushinval_pages(vp, ctooff(offtoct(pos)),
-1, FI_REMAPF_LOCKED); -1, FI_REMAPF_LOCKED);
} }
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
#ifndef __XFS_LRW_H__ #ifndef __XFS_LRW_H__
#define __XFS_LRW_H__ #define __XFS_LRW_H__
struct vnode;
struct bhv_desc; struct bhv_desc;
struct bhv_vnode;
struct xfs_mount; struct xfs_mount;
struct xfs_iocore; struct xfs_iocore;
struct xfs_inode; struct xfs_inode;
...@@ -82,7 +82,7 @@ extern int xfsbdstrat(struct xfs_mount *, struct xfs_buf *); ...@@ -82,7 +82,7 @@ extern int xfsbdstrat(struct xfs_mount *, struct xfs_buf *);
extern int xfs_bdstrat_cb(struct xfs_buf *); extern int xfs_bdstrat_cb(struct xfs_buf *);
extern int xfs_dev_is_read_only(struct xfs_mount *, char *); extern int xfs_dev_is_read_only(struct xfs_mount *, char *);
extern int xfs_zero_eof(struct vnode *, struct xfs_iocore *, xfs_off_t, extern int xfs_zero_eof(struct bhv_vnode *, struct xfs_iocore *, xfs_off_t,
xfs_fsize_t, xfs_fsize_t); xfs_fsize_t, xfs_fsize_t);
extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *, extern ssize_t xfs_read(struct bhv_desc *, struct kiocb *,
const struct iovec *, unsigned int, const struct iovec *, unsigned int,
......
...@@ -151,7 +151,7 @@ xfs_set_inodeops( ...@@ -151,7 +151,7 @@ xfs_set_inodeops(
STATIC __inline__ void STATIC __inline__ void
xfs_revalidate_inode( xfs_revalidate_inode(
xfs_mount_t *mp, xfs_mount_t *mp,
vnode_t *vp, bhv_vnode_t *vp,
xfs_inode_t *ip) xfs_inode_t *ip)
{ {
struct inode *inode = vn_to_inode(vp); struct inode *inode = vn_to_inode(vp);
...@@ -206,7 +206,7 @@ xfs_revalidate_inode( ...@@ -206,7 +206,7 @@ xfs_revalidate_inode(
void void
xfs_initialize_vnode( xfs_initialize_vnode(
bhv_desc_t *bdp, bhv_desc_t *bdp,
vnode_t *vp, bhv_vnode_t *vp,
bhv_desc_t *inode_bhv, bhv_desc_t *inode_bhv,
int unlock) int unlock)
{ {
...@@ -336,7 +336,7 @@ STATIC struct inode * ...@@ -336,7 +336,7 @@ STATIC struct inode *
xfs_fs_alloc_inode( xfs_fs_alloc_inode(
struct super_block *sb) struct super_block *sb)
{ {
vnode_t *vp; bhv_vnode_t *vp;
vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
if (unlikely(!vp)) if (unlikely(!vp))
...@@ -359,13 +359,13 @@ xfs_fs_inode_init_once( ...@@ -359,13 +359,13 @@ xfs_fs_inode_init_once(
{ {
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
SLAB_CTOR_CONSTRUCTOR) SLAB_CTOR_CONSTRUCTOR)
inode_init_once(vn_to_inode((vnode_t *)vnode)); inode_init_once(vn_to_inode((bhv_vnode_t *)vnode));
} }
STATIC int STATIC int
xfs_init_zones(void) xfs_init_zones(void)
{ {
xfs_vnode_zone = kmem_zone_init_flags(sizeof(vnode_t), "xfs_vnode_t", xfs_vnode_zone = kmem_zone_init_flags(sizeof(bhv_vnode_t), "xfs_vnode",
KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | KM_ZONE_HWALIGN | KM_ZONE_RECLAIM |
KM_ZONE_SPREAD, KM_ZONE_SPREAD,
xfs_fs_inode_init_once); xfs_fs_inode_init_once);
...@@ -409,22 +409,17 @@ xfs_fs_write_inode( ...@@ -409,22 +409,17 @@ xfs_fs_write_inode(
struct inode *inode, struct inode *inode,
int sync) int sync)
{ {
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
int error = 0, flags = FLUSH_INODE; int error = 0, flags = FLUSH_INODE;
if (vp) { if (vp) {
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
if (sync) if (sync)
flags |= FLUSH_SYNC; flags |= FLUSH_SYNC;
VOP_IFLUSH(vp, flags, error); error = bhv_vop_iflush(vp, flags);
if (error == EAGAIN) { if (error == EAGAIN)
if (sync) error = sync? bhv_vop_iflush(vp, flags | FLUSH_LOG) : 0;
VOP_IFLUSH(vp, flags | FLUSH_LOG, error);
else
error = 0;
}
} }
return -error; return -error;
} }
...@@ -432,8 +427,7 @@ STATIC void ...@@ -432,8 +427,7 @@ STATIC void
xfs_fs_clear_inode( xfs_fs_clear_inode(
struct inode *inode) struct inode *inode)
{ {
vnode_t *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
int error, cache;
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
...@@ -446,20 +440,18 @@ xfs_fs_clear_inode( ...@@ -446,20 +440,18 @@ xfs_fs_clear_inode(
* This can happen because xfs_iget_core calls xfs_idestroy if we * This can happen because xfs_iget_core calls xfs_idestroy if we
* find an inode with di_mode == 0 but without IGET_CREATE set. * find an inode with di_mode == 0 but without IGET_CREATE set.
*/ */
if (vp->v_fbhv) if (VNHEAD(vp))
VOP_INACTIVE(vp, NULL, cache); bhv_vop_inactive(vp, NULL);
VN_LOCK(vp); VN_LOCK(vp);
vp->v_flag &= ~VMODIFIED; vp->v_flag &= ~VMODIFIED;
VN_UNLOCK(vp, 0); VN_UNLOCK(vp, 0);
if (vp->v_fbhv) { if (VNHEAD(vp))
VOP_RECLAIM(vp, error); if (bhv_vop_reclaim(vp))
if (error) panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, vp);
panic("vn_purge: cannot reclaim");
}
ASSERT(vp->v_fbhv == NULL); ASSERT(VNHEAD(vp) == NULL);
#ifdef XFS_VNODE_TRACE #ifdef XFS_VNODE_TRACE
ktrace_free(vp->v_trace); ktrace_free(vp->v_trace);
...@@ -789,7 +781,7 @@ xfs_fs_fill_super( ...@@ -789,7 +781,7 @@ xfs_fs_fill_super(
void *data, void *data,
int silent) int silent)
{ {
vnode_t *rootvp; struct bhv_vnode *rootvp;
struct bhv_vfs *vfsp = vfs_allocate(sb); struct bhv_vfs *vfsp = vfs_allocate(sb);
struct xfs_mount_args *args = xfs_args_allocate(sb, silent); struct xfs_mount_args *args = xfs_args_allocate(sb, silent);
struct kstatfs statvfs; struct kstatfs statvfs;
......
...@@ -105,7 +105,7 @@ struct block_device; ...@@ -105,7 +105,7 @@ struct block_device;
extern __uint64_t xfs_max_file_offset(unsigned int); extern __uint64_t xfs_max_file_offset(unsigned int);
extern void xfs_initialize_vnode(bhv_desc_t *, vnode_t *, bhv_desc_t *, int); extern void xfs_initialize_vnode(bhv_desc_t *, bhv_vnode_t *, bhv_desc_t *, int);
extern void xfs_flush_inode(struct xfs_inode *); extern void xfs_flush_inode(struct xfs_inode *);
extern void xfs_flush_device(struct xfs_inode *); extern void xfs_flush_device(struct xfs_inode *);
......
...@@ -104,7 +104,7 @@ vfs_mntupdate( ...@@ -104,7 +104,7 @@ vfs_mntupdate(
int int
vfs_root( vfs_root(
struct bhv_desc *bdp, struct bhv_desc *bdp,
struct vnode **vpp) struct bhv_vnode **vpp)
{ {
struct bhv_desc *next = bdp; struct bhv_desc *next = bdp;
...@@ -118,7 +118,7 @@ int ...@@ -118,7 +118,7 @@ int
vfs_statvfs( vfs_statvfs(
struct bhv_desc *bdp, struct bhv_desc *bdp,
xfs_statfs_t *sp, xfs_statfs_t *sp,
struct vnode *vp) struct bhv_vnode *vp)
{ {
struct bhv_desc *next = bdp; struct bhv_desc *next = bdp;
...@@ -145,7 +145,7 @@ vfs_sync( ...@@ -145,7 +145,7 @@ vfs_sync(
int int
vfs_vget( vfs_vget(
struct bhv_desc *bdp, struct bhv_desc *bdp,
struct vnode **vpp, struct bhv_vnode **vpp,
struct fid *fidp) struct fid *fidp)
{ {
struct bhv_desc *next = bdp; struct bhv_desc *next = bdp;
...@@ -187,7 +187,7 @@ vfs_quotactl( ...@@ -187,7 +187,7 @@ vfs_quotactl(
void void
vfs_init_vnode( vfs_init_vnode(
struct bhv_desc *bdp, struct bhv_desc *bdp,
struct vnode *vp, struct bhv_vnode *vp,
struct bhv_desc *bp, struct bhv_desc *bp,
int unlock) int unlock)
{ {
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
#include "xfs_fs.h" #include "xfs_fs.h"
struct bhv_vfs; struct bhv_vfs;
struct bhv_vnode;
struct fid; struct fid;
struct cred; struct cred;
struct vnode;
struct statfs; struct statfs;
struct seq_file; struct seq_file;
struct super_block; struct super_block;
...@@ -53,8 +53,6 @@ typedef struct bhv_vfs { ...@@ -53,8 +53,6 @@ typedef struct bhv_vfs {
wait_queue_head_t vfs_wait_single_sync_task; wait_queue_head_t vfs_wait_single_sync_task;
} bhv_vfs_t; } bhv_vfs_t;
#define vfs_fbhv vfs_bh.bh_first /* 1st on vfs behavior chain */
#define bhvtovfs(bdp) ( (struct bhv_vfs *)BHV_VOBJ(bdp) ) #define bhvtovfs(bdp) ( (struct bhv_vfs *)BHV_VOBJ(bdp) )
#define bhvtovfsops(bdp) ( (struct bhv_vfsops *)BHV_OPS(bdp) ) #define bhvtovfsops(bdp) ( (struct bhv_vfsops *)BHV_OPS(bdp) )
#define VFS_BHVHEAD(vfs) ( &(vfs)->vfs_bh ) #define VFS_BHVHEAD(vfs) ( &(vfs)->vfs_bh )
...@@ -110,14 +108,15 @@ typedef int (*vfs_showargs_t)(bhv_desc_t *, struct seq_file *); ...@@ -110,14 +108,15 @@ typedef int (*vfs_showargs_t)(bhv_desc_t *, struct seq_file *);
typedef int (*vfs_unmount_t)(bhv_desc_t *, int, struct cred *); typedef int (*vfs_unmount_t)(bhv_desc_t *, int, struct cred *);
typedef int (*vfs_mntupdate_t)(bhv_desc_t *, int *, typedef int (*vfs_mntupdate_t)(bhv_desc_t *, int *,
struct xfs_mount_args *); struct xfs_mount_args *);
typedef int (*vfs_root_t)(bhv_desc_t *, struct vnode **); typedef int (*vfs_root_t)(bhv_desc_t *, struct bhv_vnode **);
typedef int (*vfs_statvfs_t)(bhv_desc_t *, xfs_statfs_t *, struct vnode *); typedef int (*vfs_statvfs_t)(bhv_desc_t *, xfs_statfs_t *,
struct bhv_vnode *);
typedef int (*vfs_sync_t)(bhv_desc_t *, int, struct cred *); typedef int (*vfs_sync_t)(bhv_desc_t *, int, struct cred *);
typedef int (*vfs_vget_t)(bhv_desc_t *, struct vnode **, struct fid *); typedef int (*vfs_vget_t)(bhv_desc_t *, struct bhv_vnode **, struct fid *);
typedef int (*vfs_dmapiops_t)(bhv_desc_t *, caddr_t); typedef int (*vfs_dmapiops_t)(bhv_desc_t *, caddr_t);
typedef int (*vfs_quotactl_t)(bhv_desc_t *, int, int, caddr_t); typedef int (*vfs_quotactl_t)(bhv_desc_t *, int, int, caddr_t);
typedef void (*vfs_init_vnode_t)(bhv_desc_t *, typedef void (*vfs_init_vnode_t)(bhv_desc_t *,
struct vnode *, bhv_desc_t *, int); struct bhv_vnode *, bhv_desc_t *, int);
typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int); typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int);
typedef void (*vfs_freeze_t)(bhv_desc_t *); typedef void (*vfs_freeze_t)(bhv_desc_t *);
...@@ -140,26 +139,26 @@ typedef struct bhv_vfsops { ...@@ -140,26 +139,26 @@ typedef struct bhv_vfsops {
} bhv_vfsops_t; } bhv_vfsops_t;
/* /*
* VFS's. Operates on vfs structure pointers (starts at bhv head). * Virtual filesystem operations, operating from head bhv.
*/ */
#define VHEAD(v) ((v)->vfs_fbhv) #define VFSHEAD(v) ((v)->vfs_bh.bh_first)
#define bhv_vfs_mount(v, ma,cr) vfs_mount(VHEAD(v), ma,cr) #define bhv_vfs_mount(v, ma,cr) vfs_mount(VFSHEAD(v), ma,cr)
#define bhv_vfs_parseargs(v, o,ma,f) vfs_parseargs(VHEAD(v), o,ma,f) #define bhv_vfs_parseargs(v, o,ma,f) vfs_parseargs(VFSHEAD(v), o,ma,f)
#define bhv_vfs_showargs(v, m) vfs_showargs(VHEAD(v), m) #define bhv_vfs_showargs(v, m) vfs_showargs(VFSHEAD(v), m)
#define bhv_vfs_unmount(v, f,cr) vfs_unmount(VHEAD(v), f,cr) #define bhv_vfs_unmount(v, f,cr) vfs_unmount(VFSHEAD(v), f,cr)
#define bhv_vfs_mntupdate(v, fl,args) vfs_mntupdate(VHEAD(v), fl,args) #define bhv_vfs_mntupdate(v, fl,args) vfs_mntupdate(VFSHEAD(v), fl,args)
#define bhv_vfs_root(v, vpp) vfs_root(VHEAD(v), vpp) #define bhv_vfs_root(v, vpp) vfs_root(VFSHEAD(v), vpp)
#define bhv_vfs_statvfs(v, sp,vp) vfs_statvfs(VHEAD(v), sp,vp) #define bhv_vfs_statvfs(v, sp,vp) vfs_statvfs(VFSHEAD(v), sp,vp)
#define bhv_vfs_sync(v, flag,cr) vfs_sync(VHEAD(v), flag,cr) #define bhv_vfs_sync(v, flag,cr) vfs_sync(VFSHEAD(v), flag,cr)
#define bhv_vfs_vget(v, vpp,fidp) vfs_vget(VHEAD(v), vpp,fidp) #define bhv_vfs_vget(v, vpp,fidp) vfs_vget(VFSHEAD(v), vpp,fidp)
#define bhv_vfs_dmapiops(v, p) vfs_dmapiops(VHEAD(v), p) #define bhv_vfs_dmapiops(v, p) vfs_dmapiops(VFSHEAD(v), p)
#define bhv_vfs_quotactl(v, c,id,p) vfs_quotactl(VHEAD(v), c,id,p) #define bhv_vfs_quotactl(v, c,id,p) vfs_quotactl(VFSHEAD(v), c,id,p)
#define bhv_vfs_init_vnode(v, vp,b,ul) vfs_init_vnode(VHEAD(v), vp,b,ul) #define bhv_vfs_init_vnode(v, vp,b,ul) vfs_init_vnode(VFSHEAD(v), vp,b,ul)
#define bhv_vfs_force_shutdown(v,u,f,l) vfs_force_shutdown(VHEAD(v), u,f,l) #define bhv_vfs_force_shutdown(v,u,f,l) vfs_force_shutdown(VFSHEAD(v), u,f,l)
#define bhv_vfs_freeze(v) vfs_freeze(VHEAD(v)) #define bhv_vfs_freeze(v) vfs_freeze(VFSHEAD(v))
/* /*
* PVFS's. Operates on behavior descriptor pointers. * Virtual filesystem operations, operating from next bhv.
*/ */
#define bhv_next_vfs_mount(b, ma,cr) vfs_mount(b, ma,cr) #define bhv_next_vfs_mount(b, ma,cr) vfs_mount(b, ma,cr)
#define bhv_next_vfs_parseargs(b, o,ma,f) vfs_parseargs(b, o,ma,f) #define bhv_next_vfs_parseargs(b, o,ma,f) vfs_parseargs(b, o,ma,f)
...@@ -181,13 +180,13 @@ extern int vfs_parseargs(bhv_desc_t *, char *, struct xfs_mount_args *, int); ...@@ -181,13 +180,13 @@ extern int vfs_parseargs(bhv_desc_t *, char *, struct xfs_mount_args *, int);
extern int vfs_showargs(bhv_desc_t *, struct seq_file *); extern int vfs_showargs(bhv_desc_t *, struct seq_file *);
extern int vfs_unmount(bhv_desc_t *, int, struct cred *); extern int vfs_unmount(bhv_desc_t *, int, struct cred *);
extern int vfs_mntupdate(bhv_desc_t *, int *, struct xfs_mount_args *); extern int vfs_mntupdate(bhv_desc_t *, int *, struct xfs_mount_args *);
extern int vfs_root(bhv_desc_t *, struct vnode **); extern int vfs_root(bhv_desc_t *, struct bhv_vnode **);
extern int vfs_statvfs(bhv_desc_t *, xfs_statfs_t *, struct vnode *); extern int vfs_statvfs(bhv_desc_t *, xfs_statfs_t *, struct bhv_vnode *);
extern int vfs_sync(bhv_desc_t *, int, struct cred *); extern int vfs_sync(bhv_desc_t *, int, struct cred *);
extern int vfs_vget(bhv_desc_t *, struct vnode **, struct fid *); extern int vfs_vget(bhv_desc_t *, struct bhv_vnode **, struct fid *);
extern int vfs_dmapiops(bhv_desc_t *, caddr_t); extern int vfs_dmapiops(bhv_desc_t *, caddr_t);
extern int vfs_quotactl(bhv_desc_t *, int, int, caddr_t); extern int vfs_quotactl(bhv_desc_t *, int, int, caddr_t);
extern void vfs_init_vnode(bhv_desc_t *, struct vnode *, bhv_desc_t *, int); extern void vfs_init_vnode(bhv_desc_t *, struct bhv_vnode *, bhv_desc_t *, int);
extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int); extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int);
extern void vfs_freeze(bhv_desc_t *); extern void vfs_freeze(bhv_desc_t *);
......
...@@ -39,7 +39,7 @@ vn_init(void) ...@@ -39,7 +39,7 @@ vn_init(void)
void void
vn_iowait( vn_iowait(
struct vnode *vp) bhv_vnode_t *vp)
{ {
wait_queue_head_t *wq = vptosync(vp); wait_queue_head_t *wq = vptosync(vp);
...@@ -48,7 +48,7 @@ vn_iowait( ...@@ -48,7 +48,7 @@ vn_iowait(
void void
vn_iowake( vn_iowake(
struct vnode *vp) bhv_vnode_t *vp)
{ {
if (atomic_dec_and_test(&vp->v_iocount)) if (atomic_dec_and_test(&vp->v_iocount))
wake_up(vptosync(vp)); wake_up(vptosync(vp));
...@@ -61,7 +61,7 @@ vn_iowake( ...@@ -61,7 +61,7 @@ vn_iowake(
*/ */
void void
vn_ioerror( vn_ioerror(
struct vnode *vp, bhv_vnode_t *vp,
int error, int error,
char *f, char *f,
int l) int l)
...@@ -70,11 +70,11 @@ vn_ioerror( ...@@ -70,11 +70,11 @@ vn_ioerror(
bhv_vfs_force_shutdown(vp->v_vfsp, SHUTDOWN_DEVICE_REQ, f, l); bhv_vfs_force_shutdown(vp->v_vfsp, SHUTDOWN_DEVICE_REQ, f, l);
} }
struct vnode * bhv_vnode_t *
vn_initialize( vn_initialize(
struct inode *inode) struct inode *inode)
{ {
struct vnode *vp = vn_from_inode(inode); bhv_vnode_t *vp = vn_from_inode(inode);
XFS_STATS_INC(vn_active); XFS_STATS_INC(vn_active);
XFS_STATS_INC(vn_alloc); XFS_STATS_INC(vn_alloc);
...@@ -110,7 +110,7 @@ vn_initialize( ...@@ -110,7 +110,7 @@ vn_initialize(
*/ */
void void
vn_revalidate_core( vn_revalidate_core(
struct vnode *vp, bhv_vnode_t *vp,
vattr_t *vap) vattr_t *vap)
{ {
struct inode *inode = vn_to_inode(vp); struct inode *inode = vn_to_inode(vp);
...@@ -146,14 +146,14 @@ vn_revalidate_core( ...@@ -146,14 +146,14 @@ vn_revalidate_core(
*/ */
int int
__vn_revalidate( __vn_revalidate(
struct vnode *vp, bhv_vnode_t *vp,
struct vattr *vattr) struct vattr *vattr)
{ {
int error; int error;
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS; vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS;
VOP_GETATTR(vp, vattr, 0, NULL, error); error = bhv_vop_getattr(vp, vattr, 0, NULL);
if (likely(!error)) { if (likely(!error)) {
vn_revalidate_core(vp, vattr); vn_revalidate_core(vp, vattr);
VUNMODIFY(vp); VUNMODIFY(vp);
...@@ -163,7 +163,7 @@ __vn_revalidate( ...@@ -163,7 +163,7 @@ __vn_revalidate(
int int
vn_revalidate( vn_revalidate(
struct vnode *vp) bhv_vnode_t *vp)
{ {
vattr_t vattr; vattr_t vattr;
...@@ -173,9 +173,9 @@ vn_revalidate( ...@@ -173,9 +173,9 @@ vn_revalidate(
/* /*
* Add a reference to a referenced vnode. * Add a reference to a referenced vnode.
*/ */
struct vnode * bhv_vnode_t *
vn_hold( vn_hold(
struct vnode *vp) bhv_vnode_t *vp)
{ {
struct inode *inode; struct inode *inode;
...@@ -208,31 +208,31 @@ vn_hold( ...@@ -208,31 +208,31 @@ vn_hold(
* Vnode tracing code. * Vnode tracing code.
*/ */
void void
vn_trace_entry(vnode_t *vp, const char *func, inst_t *ra) vn_trace_entry(bhv_vnode_t *vp, const char *func, inst_t *ra)
{ {
KTRACE_ENTER(vp, VNODE_KTRACE_ENTRY, func, 0, ra); KTRACE_ENTER(vp, VNODE_KTRACE_ENTRY, func, 0, ra);
} }
void void
vn_trace_exit(vnode_t *vp, const char *func, inst_t *ra) vn_trace_exit(bhv_vnode_t *vp, const char *func, inst_t *ra)
{ {
KTRACE_ENTER(vp, VNODE_KTRACE_EXIT, func, 0, ra); KTRACE_ENTER(vp, VNODE_KTRACE_EXIT, func, 0, ra);
} }
void void
vn_trace_hold(vnode_t *vp, char *file, int line, inst_t *ra) vn_trace_hold(bhv_vnode_t *vp, char *file, int line, inst_t *ra)
{ {
KTRACE_ENTER(vp, VNODE_KTRACE_HOLD, file, line, ra); KTRACE_ENTER(vp, VNODE_KTRACE_HOLD, file, line, ra);
} }
void void
vn_trace_ref(vnode_t *vp, char *file, int line, inst_t *ra) vn_trace_ref(bhv_vnode_t *vp, char *file, int line, inst_t *ra)
{ {
KTRACE_ENTER(vp, VNODE_KTRACE_REF, file, line, ra); KTRACE_ENTER(vp, VNODE_KTRACE_REF, file, line, ra);
} }
void void
vn_trace_rele(vnode_t *vp, char *file, int line, inst_t *ra) vn_trace_rele(bhv_vnode_t *vp, char *file, int line, inst_t *ra)
{ {
KTRACE_ENTER(vp, VNODE_KTRACE_RELE, file, line, ra); KTRACE_ENTER(vp, VNODE_KTRACE_RELE, file, line, ra);
} }
......
This diff is collapsed.
...@@ -192,7 +192,7 @@ STATIC int ...@@ -192,7 +192,7 @@ STATIC int
xfs_qm_statvfs( xfs_qm_statvfs(
struct bhv_desc *bhv, struct bhv_desc *bhv,
xfs_statfs_t *statp, xfs_statfs_t *statp,
struct vnode *vnode) struct bhv_vnode *vnode)
{ {
xfs_mount_t *mp; xfs_mount_t *mp;
xfs_inode_t *ip; xfs_inode_t *ip;
......
...@@ -1035,7 +1035,7 @@ xfs_qm_dqrele_all_inodes( ...@@ -1035,7 +1035,7 @@ xfs_qm_dqrele_all_inodes(
{ {
xfs_inode_t *ip, *topino; xfs_inode_t *ip, *topino;
uint ireclaims; uint ireclaims;
vnode_t *vp; bhv_vnode_t *vp;
boolean_t vnode_refd; boolean_t vnode_refd;
ASSERT(mp->m_quotainfo); ASSERT(mp->m_quotainfo);
......
...@@ -39,15 +39,15 @@ ...@@ -39,15 +39,15 @@
#include <linux/capability.h> #include <linux/capability.h>
#include <linux/posix_acl_xattr.h> #include <linux/posix_acl_xattr.h>
STATIC int xfs_acl_setmode(vnode_t *, xfs_acl_t *, int *); STATIC int xfs_acl_setmode(bhv_vnode_t *, xfs_acl_t *, int *);
STATIC void xfs_acl_filter_mode(mode_t, xfs_acl_t *); STATIC void xfs_acl_filter_mode(mode_t, xfs_acl_t *);
STATIC void xfs_acl_get_endian(xfs_acl_t *); STATIC void xfs_acl_get_endian(xfs_acl_t *);
STATIC int xfs_acl_access(uid_t, gid_t, xfs_acl_t *, mode_t, cred_t *); STATIC int xfs_acl_access(uid_t, gid_t, xfs_acl_t *, mode_t, cred_t *);
STATIC int xfs_acl_invalid(xfs_acl_t *); STATIC int xfs_acl_invalid(xfs_acl_t *);
STATIC void xfs_acl_sync_mode(mode_t, xfs_acl_t *); STATIC void xfs_acl_sync_mode(mode_t, xfs_acl_t *);
STATIC void xfs_acl_get_attr(vnode_t *, xfs_acl_t *, int, int, int *); STATIC void xfs_acl_get_attr(bhv_vnode_t *, xfs_acl_t *, int, int, int *);
STATIC void xfs_acl_set_attr(vnode_t *, xfs_acl_t *, int, int *); STATIC void xfs_acl_set_attr(bhv_vnode_t *, xfs_acl_t *, int, int *);
STATIC int xfs_acl_allow_set(vnode_t *, int); STATIC int xfs_acl_allow_set(bhv_vnode_t *, int);
kmem_zone_t *xfs_acl_zone; kmem_zone_t *xfs_acl_zone;
...@@ -57,7 +57,7 @@ kmem_zone_t *xfs_acl_zone; ...@@ -57,7 +57,7 @@ kmem_zone_t *xfs_acl_zone;
*/ */
int int
xfs_acl_vhasacl_access( xfs_acl_vhasacl_access(
vnode_t *vp) bhv_vnode_t *vp)
{ {
int error; int error;
...@@ -70,7 +70,7 @@ xfs_acl_vhasacl_access( ...@@ -70,7 +70,7 @@ xfs_acl_vhasacl_access(
*/ */
int int
xfs_acl_vhasacl_default( xfs_acl_vhasacl_default(
vnode_t *vp) bhv_vnode_t *vp)
{ {
int error; int error;
...@@ -209,7 +209,7 @@ posix_acl_xfs_to_xattr( ...@@ -209,7 +209,7 @@ posix_acl_xfs_to_xattr(
int int
xfs_acl_vget( xfs_acl_vget(
vnode_t *vp, bhv_vnode_t *vp,
void *acl, void *acl,
size_t size, size_t size,
int kind) int kind)
...@@ -244,7 +244,7 @@ xfs_acl_vget( ...@@ -244,7 +244,7 @@ xfs_acl_vget(
vattr_t va; vattr_t va;
va.va_mask = XFS_AT_MODE; va.va_mask = XFS_AT_MODE;
VOP_GETATTR(vp, &va, 0, sys_cred, error); error = bhv_vop_getattr(vp, &va, 0, sys_cred);
if (error) if (error)
goto out; goto out;
xfs_acl_sync_mode(va.va_mode, xfs_acl); xfs_acl_sync_mode(va.va_mode, xfs_acl);
...@@ -260,7 +260,7 @@ xfs_acl_vget( ...@@ -260,7 +260,7 @@ xfs_acl_vget(
int int
xfs_acl_vremove( xfs_acl_vremove(
vnode_t *vp, bhv_vnode_t *vp,
int kind) int kind)
{ {
int error; int error;
...@@ -268,9 +268,9 @@ xfs_acl_vremove( ...@@ -268,9 +268,9 @@ xfs_acl_vremove(
VN_HOLD(vp); VN_HOLD(vp);
error = xfs_acl_allow_set(vp, kind); error = xfs_acl_allow_set(vp, kind);
if (!error) { if (!error) {
VOP_ATTR_REMOVE(vp, kind == _ACL_TYPE_DEFAULT? error = bhv_vop_attr_remove(vp, kind == _ACL_TYPE_DEFAULT?
SGI_ACL_DEFAULT: SGI_ACL_FILE, SGI_ACL_DEFAULT: SGI_ACL_FILE,
ATTR_ROOT, sys_cred, error); ATTR_ROOT, sys_cred);
if (error == ENOATTR) if (error == ENOATTR)
error = 0; /* 'scool */ error = 0; /* 'scool */
} }
...@@ -280,7 +280,7 @@ xfs_acl_vremove( ...@@ -280,7 +280,7 @@ xfs_acl_vremove(
int int
xfs_acl_vset( xfs_acl_vset(
vnode_t *vp, bhv_vnode_t *vp,
void *acl, void *acl,
size_t size, size_t size,
int kind) int kind)
...@@ -370,7 +370,7 @@ xfs_acl_iaccess( ...@@ -370,7 +370,7 @@ xfs_acl_iaccess(
STATIC int STATIC int
xfs_acl_allow_set( xfs_acl_allow_set(
vnode_t *vp, bhv_vnode_t *vp,
int kind) int kind)
{ {
vattr_t va; vattr_t va;
...@@ -383,7 +383,7 @@ xfs_acl_allow_set( ...@@ -383,7 +383,7 @@ xfs_acl_allow_set(
if (vp->v_vfsp->vfs_flag & VFS_RDONLY) if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
return EROFS; return EROFS;
va.va_mask = XFS_AT_UID; va.va_mask = XFS_AT_UID;
VOP_GETATTR(vp, &va, 0, NULL, error); error = bhv_vop_getattr(vp, &va, 0, NULL);
if (error) if (error)
return error; return error;
if (va.va_uid != current->fsuid && !capable(CAP_FOWNER)) if (va.va_uid != current->fsuid && !capable(CAP_FOWNER))
...@@ -606,7 +606,7 @@ xfs_acl_get_endian( ...@@ -606,7 +606,7 @@ xfs_acl_get_endian(
*/ */
STATIC void STATIC void
xfs_acl_get_attr( xfs_acl_get_attr(
vnode_t *vp, bhv_vnode_t *vp,
xfs_acl_t *aclp, xfs_acl_t *aclp,
int kind, int kind,
int flags, int flags,
...@@ -616,9 +616,9 @@ xfs_acl_get_attr( ...@@ -616,9 +616,9 @@ xfs_acl_get_attr(
ASSERT((flags & ATTR_KERNOVAL) ? (aclp == NULL) : 1); ASSERT((flags & ATTR_KERNOVAL) ? (aclp == NULL) : 1);
flags |= ATTR_ROOT; flags |= ATTR_ROOT;
VOP_ATTR_GET(vp, *error = bhv_vop_attr_get(vp, kind == _ACL_TYPE_ACCESS ?
kind == _ACL_TYPE_ACCESS ? SGI_ACL_FILE : SGI_ACL_DEFAULT, SGI_ACL_FILE : SGI_ACL_DEFAULT,
(char *)aclp, &len, flags, sys_cred, *error); (char *)aclp, &len, flags, sys_cred);
if (*error || (flags & ATTR_KERNOVAL)) if (*error || (flags & ATTR_KERNOVAL))
return; return;
xfs_acl_get_endian(aclp); xfs_acl_get_endian(aclp);
...@@ -629,7 +629,7 @@ xfs_acl_get_attr( ...@@ -629,7 +629,7 @@ xfs_acl_get_attr(
*/ */
STATIC void STATIC void
xfs_acl_set_attr( xfs_acl_set_attr(
vnode_t *vp, bhv_vnode_t *vp,
xfs_acl_t *aclp, xfs_acl_t *aclp,
int kind, int kind,
int *error) int *error)
...@@ -654,15 +654,15 @@ xfs_acl_set_attr( ...@@ -654,15 +654,15 @@ xfs_acl_set_attr(
INT_SET(newace->ae_perm, ARCH_CONVERT, ace->ae_perm); INT_SET(newace->ae_perm, ARCH_CONVERT, ace->ae_perm);
} }
INT_SET(newacl->acl_cnt, ARCH_CONVERT, aclp->acl_cnt); INT_SET(newacl->acl_cnt, ARCH_CONVERT, aclp->acl_cnt);
VOP_ATTR_SET(vp, *error = bhv_vop_attr_set(vp, kind == _ACL_TYPE_ACCESS ?
kind == _ACL_TYPE_ACCESS ? SGI_ACL_FILE: SGI_ACL_DEFAULT, SGI_ACL_FILE: SGI_ACL_DEFAULT,
(char *)newacl, len, ATTR_ROOT, sys_cred, *error); (char *)newacl, len, ATTR_ROOT, sys_cred);
_ACL_FREE(newacl); _ACL_FREE(newacl);
} }
int int
xfs_acl_vtoacl( xfs_acl_vtoacl(
vnode_t *vp, bhv_vnode_t *vp,
xfs_acl_t *access_acl, xfs_acl_t *access_acl,
xfs_acl_t *default_acl) xfs_acl_t *default_acl)
{ {
...@@ -678,7 +678,7 @@ xfs_acl_vtoacl( ...@@ -678,7 +678,7 @@ xfs_acl_vtoacl(
if (!error) { if (!error) {
/* Got the ACL, need the mode... */ /* Got the ACL, need the mode... */
va.va_mask = XFS_AT_MODE; va.va_mask = XFS_AT_MODE;
VOP_GETATTR(vp, &va, 0, sys_cred, error); error = bhv_vop_getattr(vp, &va, 0, sys_cred);
} }
if (error) if (error)
...@@ -701,7 +701,7 @@ xfs_acl_vtoacl( ...@@ -701,7 +701,7 @@ xfs_acl_vtoacl(
*/ */
int int
xfs_acl_inherit( xfs_acl_inherit(
vnode_t *vp, bhv_vnode_t *vp,
vattr_t *vap, vattr_t *vap,
xfs_acl_t *pdaclp) xfs_acl_t *pdaclp)
{ {
...@@ -757,7 +757,7 @@ xfs_acl_inherit( ...@@ -757,7 +757,7 @@ xfs_acl_inherit(
*/ */
STATIC int STATIC int
xfs_acl_setmode( xfs_acl_setmode(
vnode_t *vp, bhv_vnode_t *vp,
xfs_acl_t *acl, xfs_acl_t *acl,
int *basicperms) int *basicperms)
{ {
...@@ -776,7 +776,7 @@ xfs_acl_setmode( ...@@ -776,7 +776,7 @@ xfs_acl_setmode(
* mode. The m:: bits take precedence over the g:: bits. * mode. The m:: bits take precedence over the g:: bits.
*/ */
va.va_mask = XFS_AT_MODE; va.va_mask = XFS_AT_MODE;
VOP_GETATTR(vp, &va, 0, sys_cred, error); error = bhv_vop_getattr(vp, &va, 0, sys_cred);
if (error) if (error)
return error; return error;
...@@ -810,8 +810,7 @@ xfs_acl_setmode( ...@@ -810,8 +810,7 @@ xfs_acl_setmode(
if (gap && nomask) if (gap && nomask)
va.va_mode |= gap->ae_perm << 3; va.va_mode |= gap->ae_perm << 3;
VOP_SETATTR(vp, &va, 0, sys_cred, error); return bhv_vop_setattr(vp, &va, 0, sys_cred);
return error;
} }
/* /*
......
...@@ -50,7 +50,7 @@ typedef struct xfs_acl { ...@@ -50,7 +50,7 @@ typedef struct xfs_acl {
#ifdef CONFIG_XFS_POSIX_ACL #ifdef CONFIG_XFS_POSIX_ACL
struct vattr; struct vattr;
struct vnode; struct bhv_vnode;
struct xfs_inode; struct xfs_inode;
extern struct kmem_zone *xfs_acl_zone; extern struct kmem_zone *xfs_acl_zone;
...@@ -58,14 +58,14 @@ extern struct kmem_zone *xfs_acl_zone; ...@@ -58,14 +58,14 @@ extern struct kmem_zone *xfs_acl_zone;
(zone) = kmem_zone_init(sizeof(xfs_acl_t), (name)) (zone) = kmem_zone_init(sizeof(xfs_acl_t), (name))
#define xfs_acl_zone_destroy(zone) kmem_zone_destroy(zone) #define xfs_acl_zone_destroy(zone) kmem_zone_destroy(zone)
extern int xfs_acl_inherit(struct vnode *, struct vattr *, xfs_acl_t *); extern int xfs_acl_inherit(struct bhv_vnode *, struct vattr *, xfs_acl_t *);
extern int xfs_acl_iaccess(struct xfs_inode *, mode_t, cred_t *); extern int xfs_acl_iaccess(struct xfs_inode *, mode_t, cred_t *);
extern int xfs_acl_vtoacl(struct vnode *, xfs_acl_t *, xfs_acl_t *); extern int xfs_acl_vtoacl(struct bhv_vnode *, xfs_acl_t *, xfs_acl_t *);
extern int xfs_acl_vhasacl_access(struct vnode *); extern int xfs_acl_vhasacl_access(struct bhv_vnode *);
extern int xfs_acl_vhasacl_default(struct vnode *); extern int xfs_acl_vhasacl_default(struct bhv_vnode *);
extern int xfs_acl_vset(struct vnode *, void *, size_t, int); extern int xfs_acl_vset(struct bhv_vnode *, void *, size_t, int);
extern int xfs_acl_vget(struct vnode *, void *, size_t, int); extern int xfs_acl_vget(struct bhv_vnode *, void *, size_t, int);
extern int xfs_acl_vremove(struct vnode *vp, int); extern int xfs_acl_vremove(struct bhv_vnode *, int);
#define _ACL_TYPE_ACCESS 1 #define _ACL_TYPE_ACCESS 1
#define _ACL_TYPE_DEFAULT 2 #define _ACL_TYPE_DEFAULT 2
......
...@@ -2324,56 +2324,56 @@ xfs_attr_trace_enter(int type, char *where, ...@@ -2324,56 +2324,56 @@ xfs_attr_trace_enter(int type, char *where,
STATIC int STATIC int
posix_acl_access_set( posix_acl_access_set(
vnode_t *vp, char *name, void *data, size_t size, int xflags) bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
{ {
return xfs_acl_vset(vp, data, size, _ACL_TYPE_ACCESS); return xfs_acl_vset(vp, data, size, _ACL_TYPE_ACCESS);
} }
STATIC int STATIC int
posix_acl_access_remove( posix_acl_access_remove(
struct vnode *vp, char *name, int xflags) bhv_vnode_t *vp, char *name, int xflags)
{ {
return xfs_acl_vremove(vp, _ACL_TYPE_ACCESS); return xfs_acl_vremove(vp, _ACL_TYPE_ACCESS);
} }
STATIC int STATIC int
posix_acl_access_get( posix_acl_access_get(
vnode_t *vp, char *name, void *data, size_t size, int xflags) bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
{ {
return xfs_acl_vget(vp, data, size, _ACL_TYPE_ACCESS); return xfs_acl_vget(vp, data, size, _ACL_TYPE_ACCESS);
} }
STATIC int STATIC int
posix_acl_access_exists( posix_acl_access_exists(
vnode_t *vp) bhv_vnode_t *vp)
{ {
return xfs_acl_vhasacl_access(vp); return xfs_acl_vhasacl_access(vp);
} }
STATIC int STATIC int
posix_acl_default_set( posix_acl_default_set(
vnode_t *vp, char *name, void *data, size_t size, int xflags) bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
{ {
return xfs_acl_vset(vp, data, size, _ACL_TYPE_DEFAULT); return xfs_acl_vset(vp, data, size, _ACL_TYPE_DEFAULT);
} }
STATIC int STATIC int
posix_acl_default_get( posix_acl_default_get(
vnode_t *vp, char *name, void *data, size_t size, int xflags) bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
{ {
return xfs_acl_vget(vp, data, size, _ACL_TYPE_DEFAULT); return xfs_acl_vget(vp, data, size, _ACL_TYPE_DEFAULT);
} }
STATIC int STATIC int
posix_acl_default_remove( posix_acl_default_remove(
struct vnode *vp, char *name, int xflags) bhv_vnode_t *vp, char *name, int xflags)
{ {
return xfs_acl_vremove(vp, _ACL_TYPE_DEFAULT); return xfs_acl_vremove(vp, _ACL_TYPE_DEFAULT);
} }
STATIC int STATIC int
posix_acl_default_exists( posix_acl_default_exists(
vnode_t *vp) bhv_vnode_t *vp)
{ {
return xfs_acl_vhasacl_default(vp); return xfs_acl_vhasacl_default(vp);
} }
...@@ -2406,21 +2406,18 @@ STATIC struct attrnames *attr_system_names[] = ...@@ -2406,21 +2406,18 @@ STATIC struct attrnames *attr_system_names[] =
STATIC int STATIC int
attr_generic_set( attr_generic_set(
struct vnode *vp, char *name, void *data, size_t size, int xflags) bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
{ {
int error; return -bhv_vop_attr_set(vp, name, data, size, xflags, NULL);
VOP_ATTR_SET(vp, name, data, size, xflags, NULL, error);
return -error;
} }
STATIC int STATIC int
attr_generic_get( attr_generic_get(
struct vnode *vp, char *name, void *data, size_t size, int xflags) bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
{ {
int error, asize = size; int error, asize = size;
VOP_ATTR_GET(vp, name, data, &asize, xflags, NULL, error); error = bhv_vop_attr_get(vp, name, data, &asize, xflags, NULL);
if (!error) if (!error)
return asize; return asize;
return -error; return -error;
...@@ -2428,12 +2425,9 @@ attr_generic_get( ...@@ -2428,12 +2425,9 @@ attr_generic_get(
STATIC int STATIC int
attr_generic_remove( attr_generic_remove(
struct vnode *vp, char *name, int xflags) bhv_vnode_t *vp, char *name, int xflags)
{ {
int error; return -bhv_vop_attr_remove(vp, name, xflags, NULL);
VOP_ATTR_REMOVE(vp, name, xflags, NULL, error);
return -error;
} }
STATIC int STATIC int
...@@ -2461,7 +2455,7 @@ attr_generic_listadd( ...@@ -2461,7 +2455,7 @@ attr_generic_listadd(
STATIC int STATIC int
attr_system_list( attr_system_list(
struct vnode *vp, bhv_vnode_t *vp,
void *data, void *data,
size_t size, size_t size,
ssize_t *result) ssize_t *result)
...@@ -2483,12 +2477,12 @@ attr_system_list( ...@@ -2483,12 +2477,12 @@ attr_system_list(
int int
attr_generic_list( attr_generic_list(
struct vnode *vp, void *data, size_t size, int xflags, ssize_t *result) bhv_vnode_t *vp, void *data, size_t size, int xflags, ssize_t *result)
{ {
attrlist_cursor_kern_t cursor = { 0 }; attrlist_cursor_kern_t cursor = { 0 };
int error; int error;
VOP_ATTR_LIST(vp, data, size, xflags, &cursor, NULL, error); error = bhv_vop_attr_list(vp, data, size, xflags, &cursor, NULL);
if (error > 0) if (error > 0)
return -error; return -error;
*result = -error; *result = -error;
...@@ -2516,7 +2510,7 @@ attr_lookup_namespace( ...@@ -2516,7 +2510,7 @@ attr_lookup_namespace(
*/ */
STATIC int STATIC int
attr_user_capable( attr_user_capable(
struct vnode *vp, bhv_vnode_t *vp,
cred_t *cred) cred_t *cred)
{ {
struct inode *inode = vn_to_inode(vp); struct inode *inode = vn_to_inode(vp);
...@@ -2534,7 +2528,7 @@ attr_user_capable( ...@@ -2534,7 +2528,7 @@ attr_user_capable(
STATIC int STATIC int
attr_trusted_capable( attr_trusted_capable(
struct vnode *vp, bhv_vnode_t *vp,
cred_t *cred) cred_t *cred)
{ {
struct inode *inode = vn_to_inode(vp); struct inode *inode = vn_to_inode(vp);
...@@ -2548,7 +2542,7 @@ attr_trusted_capable( ...@@ -2548,7 +2542,7 @@ attr_trusted_capable(
STATIC int STATIC int
attr_secure_capable( attr_secure_capable(
struct vnode *vp, bhv_vnode_t *vp,
cred_t *cred) cred_t *cred)
{ {
return -ENOSECURITY; return -ENOSECURITY;
...@@ -2556,7 +2550,7 @@ attr_secure_capable( ...@@ -2556,7 +2550,7 @@ attr_secure_capable(
STATIC int STATIC int
attr_system_set( attr_system_set(
struct vnode *vp, char *name, void *data, size_t size, int xflags) bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
{ {
attrnames_t *namesp; attrnames_t *namesp;
int error; int error;
...@@ -2575,7 +2569,7 @@ attr_system_set( ...@@ -2575,7 +2569,7 @@ attr_system_set(
STATIC int STATIC int
attr_system_get( attr_system_get(
struct vnode *vp, char *name, void *data, size_t size, int xflags) bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
{ {
attrnames_t *namesp; attrnames_t *namesp;
...@@ -2587,7 +2581,7 @@ attr_system_get( ...@@ -2587,7 +2581,7 @@ attr_system_get(
STATIC int STATIC int
attr_system_remove( attr_system_remove(
struct vnode *vp, char *name, int xflags) bhv_vnode_t *vp, char *name, int xflags)
{ {
attrnames_t *namesp; attrnames_t *namesp;
......
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
*========================================================================*/ *========================================================================*/
struct cred; struct cred;
struct vnode; struct bhv_vnode;
typedef int (*attrset_t)(struct vnode *, char *, void *, size_t, int); typedef int (*attrset_t)(struct bhv_vnode *, char *, void *, size_t, int);
typedef int (*attrget_t)(struct vnode *, char *, void *, size_t, int); typedef int (*attrget_t)(struct bhv_vnode *, char *, void *, size_t, int);
typedef int (*attrremove_t)(struct vnode *, char *, int); typedef int (*attrremove_t)(struct bhv_vnode *, char *, int);
typedef int (*attrexists_t)(struct vnode *); typedef int (*attrexists_t)(struct bhv_vnode *);
typedef int (*attrcapable_t)(struct vnode *, struct cred *); typedef int (*attrcapable_t)(struct bhv_vnode *, struct cred *);
typedef struct attrnames { typedef struct attrnames {
char * attr_name; char * attr_name;
...@@ -63,7 +63,7 @@ extern struct attrnames attr_trusted; ...@@ -63,7 +63,7 @@ extern struct attrnames attr_trusted;
extern struct attrnames *attr_namespaces[ATTR_NAMECOUNT]; extern struct attrnames *attr_namespaces[ATTR_NAMECOUNT];
extern attrnames_t *attr_lookup_namespace(char *, attrnames_t **, int); extern attrnames_t *attr_lookup_namespace(char *, attrnames_t **, int);
extern int attr_generic_list(struct vnode *, void *, size_t, int, ssize_t *); extern int attr_generic_list(struct bhv_vnode *, void *, size_t, int, ssize_t *);
#define ATTR_DONTFOLLOW 0x0001 /* -- unused, from IRIX -- */ #define ATTR_DONTFOLLOW 0x0001 /* -- unused, from IRIX -- */
#define ATTR_ROOT 0x0002 /* use attrs in root (trusted) namespace */ #define ATTR_ROOT 0x0002 /* use attrs in root (trusted) namespace */
......
...@@ -5759,7 +5759,7 @@ xfs_getbmap( ...@@ -5759,7 +5759,7 @@ xfs_getbmap(
__int64_t fixlen; /* length for -1 case */ __int64_t fixlen; /* length for -1 case */
int i; /* extent number */ int i; /* extent number */
xfs_inode_t *ip; /* xfs incore inode pointer */ xfs_inode_t *ip; /* xfs incore inode pointer */
vnode_t *vp; /* corresponding vnode */ bhv_vnode_t *vp; /* corresponding vnode */
int lock; /* lock state */ int lock; /* lock state */
xfs_bmbt_irec_t *map; /* buffer for user's data */ xfs_bmbt_irec_t *map; /* buffer for user's data */
xfs_mount_t *mp; /* file system mount point */ xfs_mount_t *mp; /* file system mount point */
...@@ -5856,7 +5856,7 @@ xfs_getbmap( ...@@ -5856,7 +5856,7 @@ xfs_getbmap(
if (whichfork == XFS_DATA_FORK && ip->i_delayed_blks) { if (whichfork == XFS_DATA_FORK && ip->i_delayed_blks) {
/* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */ /* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */
VOP_FLUSH_PAGES(vp, (xfs_off_t)0, -1, 0, FI_REMAPF, error); error = bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF);
} }
ASSERT(whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0); ASSERT(whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0);
......
...@@ -49,12 +49,12 @@ typedef struct xfs_cap_set { ...@@ -49,12 +49,12 @@ typedef struct xfs_cap_set {
#include <linux/posix_cap_xattr.h> #include <linux/posix_cap_xattr.h>
struct vnode; struct bhv_vnode;
extern int xfs_cap_vhascap(struct vnode *); extern int xfs_cap_vhascap(struct bhv_vnode *);
extern int xfs_cap_vset(struct vnode *, void *, size_t); extern int xfs_cap_vset(struct bhv_vnode *, void *, size_t);
extern int xfs_cap_vget(struct vnode *, void *, size_t); extern int xfs_cap_vget(struct bhv_vnode *, void *, size_t);
extern int xfs_cap_vremove(struct vnode *vp); extern int xfs_cap_vremove(struct bhv_vnode *);
#define _CAP_EXISTS xfs_cap_vhascap #define _CAP_EXISTS xfs_cap_vhascap
......
...@@ -57,7 +57,7 @@ xfs_swapext( ...@@ -57,7 +57,7 @@ xfs_swapext(
xfs_inode_t *ip=NULL, *tip=NULL; xfs_inode_t *ip=NULL, *tip=NULL;
xfs_mount_t *mp; xfs_mount_t *mp;
struct file *fp = NULL, *tfp = NULL; struct file *fp = NULL, *tfp = NULL;
vnode_t *vp, *tvp; bhv_vnode_t *vp, *tvp;
int error = 0; int error = 0;
sxp = kmem_alloc(sizeof(xfs_swapext_t), KM_MAYFAIL); sxp = kmem_alloc(sizeof(xfs_swapext_t), KM_MAYFAIL);
...@@ -137,7 +137,7 @@ xfs_swap_extents( ...@@ -137,7 +137,7 @@ xfs_swap_extents(
xfs_inode_t *ips[2]; xfs_inode_t *ips[2];
xfs_trans_t *tp; xfs_trans_t *tp;
xfs_bstat_t *sbp = &sxp->sx_stat; xfs_bstat_t *sbp = &sxp->sx_stat;
vnode_t *vp, *tvp; bhv_vnode_t *vp, *tvp;
xfs_ifork_t *tempifp, *ifp, *tifp; xfs_ifork_t *tempifp, *ifp, *tifp;
int ilf_fields, tilf_fields; int ilf_fields, tilf_fields;
static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL; static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL;
...@@ -202,7 +202,7 @@ xfs_swap_extents( ...@@ -202,7 +202,7 @@ xfs_swap_extents(
if (VN_CACHED(tvp) != 0) { if (VN_CACHED(tvp) != 0) {
xfs_inval_cached_trace(&tip->i_iocore, 0, -1, 0, -1); xfs_inval_cached_trace(&tip->i_iocore, 0, -1, 0, -1);
VOP_FLUSHINVAL_PAGES(tvp, 0, -1, FI_REMAPF_LOCKED); bhv_vop_flushinval_pages(tvp, 0, -1, FI_REMAPF_LOCKED);
} }
/* Verify O_DIRECT for ftmp */ /* Verify O_DIRECT for ftmp */
...@@ -247,7 +247,7 @@ xfs_swap_extents( ...@@ -247,7 +247,7 @@ xfs_swap_extents(
/* We need to fail if the file is memory mapped. Once we have tossed /* We need to fail if the file is memory mapped. Once we have tossed
* all existing pages, the page fault will have no option * all existing pages, the page fault will have no option
* but to go to the filesystem for pages. By making the page fault call * but to go to the filesystem for pages. By making the page fault call
* VOP_READ (or write in the case of autogrow) they block on the iolock * vop_read (or write in the case of autogrow) they block on the iolock
* until we have switched the extents. * until we have switched the extents.
*/ */
if (VN_MAPPED(vp)) { if (VN_MAPPED(vp)) {
...@@ -266,7 +266,7 @@ xfs_swap_extents( ...@@ -266,7 +266,7 @@ xfs_swap_extents(
* fields change. * fields change.
*/ */
VOP_TOSS_PAGES(vp, 0, -1, FI_REMAPF); bhv_vop_toss_pages(vp, 0, -1, FI_REMAPF);
tp = xfs_trans_alloc(mp, XFS_TRANS_SWAPEXT); tp = xfs_trans_alloc(mp, XFS_TRANS_SWAPEXT);
if ((error = xfs_trans_reserve(tp, 0, if ((error = xfs_trans_reserve(tp, 0,
......
...@@ -186,7 +186,7 @@ xfs_ihash_promote( ...@@ -186,7 +186,7 @@ xfs_ihash_promote(
*/ */
STATIC int STATIC int
xfs_iget_core( xfs_iget_core(
vnode_t *vp, bhv_vnode_t *vp,
xfs_mount_t *mp, xfs_mount_t *mp,
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_ino_t ino, xfs_ino_t ino,
...@@ -198,7 +198,7 @@ xfs_iget_core( ...@@ -198,7 +198,7 @@ xfs_iget_core(
xfs_ihash_t *ih; xfs_ihash_t *ih;
xfs_inode_t *ip; xfs_inode_t *ip;
xfs_inode_t *iq; xfs_inode_t *iq;
vnode_t *inode_vp; bhv_vnode_t *inode_vp;
ulong version; ulong version;
int error; int error;
/* REFERENCED */ /* REFERENCED */
...@@ -489,7 +489,7 @@ xfs_iget( ...@@ -489,7 +489,7 @@ xfs_iget(
xfs_daddr_t bno) xfs_daddr_t bno)
{ {
struct inode *inode; struct inode *inode;
vnode_t *vp = NULL; bhv_vnode_t *vp = NULL;
int error; int error;
XFS_STATS_INC(xs_ig_attempts); XFS_STATS_INC(xs_ig_attempts);
...@@ -543,7 +543,7 @@ xfs_iget( ...@@ -543,7 +543,7 @@ xfs_iget(
void void
xfs_inode_lock_init( xfs_inode_lock_init(
xfs_inode_t *ip, xfs_inode_t *ip,
vnode_t *vp) bhv_vnode_t *vp)
{ {
mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER, mrlock_init(&ip->i_lock, MRLOCK_ALLOW_EQUAL_PRI|MRLOCK_BARRIER,
"xfsino", (long)vp->v_number); "xfsino", (long)vp->v_number);
...@@ -603,12 +603,10 @@ void ...@@ -603,12 +603,10 @@ void
xfs_iput(xfs_inode_t *ip, xfs_iput(xfs_inode_t *ip,
uint lock_flags) uint lock_flags)
{ {
vnode_t *vp = XFS_ITOV(ip); bhv_vnode_t *vp = XFS_ITOV(ip);
vn_trace_entry(vp, "xfs_iput", (inst_t *)__return_address); vn_trace_entry(vp, "xfs_iput", (inst_t *)__return_address);
xfs_iunlock(ip, lock_flags); xfs_iunlock(ip, lock_flags);
VN_RELE(vp); VN_RELE(vp);
} }
...@@ -619,7 +617,7 @@ void ...@@ -619,7 +617,7 @@ void
xfs_iput_new(xfs_inode_t *ip, xfs_iput_new(xfs_inode_t *ip,
uint lock_flags) uint lock_flags)
{ {
vnode_t *vp = XFS_ITOV(ip); bhv_vnode_t *vp = XFS_ITOV(ip);
struct inode *inode = vn_to_inode(vp); struct inode *inode = vn_to_inode(vp);
vn_trace_entry(vp, "xfs_iput_new", (inst_t *)__return_address); vn_trace_entry(vp, "xfs_iput_new", (inst_t *)__return_address);
...@@ -645,7 +643,7 @@ xfs_iput_new(xfs_inode_t *ip, ...@@ -645,7 +643,7 @@ xfs_iput_new(xfs_inode_t *ip,
void void
xfs_ireclaim(xfs_inode_t *ip) xfs_ireclaim(xfs_inode_t *ip)
{ {
vnode_t *vp; bhv_vnode_t *vp;
/* /*
* Remove from old hash list and mount list. * Remove from old hash list and mount list.
......
...@@ -1086,7 +1086,7 @@ xfs_ialloc( ...@@ -1086,7 +1086,7 @@ xfs_ialloc(
{ {
xfs_ino_t ino; xfs_ino_t ino;
xfs_inode_t *ip; xfs_inode_t *ip;
vnode_t *vp; bhv_vnode_t *vp;
uint flags; uint flags;
int error; int error;
...@@ -1427,7 +1427,7 @@ xfs_itruncate_start( ...@@ -1427,7 +1427,7 @@ xfs_itruncate_start(
xfs_fsize_t last_byte; xfs_fsize_t last_byte;
xfs_off_t toss_start; xfs_off_t toss_start;
xfs_mount_t *mp; xfs_mount_t *mp;
vnode_t *vp; bhv_vnode_t *vp;
ASSERT(ismrlocked(&ip->i_iolock, MR_UPDATE) != 0); ASSERT(ismrlocked(&ip->i_iolock, MR_UPDATE) != 0);
ASSERT((new_size == 0) || (new_size <= ip->i_d.di_size)); ASSERT((new_size == 0) || (new_size <= ip->i_d.di_size));
...@@ -1440,9 +1440,9 @@ xfs_itruncate_start( ...@@ -1440,9 +1440,9 @@ xfs_itruncate_start(
vn_iowait(vp); /* wait for the completion of any pending DIOs */ vn_iowait(vp); /* wait for the completion of any pending DIOs */
/* /*
* Call VOP_TOSS_PAGES() or VOP_FLUSHINVAL_PAGES() to get rid of pages and buffers * Call toss_pages or flushinval_pages to get rid of pages
* overlapping the region being removed. We have to use * overlapping the region being removed. We have to use
* the less efficient VOP_FLUSHINVAL_PAGES() in the case that the * the less efficient flushinval_pages in the case that the
* caller may not be able to finish the truncate without * caller may not be able to finish the truncate without
* dropping the inode's I/O lock. Make sure * dropping the inode's I/O lock. Make sure
* to catch any pages brought in by buffers overlapping * to catch any pages brought in by buffers overlapping
...@@ -1451,10 +1451,10 @@ xfs_itruncate_start( ...@@ -1451,10 +1451,10 @@ xfs_itruncate_start(
* so that we don't toss things on the same block as * so that we don't toss things on the same block as
* new_size but before it. * new_size but before it.
* *
* Before calling VOP_TOSS_PAGES() or VOP_FLUSHINVAL_PAGES(), make sure to * Before calling toss_page or flushinval_pages, make sure to
* call remapf() over the same region if the file is mapped. * call remapf() over the same region if the file is mapped.
* This frees up mapped file references to the pages in the * This frees up mapped file references to the pages in the
* given range and for the VOP_FLUSHINVAL_PAGES() case it ensures * given range and for the flushinval_pages case it ensures
* that we get the latest mapped changes flushed out. * that we get the latest mapped changes flushed out.
*/ */
toss_start = XFS_B_TO_FSB(mp, (xfs_ufsize_t)new_size); toss_start = XFS_B_TO_FSB(mp, (xfs_ufsize_t)new_size);
...@@ -1472,9 +1472,9 @@ xfs_itruncate_start( ...@@ -1472,9 +1472,9 @@ xfs_itruncate_start(
last_byte); last_byte);
if (last_byte > toss_start) { if (last_byte > toss_start) {
if (flags & XFS_ITRUNC_DEFINITE) { if (flags & XFS_ITRUNC_DEFINITE) {
VOP_TOSS_PAGES(vp, toss_start, -1, FI_REMAPF_LOCKED); bhv_vop_toss_pages(vp, toss_start, -1, FI_REMAPF_LOCKED);
} else { } else {
VOP_FLUSHINVAL_PAGES(vp, toss_start, -1, FI_REMAPF_LOCKED); bhv_vop_flushinval_pages(vp, toss_start, -1, FI_REMAPF_LOCKED);
} }
} }
...@@ -2752,7 +2752,7 @@ xfs_iunpin( ...@@ -2752,7 +2752,7 @@ xfs_iunpin(
* the inode to become unpinned. * the inode to become unpinned.
*/ */
if (!(ip->i_flags & (XFS_IRECLAIM|XFS_IRECLAIMABLE))) { if (!(ip->i_flags & (XFS_IRECLAIM|XFS_IRECLAIMABLE))) {
vnode_t *vp = XFS_ITOV_NULL(ip); bhv_vnode_t *vp = XFS_ITOV_NULL(ip);
/* make sync come back and flush this inode */ /* make sync come back and flush this inode */
if (vp) { if (vp) {
...@@ -3512,7 +3512,7 @@ xfs_iflush_all( ...@@ -3512,7 +3512,7 @@ xfs_iflush_all(
xfs_mount_t *mp) xfs_mount_t *mp)
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
vnode_t *vp; bhv_vnode_t *vp;
again: again:
XFS_MOUNT_ILOCK(mp); XFS_MOUNT_ILOCK(mp);
......
...@@ -102,9 +102,9 @@ typedef struct xfs_ifork { ...@@ -102,9 +102,9 @@ typedef struct xfs_ifork {
#ifdef __KERNEL__ #ifdef __KERNEL__
struct bhv_desc; struct bhv_desc;
struct bhv_vnode;
struct cred; struct cred;
struct ktrace; struct ktrace;
struct vnode;
struct xfs_buf; struct xfs_buf;
struct xfs_bmap_free; struct xfs_bmap_free;
struct xfs_bmbt_irec; struct xfs_bmbt_irec;
...@@ -400,7 +400,7 @@ void xfs_chash_init(struct xfs_mount *); ...@@ -400,7 +400,7 @@ void xfs_chash_init(struct xfs_mount *);
void xfs_chash_free(struct xfs_mount *); void xfs_chash_free(struct xfs_mount *);
xfs_inode_t *xfs_inode_incore(struct xfs_mount *, xfs_ino_t, xfs_inode_t *xfs_inode_incore(struct xfs_mount *, xfs_ino_t,
struct xfs_trans *); struct xfs_trans *);
void xfs_inode_lock_init(xfs_inode_t *, struct vnode *); void xfs_inode_lock_init(xfs_inode_t *, struct bhv_vnode *);
int xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, int xfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t,
uint, uint, xfs_inode_t **, xfs_daddr_t); uint, uint, xfs_inode_t **, xfs_daddr_t);
void xfs_iput(xfs_inode_t *, uint); void xfs_iput(xfs_inode_t *, uint);
...@@ -461,7 +461,7 @@ void xfs_ichgtime(xfs_inode_t *, int); ...@@ -461,7 +461,7 @@ void xfs_ichgtime(xfs_inode_t *, int);
xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); xfs_fsize_t xfs_file_last_byte(xfs_inode_t *);
void xfs_lock_inodes(xfs_inode_t **, int, int, uint); void xfs_lock_inodes(xfs_inode_t **, int, int, uint);
xfs_inode_t *xfs_vtoi(struct vnode *vp); xfs_inode_t *xfs_vtoi(struct bhv_vnode *vp);
void xfs_synchronize_atime(xfs_inode_t *); void xfs_synchronize_atime(xfs_inode_t *);
......
...@@ -51,7 +51,7 @@ xfs_bulkstat_one_iget( ...@@ -51,7 +51,7 @@ xfs_bulkstat_one_iget(
{ {
xfs_dinode_core_t *dic; /* dinode core info pointer */ xfs_dinode_core_t *dic; /* dinode core info pointer */
xfs_inode_t *ip; /* incore inode pointer */ xfs_inode_t *ip; /* incore inode pointer */
vnode_t *vp; bhv_vnode_t *vp;
int error; int error;
error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, bno); error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_SHARED, &ip, bno);
......
...@@ -658,7 +658,7 @@ xfs_mountfs( ...@@ -658,7 +658,7 @@ xfs_mountfs(
xfs_buf_t *bp; xfs_buf_t *bp;
xfs_sb_t *sbp = &(mp->m_sb); xfs_sb_t *sbp = &(mp->m_sb);
xfs_inode_t *rip; xfs_inode_t *rip;
vnode_t *rvp = NULL; bhv_vnode_t *rvp = NULL;
int readio_log, writeio_log; int readio_log, writeio_log;
xfs_daddr_t d; xfs_daddr_t d;
__uint64_t ret64; __uint64_t ret64;
......
...@@ -54,7 +54,7 @@ typedef struct xfs_trans_reservations { ...@@ -54,7 +54,7 @@ typedef struct xfs_trans_reservations {
struct cred; struct cred;
struct log; struct log;
struct bhv_vfs; struct bhv_vfs;
struct vnode; struct bhv_vnode;
struct xfs_mount_args; struct xfs_mount_args;
struct xfs_ihash; struct xfs_ihash;
struct xfs_chash; struct xfs_chash;
...@@ -67,7 +67,7 @@ struct xfs_extdelta; ...@@ -67,7 +67,7 @@ struct xfs_extdelta;
struct xfs_swapext; struct xfs_swapext;
extern struct bhv_vfsops xfs_vfsops; extern struct bhv_vfsops xfs_vfsops;
extern struct vnodeops xfs_vnodeops; extern struct bhv_vnodeops xfs_vnodeops;
#define AIL_LOCK_T lock_t #define AIL_LOCK_T lock_t
#define AIL_LOCKINIT(x,y) spinlock_init(x,y) #define AIL_LOCKINIT(x,y) spinlock_init(x,y)
...@@ -80,15 +80,15 @@ extern struct vnodeops xfs_vnodeops; ...@@ -80,15 +80,15 @@ extern struct vnodeops xfs_vnodeops;
* Prototypes and functions for the Data Migration subsystem. * Prototypes and functions for the Data Migration subsystem.
*/ */
typedef int (*xfs_send_data_t)(int, struct vnode *, typedef int (*xfs_send_data_t)(int, struct bhv_vnode *,
xfs_off_t, size_t, int, vrwlock_t *); xfs_off_t, size_t, int, vrwlock_t *);
typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint); typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint);
typedef int (*xfs_send_destroy_t)(struct vnode *, dm_right_t); typedef int (*xfs_send_destroy_t)(struct bhv_vnode *, dm_right_t);
typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct bhv_vfs *, typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct bhv_vfs *,
struct vnode *, struct bhv_vnode *,
dm_right_t, struct vnode *, dm_right_t, dm_right_t, struct bhv_vnode *, dm_right_t,
char *, char *, mode_t, int, int); char *, char *, mode_t, int, int);
typedef void (*xfs_send_unmount_t)(struct bhv_vfs *, struct vnode *, typedef void (*xfs_send_unmount_t)(struct bhv_vfs *, struct bhv_vnode *,
dm_right_t, mode_t, int, int); dm_right_t, mode_t, int, int);
typedef struct xfs_dmops { typedef struct xfs_dmops {
......
...@@ -226,7 +226,7 @@ int ...@@ -226,7 +226,7 @@ int
xfs_rename( xfs_rename(
bhv_desc_t *src_dir_bdp, bhv_desc_t *src_dir_bdp,
vname_t *src_vname, vname_t *src_vname,
vnode_t *target_dir_vp, bhv_vnode_t *target_dir_vp,
vname_t *target_vname, vname_t *target_vname,
cred_t *credp) cred_t *credp)
{ {
...@@ -242,7 +242,7 @@ xfs_rename( ...@@ -242,7 +242,7 @@ xfs_rename(
int committed; int committed;
xfs_inode_t *inodes[4]; xfs_inode_t *inodes[4];
int target_ip_dropped = 0; /* dropped target_ip link? */ int target_ip_dropped = 0; /* dropped target_ip link? */
vnode_t *src_dir_vp; bhv_vnode_t *src_dir_vp;
int spaceres; int spaceres;
int target_link_zero = 0; int target_link_zero = 0;
int num_inodes; int num_inodes;
...@@ -609,7 +609,7 @@ xfs_rename( ...@@ -609,7 +609,7 @@ xfs_rename(
* Let interposed file systems know about removed links. * Let interposed file systems know about removed links.
*/ */
if (target_ip_dropped) { if (target_ip_dropped) {
VOP_LINK_REMOVED(XFS_ITOV(target_ip), target_dir_vp, bhv_vop_link_removed(XFS_ITOV(target_ip), target_dir_vp,
target_link_zero); target_link_zero);
IRELE(target_ip); IRELE(target_ip);
} }
......
...@@ -54,7 +54,7 @@ xfs_get_dir_entry( ...@@ -54,7 +54,7 @@ xfs_get_dir_entry(
vname_t *dentry, vname_t *dentry,
xfs_inode_t **ipp) xfs_inode_t **ipp)
{ {
vnode_t *vp; bhv_vnode_t *vp;
vp = VNAME_TO_VNODE(dentry); vp = VNAME_TO_VNODE(dentry);
...@@ -73,7 +73,7 @@ xfs_dir_lookup_int( ...@@ -73,7 +73,7 @@ xfs_dir_lookup_int(
xfs_ino_t *inum, xfs_ino_t *inum,
xfs_inode_t **ipp) xfs_inode_t **ipp)
{ {
vnode_t *dir_vp; bhv_vnode_t *dir_vp;
xfs_inode_t *dp; xfs_inode_t *dp;
int error; int error;
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
#define ITRACE(ip) vn_trace_ref(XFS_ITOV(ip), __FILE__, __LINE__, \ #define ITRACE(ip) vn_trace_ref(XFS_ITOV(ip), __FILE__, __LINE__, \
(inst_t *)__return_address) (inst_t *)__return_address)
extern int xfs_rename (bhv_desc_t *, vname_t *, vnode_t *, vname_t *, cred_t *); extern int xfs_rename (bhv_desc_t *, vname_t *, bhv_vnode_t *,
vname_t *, cred_t *);
extern int xfs_get_dir_entry (vname_t *, xfs_inode_t **); extern int xfs_get_dir_entry (vname_t *, xfs_inode_t **);
extern int xfs_dir_lookup_int (bhv_desc_t *, uint, vname_t *, xfs_ino_t *, extern int xfs_dir_lookup_int (bhv_desc_t *, uint, vname_t *, xfs_ino_t *,
xfs_inode_t **); xfs_inode_t **);
......
...@@ -555,7 +555,7 @@ xfs_unmount( ...@@ -555,7 +555,7 @@ xfs_unmount(
bhv_vfs_t *vfsp = bhvtovfs(bdp); bhv_vfs_t *vfsp = bhvtovfs(bdp);
xfs_mount_t *mp = XFS_BHVTOM(bdp); xfs_mount_t *mp = XFS_BHVTOM(bdp);
xfs_inode_t *rip; xfs_inode_t *rip;
vnode_t *rvp; bhv_vnode_t *rvp;
int unmount_event_wanted = 0; int unmount_event_wanted = 0;
int unmount_event_flags = 0; int unmount_event_flags = 0;
int xfs_unmountfs_needed = 0; int xfs_unmountfs_needed = 0;
...@@ -701,7 +701,7 @@ xfs_unmount_flush( ...@@ -701,7 +701,7 @@ xfs_unmount_flush(
xfs_inode_t *rip = mp->m_rootip; xfs_inode_t *rip = mp->m_rootip;
xfs_inode_t *rbmip; xfs_inode_t *rbmip;
xfs_inode_t *rsumip = NULL; xfs_inode_t *rsumip = NULL;
vnode_t *rvp = XFS_ITOV(rip); bhv_vnode_t *rvp = XFS_ITOV(rip);
int error; int error;
xfs_ilock(rip, XFS_ILOCK_EXCL); xfs_ilock(rip, XFS_ILOCK_EXCL);
...@@ -780,9 +780,9 @@ xfs_unmount_flush( ...@@ -780,9 +780,9 @@ xfs_unmount_flush(
STATIC int STATIC int
xfs_root( xfs_root(
bhv_desc_t *bdp, bhv_desc_t *bdp,
vnode_t **vpp) bhv_vnode_t **vpp)
{ {
vnode_t *vp; bhv_vnode_t *vp;
vp = XFS_ITOV((XFS_BHVTOM(bdp))->m_rootip); vp = XFS_ITOV((XFS_BHVTOM(bdp))->m_rootip);
VN_HOLD(vp); VN_HOLD(vp);
...@@ -801,7 +801,7 @@ STATIC int ...@@ -801,7 +801,7 @@ STATIC int
xfs_statvfs( xfs_statvfs(
bhv_desc_t *bdp, bhv_desc_t *bdp,
xfs_statfs_t *statp, xfs_statfs_t *statp,
vnode_t *vp) bhv_vnode_t *vp)
{ {
__uint64_t fakeinos; __uint64_t fakeinos;
xfs_extlen_t lsize; xfs_extlen_t lsize;
...@@ -916,7 +916,7 @@ xfs_sync_inodes( ...@@ -916,7 +916,7 @@ xfs_sync_inodes(
xfs_inode_t *ip = NULL; xfs_inode_t *ip = NULL;
xfs_inode_t *ip_next; xfs_inode_t *ip_next;
xfs_buf_t *bp; xfs_buf_t *bp;
vnode_t *vp = NULL; bhv_vnode_t *vp = NULL;
int error; int error;
int last_error; int last_error;
uint64_t fflag; uint64_t fflag;
...@@ -1155,9 +1155,9 @@ xfs_sync_inodes( ...@@ -1155,9 +1155,9 @@ xfs_sync_inodes(
xfs_iunlock(ip, XFS_ILOCK_SHARED); xfs_iunlock(ip, XFS_ILOCK_SHARED);
if (XFS_FORCED_SHUTDOWN(mp)) { if (XFS_FORCED_SHUTDOWN(mp)) {
VOP_TOSS_PAGES(vp, 0, -1, FI_REMAPF); bhv_vop_toss_pages(vp, 0, -1, FI_REMAPF);
} else { } else {
VOP_FLUSHINVAL_PAGES(vp, 0, -1, FI_REMAPF); bhv_vop_flushinval_pages(vp, 0, -1, FI_REMAPF);
} }
xfs_ilock(ip, XFS_ILOCK_SHARED); xfs_ilock(ip, XFS_ILOCK_SHARED);
...@@ -1177,8 +1177,8 @@ xfs_sync_inodes( ...@@ -1177,8 +1177,8 @@ xfs_sync_inodes(
* across calls to the buffer cache. * across calls to the buffer cache.
*/ */
xfs_iunlock(ip, XFS_ILOCK_SHARED); xfs_iunlock(ip, XFS_ILOCK_SHARED);
VOP_FLUSH_PAGES(vp, (xfs_off_t)0, -1, error = bhv_vop_flush_pages(vp, (xfs_off_t)0,
fflag, FI_NONE, error); -1, fflag, FI_NONE);
xfs_ilock(ip, XFS_ILOCK_SHARED); xfs_ilock(ip, XFS_ILOCK_SHARED);
} }
...@@ -1230,9 +1230,7 @@ xfs_sync_inodes( ...@@ -1230,9 +1230,7 @@ xfs_sync_inodes(
* marker and free it. * marker and free it.
*/ */
XFS_MOUNT_ILOCK(mp); XFS_MOUNT_ILOCK(mp);
IPOINTER_REMOVE(ip, mp); IPOINTER_REMOVE(ip, mp);
XFS_MOUNT_IUNLOCK(mp); XFS_MOUNT_IUNLOCK(mp);
ASSERT(!(lock_flags & ASSERT(!(lock_flags &
...@@ -1573,7 +1571,7 @@ xfs_syncsub( ...@@ -1573,7 +1571,7 @@ xfs_syncsub(
STATIC int STATIC int
xfs_vget( xfs_vget(
bhv_desc_t *bdp, bhv_desc_t *bdp,
vnode_t **vpp, bhv_vnode_t **vpp,
fid_t *fidp) fid_t *fidp)
{ {
xfs_mount_t *mp = XFS_BHVTOM(bdp); xfs_mount_t *mp = XFS_BHVTOM(bdp);
......
...@@ -62,7 +62,7 @@ xfs_open( ...@@ -62,7 +62,7 @@ xfs_open(
cred_t *credp) cred_t *credp)
{ {
int mode; int mode;
vnode_t *vp = BHV_TO_VNODE(bdp); bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
xfs_inode_t *ip = XFS_BHVTOI(bdp); xfs_inode_t *ip = XFS_BHVTOI(bdp);
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) if (XFS_FORCED_SHUTDOWN(ip->i_mount))
...@@ -88,9 +88,8 @@ xfs_close( ...@@ -88,9 +88,8 @@ xfs_close(
lastclose_t lastclose, lastclose_t lastclose,
cred_t *credp) cred_t *credp)
{ {
vnode_t *vp = BHV_TO_VNODE(bdp); bhv_vnode_t *vp = BHV_TO_VNODE(bdp);
xfs_inode_t *ip = XFS_BHVTOI(bdp); xfs_inode_t *ip = XFS_BHVTOI(bdp);
int error = 0;
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) if (XFS_FORCED_SHUTDOWN(ip->i_mount))
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
...@@ -108,8 +107,8 @@ xfs_close( ...@@ -108,8 +107,8 @@ xfs_close(
* window where we'd otherwise be exposed to that problem. * window where we'd otherwise be exposed to that problem.
*/ */
if (VUNTRUNCATE(vp) && VN_DIRTY(vp) && ip->i_delayed_blks > 0) if (VUNTRUNCATE(vp) && VN_DIRTY(vp) && ip->i_delayed_blks > 0)
VOP_FLUSH_PAGES(vp, 0, -1, XFS_B_ASYNC, FI_NONE, error); return bhv_vop_flush_pages(vp, 0, -1, XFS_B_ASYNC, FI_NONE);
return error; return 0;
} }
/* /*
...@@ -124,7 +123,7 @@ xfs_getattr( ...@@ -124,7 +123,7 @@ xfs_getattr(
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
xfs_mount_t *mp; xfs_mount_t *mp;
vnode_t *vp; bhv_vnode_t *vp;
vp = BHV_TO_VNODE(bdp); vp = BHV_TO_VNODE(bdp);
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
...@@ -265,7 +264,7 @@ xfs_setattr( ...@@ -265,7 +264,7 @@ xfs_setattr(
uid_t uid=0, iuid=0; uid_t uid=0, iuid=0;
gid_t gid=0, igid=0; gid_t gid=0, igid=0;
int timeflags = 0; int timeflags = 0;
vnode_t *vp; bhv_vnode_t *vp;
xfs_prid_t projid=0, iprojid=0; xfs_prid_t projid=0, iprojid=0;
int mandlock_before, mandlock_after; int mandlock_before, mandlock_after;
struct xfs_dquot *udqp, *gdqp, *olddquot1, *olddquot2; struct xfs_dquot *udqp, *gdqp, *olddquot1, *olddquot2;
...@@ -888,7 +887,7 @@ xfs_setattr( ...@@ -888,7 +887,7 @@ xfs_setattr(
*/ */
mandlock_after = MANDLOCK(vp, ip->i_d.di_mode); mandlock_after = MANDLOCK(vp, ip->i_d.di_mode);
if (mandlock_before != mandlock_after) { if (mandlock_before != mandlock_after) {
VOP_VNODE_CHANGE(vp, VCHANGE_FLAGS_ENF_LOCKING, bhv_vop_vnode_change(vp, VCHANGE_FLAGS_ENF_LOCKING,
mandlock_after); mandlock_after);
} }
...@@ -976,7 +975,7 @@ xfs_readlink( ...@@ -976,7 +975,7 @@ xfs_readlink(
int count; int count;
xfs_off_t offset; xfs_off_t offset;
int pathlen; int pathlen;
vnode_t *vp; bhv_vnode_t *vp;
int error = 0; int error = 0;
xfs_mount_t *mp; xfs_mount_t *mp;
int nmaps; int nmaps;
...@@ -1547,7 +1546,7 @@ xfs_release( ...@@ -1547,7 +1546,7 @@ xfs_release(
bhv_desc_t *bdp) bhv_desc_t *bdp)
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
vnode_t *vp; bhv_vnode_t *vp;
xfs_mount_t *mp; xfs_mount_t *mp;
int error; int error;
...@@ -1600,8 +1599,8 @@ xfs_inactive( ...@@ -1600,8 +1599,8 @@ xfs_inactive(
cred_t *credp) cred_t *credp)
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
vnode_t *vp; bhv_vnode_t *vp;
xfs_bmap_free_t free_list; xfs_bmap_free_t free_list;
xfs_fsblock_t first_block; xfs_fsblock_t first_block;
int committed; int committed;
xfs_trans_t *tp; xfs_trans_t *tp;
...@@ -1817,16 +1816,16 @@ STATIC int ...@@ -1817,16 +1816,16 @@ STATIC int
xfs_lookup( xfs_lookup(
bhv_desc_t *dir_bdp, bhv_desc_t *dir_bdp,
vname_t *dentry, vname_t *dentry,
vnode_t **vpp, bhv_vnode_t **vpp,
int flags, int flags,
vnode_t *rdir, bhv_vnode_t *rdir,
cred_t *credp) cred_t *credp)
{ {
xfs_inode_t *dp, *ip; xfs_inode_t *dp, *ip;
xfs_ino_t e_inum; xfs_ino_t e_inum;
int error; int error;
uint lock_mode; uint lock_mode;
vnode_t *dir_vp; bhv_vnode_t *dir_vp;
dir_vp = BHV_TO_VNODE(dir_bdp); dir_vp = BHV_TO_VNODE(dir_bdp);
vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address); vn_trace_entry(dir_vp, __FUNCTION__, (inst_t *)__return_address);
...@@ -1855,13 +1854,13 @@ xfs_create( ...@@ -1855,13 +1854,13 @@ xfs_create(
bhv_desc_t *dir_bdp, bhv_desc_t *dir_bdp,
vname_t *dentry, vname_t *dentry,
vattr_t *vap, vattr_t *vap,
vnode_t **vpp, bhv_vnode_t **vpp,
cred_t *credp) cred_t *credp)
{ {
char *name = VNAME(dentry); char *name = VNAME(dentry);
vnode_t *dir_vp; bhv_vnode_t *dir_vp;
xfs_inode_t *dp, *ip; xfs_inode_t *dp, *ip;
vnode_t *vp=NULL; bhv_vnode_t *vp = NULL;
xfs_trans_t *tp; xfs_trans_t *tp;
xfs_mount_t *mp; xfs_mount_t *mp;
xfs_dev_t rdev; xfs_dev_t rdev;
...@@ -2047,7 +2046,7 @@ xfs_create( ...@@ -2047,7 +2046,7 @@ xfs_create(
* Propagate the fact that the vnode changed after the * Propagate the fact that the vnode changed after the
* xfs_inode locks have been released. * xfs_inode locks have been released.
*/ */
VOP_VNODE_CHANGE(vp, VCHANGE_FLAGS_TRUNCATED, 3); bhv_vop_vnode_change(vp, VCHANGE_FLAGS_TRUNCATED, 3);
*vpp = vp; *vpp = vp;
...@@ -2345,7 +2344,7 @@ xfs_remove( ...@@ -2345,7 +2344,7 @@ xfs_remove(
vname_t *dentry, vname_t *dentry,
cred_t *credp) cred_t *credp)
{ {
vnode_t *dir_vp; bhv_vnode_t *dir_vp;
char *name = VNAME(dentry); char *name = VNAME(dentry);
xfs_inode_t *dp, *ip; xfs_inode_t *dp, *ip;
xfs_trans_t *tp = NULL; xfs_trans_t *tp = NULL;
...@@ -2532,7 +2531,7 @@ xfs_remove( ...@@ -2532,7 +2531,7 @@ xfs_remove(
/* /*
* Let interposed file systems know about removed links. * Let interposed file systems know about removed links.
*/ */
VOP_LINK_REMOVED(XFS_ITOV(ip), dir_vp, link_zero); bhv_vop_link_removed(XFS_ITOV(ip), dir_vp, link_zero);
IRELE(ip); IRELE(ip);
...@@ -2585,7 +2584,7 @@ xfs_remove( ...@@ -2585,7 +2584,7 @@ xfs_remove(
STATIC int STATIC int
xfs_link( xfs_link(
bhv_desc_t *target_dir_bdp, bhv_desc_t *target_dir_bdp,
vnode_t *src_vp, bhv_vnode_t *src_vp,
vname_t *dentry, vname_t *dentry,
cred_t *credp) cred_t *credp)
{ {
...@@ -2598,7 +2597,7 @@ xfs_link( ...@@ -2598,7 +2597,7 @@ xfs_link(
xfs_fsblock_t first_block; xfs_fsblock_t first_block;
int cancel_flags; int cancel_flags;
int committed; int committed;
vnode_t *target_dir_vp; bhv_vnode_t *target_dir_vp;
int resblks; int resblks;
char *target_name = VNAME(dentry); char *target_name = VNAME(dentry);
int target_namelen; int target_namelen;
...@@ -2757,13 +2756,13 @@ xfs_mkdir( ...@@ -2757,13 +2756,13 @@ xfs_mkdir(
bhv_desc_t *dir_bdp, bhv_desc_t *dir_bdp,
vname_t *dentry, vname_t *dentry,
vattr_t *vap, vattr_t *vap,
vnode_t **vpp, bhv_vnode_t **vpp,
cred_t *credp) cred_t *credp)
{ {
char *dir_name = VNAME(dentry); char *dir_name = VNAME(dentry);
xfs_inode_t *dp; xfs_inode_t *dp;
xfs_inode_t *cdp; /* inode of created dir */ xfs_inode_t *cdp; /* inode of created dir */
vnode_t *cvp; /* vnode of created dir */ bhv_vnode_t *cvp; /* vnode of created dir */
xfs_trans_t *tp; xfs_trans_t *tp;
xfs_mount_t *mp; xfs_mount_t *mp;
int cancel_flags; int cancel_flags;
...@@ -2771,7 +2770,7 @@ xfs_mkdir( ...@@ -2771,7 +2770,7 @@ xfs_mkdir(
int committed; int committed;
xfs_bmap_free_t free_list; xfs_bmap_free_t free_list;
xfs_fsblock_t first_block; xfs_fsblock_t first_block;
vnode_t *dir_vp; bhv_vnode_t *dir_vp;
boolean_t dp_joined_to_trans; boolean_t dp_joined_to_trans;
boolean_t created = B_FALSE; boolean_t created = B_FALSE;
int dm_event_sent = 0; int dm_event_sent = 0;
...@@ -3003,7 +3002,7 @@ xfs_rmdir( ...@@ -3003,7 +3002,7 @@ xfs_rmdir(
xfs_fsblock_t first_block; xfs_fsblock_t first_block;
int cancel_flags; int cancel_flags;
int committed; int committed;
vnode_t *dir_vp; bhv_vnode_t *dir_vp;
int dm_di_mode = 0; int dm_di_mode = 0;
int last_cdp_link; int last_cdp_link;
int namelen; int namelen;
...@@ -3202,7 +3201,7 @@ xfs_rmdir( ...@@ -3202,7 +3201,7 @@ xfs_rmdir(
/* /*
* Let interposed file systems know about removed links. * Let interposed file systems know about removed links.
*/ */
VOP_LINK_REMOVED(XFS_ITOV(cdp), dir_vp, last_cdp_link); bhv_vop_link_removed(XFS_ITOV(cdp), dir_vp, last_cdp_link);
IRELE(cdp); IRELE(cdp);
...@@ -3272,7 +3271,7 @@ xfs_symlink( ...@@ -3272,7 +3271,7 @@ xfs_symlink(
vname_t *dentry, vname_t *dentry,
vattr_t *vap, vattr_t *vap,
char *target_path, char *target_path,
vnode_t **vpp, bhv_vnode_t **vpp,
cred_t *credp) cred_t *credp)
{ {
xfs_trans_t *tp; xfs_trans_t *tp;
...@@ -3284,7 +3283,7 @@ xfs_symlink( ...@@ -3284,7 +3283,7 @@ xfs_symlink(
xfs_bmap_free_t free_list; xfs_bmap_free_t free_list;
xfs_fsblock_t first_block; xfs_fsblock_t first_block;
boolean_t dp_joined_to_trans; boolean_t dp_joined_to_trans;
vnode_t *dir_vp; bhv_vnode_t *dir_vp;
uint cancel_flags; uint cancel_flags;
int committed; int committed;
xfs_fileoff_t first_fsb; xfs_fileoff_t first_fsb;
...@@ -3562,7 +3561,7 @@ xfs_symlink( ...@@ -3562,7 +3561,7 @@ xfs_symlink(
} }
if (!error) { if (!error) {
vnode_t *vp; bhv_vnode_t *vp;
ASSERT(ip); ASSERT(ip);
vp = XFS_ITOV(ip); vp = XFS_ITOV(ip);
...@@ -3630,7 +3629,7 @@ xfs_rwlock( ...@@ -3630,7 +3629,7 @@ xfs_rwlock(
vrwlock_t locktype) vrwlock_t locktype)
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
vnode_t *vp; bhv_vnode_t *vp;
vp = BHV_TO_VNODE(bdp); vp = BHV_TO_VNODE(bdp);
if (VN_ISDIR(vp)) if (VN_ISDIR(vp))
...@@ -3661,7 +3660,7 @@ xfs_rwunlock( ...@@ -3661,7 +3660,7 @@ xfs_rwunlock(
vrwlock_t locktype) vrwlock_t locktype)
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
vnode_t *vp; bhv_vnode_t *vp;
vp = BHV_TO_VNODE(bdp); vp = BHV_TO_VNODE(bdp);
if (VN_ISDIR(vp)) if (VN_ISDIR(vp))
...@@ -3810,7 +3809,7 @@ xfs_reclaim( ...@@ -3810,7 +3809,7 @@ xfs_reclaim(
bhv_desc_t *bdp) bhv_desc_t *bdp)
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
vnode_t *vp; bhv_vnode_t *vp;
vp = BHV_TO_VNODE(bdp); vp = BHV_TO_VNODE(bdp);
ip = XFS_BHVTOI(bdp); ip = XFS_BHVTOI(bdp);
...@@ -3865,7 +3864,7 @@ xfs_finish_reclaim( ...@@ -3865,7 +3864,7 @@ xfs_finish_reclaim(
int sync_mode) int sync_mode)
{ {
xfs_ihash_t *ih = ip->i_hash; xfs_ihash_t *ih = ip->i_hash;
vnode_t *vp = XFS_ITOV_NULL(ip); bhv_vnode_t *vp = XFS_ITOV_NULL(ip);
int error; int error;
if (vp && VN_BAD(vp)) if (vp && VN_BAD(vp))
...@@ -4275,7 +4274,7 @@ xfs_free_file_space( ...@@ -4275,7 +4274,7 @@ xfs_free_file_space(
xfs_off_t len, xfs_off_t len,
int attr_flags) int attr_flags)
{ {
vnode_t *vp; bhv_vnode_t *vp;
int committed; int committed;
int done; int done;
xfs_off_t end_dmi_offset; xfs_off_t end_dmi_offset;
...@@ -4341,7 +4340,7 @@ xfs_free_file_space( ...@@ -4341,7 +4340,7 @@ xfs_free_file_space(
if (VN_CACHED(vp) != 0) { if (VN_CACHED(vp) != 0) {
xfs_inval_cached_trace(&ip->i_iocore, ioffset, -1, xfs_inval_cached_trace(&ip->i_iocore, ioffset, -1,
ctooff(offtoct(ioffset)), -1); ctooff(offtoct(ioffset)), -1);
VOP_FLUSHINVAL_PAGES(vp, ctooff(offtoct(ioffset)), bhv_vop_flushinval_pages(vp, ctooff(offtoct(ioffset)),
-1, FI_REMAPF_LOCKED); -1, FI_REMAPF_LOCKED);
} }
...@@ -4504,7 +4503,7 @@ xfs_change_file_space( ...@@ -4504,7 +4503,7 @@ xfs_change_file_space(
xfs_off_t llen; xfs_off_t llen;
xfs_trans_t *tp; xfs_trans_t *tp;
vattr_t va; vattr_t va;
vnode_t *vp; bhv_vnode_t *vp;
vp = BHV_TO_VNODE(bdp); vp = BHV_TO_VNODE(bdp);
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
...@@ -4657,7 +4656,7 @@ xfs_change_file_space( ...@@ -4657,7 +4656,7 @@ xfs_change_file_space(
return error; return error;
} }
vnodeops_t xfs_vnodeops = { bhv_vnodeops_t xfs_vnodeops = {
BHV_IDENTITY_INIT(VN_BHV_XFS,VNODE_POSITION_XFS), BHV_IDENTITY_INIT(VN_BHV_XFS,VNODE_POSITION_XFS),
.vop_open = xfs_open, .vop_open = xfs_open,
.vop_close = xfs_close, .vop_close = xfs_close,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment