Skip to contentSkip to conversation

call common xfs vnode-level helpers directly and remove vnode operations

PATCH In review Christoph Hellwig 1 participant 1 message Aug 23, 2007 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 2/17 call common xfs vnode-level helpers directly and remove vnode operations

fs/xfs/linux-2.6/xfs_file.c +25 -32
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c
===================================================================
@@ -37,6 +37,7 @@
 #include "xfs_error.h"
 #include "xfs_rw.h"
 #include "xfs_ioctl32.h"
+#include "xfs_vnodeops.h"
 
 #include <linux/dcache.h>
 #include <linux/smp_lock.h>
@@ -55,13 +56,12 @@ __xfs_file_read(
 	loff_t			pos)
 {
 	struct file		*file = iocb->ki_filp;
-	bhv_vnode_t		*vp = vn_from_inode(file->f_path.dentry->d_inode);
 
 	BUG_ON(iocb->ki_pos != pos);
 	if (unlikely(file->f_flags & O_DIRECT))
 		ioflags |= IO_ISDIRECT;
-	return bhv_vop_read(vp, iocb, iov, nr_segs, &iocb->ki_pos,
-				ioflags, NULL);
+	return xfs_read(XFS_I(file->f_path.dentry->d_inode), iocb, iov,
+				nr_segs, &iocb->ki_pos, ioflags);
 }
 
 STATIC ssize_t
@@ -93,14 +93,12 @@ __xfs_file_write(
 	loff_t			pos)
 {
 	struct file	*file = iocb->ki_filp;
-	struct inode	*inode = file->f_mapping->host;
-	bhv_vnode_t	*vp = vn_from_inode(inode);
 
 	BUG_ON(iocb->ki_pos != pos);
 	if (unlikely(file->f_flags & O_DIRECT))
 		ioflags |= IO_ISDIRECT;
-	return bhv_vop_write(vp, iocb, iov, nr_segs, &iocb->ki_pos,
-				ioflags, NULL);
+	return xfs_write(XFS_I(file->f_mapping->host), iocb, iov, nr_segs,
+				&iocb->ki_pos, ioflags);
 }
 
 STATIC ssize_t
@@ -131,8 +129,8 @@ xfs_file_sendfile(
 	read_actor_t		actor,
 	void			*target)
 {
-	return bhv_vop_sendfile(vn_from_inode(filp->f_path.dentry->d_inode),
-				filp, pos, 0, count, actor, target, NULL);
+	return xfs_sendfile(XFS_I(filp->f_path.dentry->d_inode),
+				filp, pos, 0, count, actor, target);
 }
 
 STATIC ssize_t
@@ -143,8 +141,8 @@ xfs_file_sendfile_invis(
 	read_actor_t		actor,
 	void			*target)
 {
-	return bhv_vop_sendfile(vn_from_inode(filp->f_path.dentry->d_inode),
-				filp, pos, IO_INVIS, count, actor, target, NULL);
+	return xfs_sendfile(XFS_I(filp->f_path.dentry->d_inode),
+				filp, pos, IO_INVIS, count, actor, target);
 }
 
 STATIC ssize_t
@@ -155,8 +153,8 @@ xfs_file_splice_read(
 	size_t			len,
 	unsigned int		flags)
 {
-	return bhv_vop_splice_read(vn_from_inode(infilp->f_path.dentry->d_inode),
-				   infilp, ppos, pipe, len, flags, 0, NULL);
+	return xfs_splice_read(XFS_I(infilp->f_path.dentry->d_inode),
+				   infilp, ppos, pipe, len, flags, 0);
 }
 
 STATIC ssize_t
@@ -167,9 +165,8 @@ xfs_file_splice_read_invis(
 	size_t			len,
 	unsigned int		flags)
 {
-	return bhv_vop_splice_read(vn_from_inode(infilp->f_path.dentry->d_inode),
-				   infilp, ppos, pipe, len, flags, IO_INVIS,
-				   NULL);
+	return xfs_splice_read(XFS_I(infilp->f_path.dentry->d_inode),
+				   infilp, ppos, pipe, len, flags, IO_INVIS);
 }
 
 STATIC ssize_t
@@ -180,8 +177,8 @@ xfs_file_splice_write(
 	size_t			len,
 	unsigned int		flags)
 {
-	return bhv_vop_splice_write(vn_from_inode(outfilp->f_path.dentry->d_inode),
-				    pipe, outfilp, ppos, len, flags, 0, NULL);
+	return xfs_splice_write(XFS_I(outfilp->f_path.dentry->d_inode),
+				    pipe, outfilp, ppos, len, flags, 0);
 }
 
 STATIC ssize_t
@@ -192,9 +189,8 @@ xfs_file_splice_write_invis(
 	size_t			len,
 	unsigned int		flags)
 {
-	return bhv_vop_splice_write(vn_from_inode(outfilp->f_path.dentry->d_inode),
-				    pipe, outfilp, ppos, len, flags, IO_INVIS,
-				    NULL);
+	return xfs_splice_write(XFS_I(outfilp->f_path.dentry->d_inode),
+				    pipe, outfilp, ppos, len, flags, IO_INVIS);
 }
 
 STATIC int
@@ -204,7 +200,7 @@ xfs_file_open(
 {
 	if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
 		return -EFBIG;
-	return -bhv_vop_open(vn_from_inode(inode), NULL);
+	return -xfs_open(XFS_I(inode));
 }
 
 STATIC int
@@ -212,11 +208,7 @@ xfs_file_release(
 	struct inode	*inode,
 	struct file	*filp)
 {
-	bhv_vnode_t	*vp = vn_from_inode(inode);
-
-	if (vp)
-		return -bhv_vop_release(vp);
-	return 0;
+	return -xfs_release(XFS_I(inode));
 }
 
 STATIC int
@@ -232,7 +224,8 @@ xfs_file_fsync(
 		flags |= FSYNC_DATA;
 	if (VN_TRUNC(vp))
 		VUNTRUNCATE(vp);
-	return -bhv_vop_fsync(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1);
+	return -xfs_fsync(XFS_I(dentry->d_inode), flags,
+			(xfs_off_t)0, (xfs_off_t)-1);
 }
 
 #ifdef HAVE_DMAPI
@@ -259,7 +252,7 @@ xfs_file_readdir(
 	filldir_t	filldir)
 {
 	struct inode	*inode = filp->f_path.dentry->d_inode;
-	bhv_vnode_t	*vp = vn_from_inode(inode);
+	xfs_inode_t	*ip = XFS_I(inode);
 	int		error;
 	size_t		bufsize;
 
@@ -277,7 +270,7 @@ xfs_file_readdir(
 	 */
 	bufsize = (size_t)min_t(loff_t, PAGE_SIZE, inode->i_size);
 
-	error = bhv_vop_readdir(vp, dirent, bufsize,
+	error = xfs_readdir(ip, dirent, bufsize,
 				(xfs_off_t *)&filp->f_pos, filldir);
 	if (error)
 		return -error;
@@ -310,7 +303,7 @@ xfs_file_ioctl(
 	struct inode	*inode = filp->f_path.dentry->d_inode;
 	bhv_vnode_t	*vp = vn_from_inode(inode);
 
-	error = bhv_vop_ioctl(vp, inode, filp, 0, cmd, (void __user *)p);
+	error = xfs_ioctl(XFS_I(inode), filp, 0, cmd, (void __user *)p);
 	VMODIFY(vp);
 
 	/* NOTE:  some of the ioctl's return positive #'s as a
@@ -332,7 +325,7 @@ xfs_file_ioctl_invis(
 	struct inode	*inode = filp->f_path.dentry->d_inode;
 	bhv_vnode_t	*vp = vn_from_inode(inode);
 
-	error = bhv_vop_ioctl(vp, inode, filp, IO_INVIS, cmd, (void __user *)p);
+	error = xfs_ioctl(XFS_I(inode), filp, IO_INVIS, cmd, (void __user *)p);
 	VMODIFY(vp);
 
 	/* NOTE:  some of the ioctl's return positive #'s as a
fs/xfs/linux-2.6/xfs_iops.c +26 -51

255 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_iops.h +6 -0
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h
===================================================================
@@ -31,4 +31,10 @@ struct xfs_inode;
 extern void xfs_ichgtime(struct xfs_inode *, int);
 extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int);
 
+#define xfs_vtoi(vp) \
+	((struct xfs_inode *)vn_to_inode(vp)->i_private)
+
+#define XFS_I(inode) \
+	((struct xfs_inode *)(inode)->i_private)
+
 #endif /* __XFS_IOPS_H__ */
fs/xfs/linux-2.6/xfs_ioctl.c +20 -20
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c
===================================================================
@@ -413,7 +413,7 @@ xfs_readlink_by_handle(
 	if (!link)
 		goto out_iput;
 
-	error = -bhv_vop_readlink(vp, link);
+	error = -xfs_readlink(XFS_I(inode), link);
 	if (error)
 		goto out_kfree;
 	error = do_readlink(hreq.ohandle, olen, link);
@@ -497,8 +497,8 @@ xfs_attrlist_by_handle(
 		goto out_vn_rele;
 
 	cursor = (attrlist_cursor_kern_t *)&al_hreq.pos;
-	error = bhv_vop_attr_list(vp, kbuf, al_hreq.buflen, al_hreq.flags,
-					cursor, NULL);
+	error = xfs_attr_list(XFS_I(inode), kbuf, al_hreq.buflen,
+					al_hreq.flags, cursor);
 	if (error)
 		goto out_kfree;
 
@@ -515,7 +515,7 @@ xfs_attrlist_by_handle(
 
 STATIC int
 xfs_attrmulti_attr_get(
-	bhv_vnode_t		*vp,
+	struct inode		*inode,
 	char			*name,
 	char			__user *ubuf,
 	__uint32_t		*len,
@@ -530,7 +530,7 @@ xfs_attrmulti_attr_get(
 	if (!kbuf)
 		return ENOMEM;
 
-	error = bhv_vop_attr_get(vp, name, kbuf, len, flags, NULL);
+	error = xfs_attr_get(XFS_I(inode), name, kbuf, len, flags, NULL);
 	if (error)
 		goto out_kfree;
 
@@ -544,7 +544,7 @@ xfs_attrmulti_attr_get(
 
 STATIC int
 xfs_attrmulti_attr_set(
-	bhv_vnode_t		*vp,
+	struct inode		*inode,
 	char			*name,
 	const char		__user *ubuf,
 	__uint32_t		len,
@@ -553,9 +553,9 @@ xfs_attrmulti_attr_set(
 	char			*kbuf;
 	int			error = EFAULT;
 
-	if (IS_RDONLY(&vp->v_inode))
+	if (IS_RDONLY(inode))
 		return -EROFS;
-	if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode))
+	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
 		return EPERM;
 	if (len > XATTR_SIZE_MAX)
 		return EINVAL;
@@ -567,7 +567,7 @@ xfs_attrmulti_attr_set(
 	if (copy_from_user(kbuf, ubuf, len))
 		goto out_kfree;
 			
-	error = bhv_vop_attr_set(vp, name, kbuf, len, flags, NULL);
+	error = xfs_attr_set(XFS_I(inode), name, kbuf, len, flags);
 
  out_kfree:
 	kfree(kbuf);
@@ -576,15 +576,15 @@ xfs_attrmulti_attr_set(
 
 STATIC int
 xfs_attrmulti_attr_remove(
-	bhv_vnode_t		*vp,
+	struct inode		*inode,
 	char			*name,
 	__uint32_t		flags)
 {
-	if (IS_RDONLY(&vp->v_inode))
+	if (IS_RDONLY(inode))
 		return -EROFS;
-	if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode))
+	if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
 		return EPERM;
-	return bhv_vop_attr_remove(vp, name, flags, NULL);
+	return xfs_attr_remove(XFS_I(inode), name, flags);
 }
 
 STATIC int
@@ -640,17 +640,17 @@ xfs_attrmulti_by_handle(
 
 		switch (ops[i].am_opcode) {
 		case ATTR_OP_GET:
-			ops[i].am_error = xfs_attrmulti_attr_get(vp,
+			ops[i].am_error = xfs_attrmulti_attr_get(inode,
 					attr_name, ops[i].am_attrvalue,
 					&ops[i].am_length, ops[i].am_flags);
 			break;
 		case ATTR_OP_SET:
-			ops[i].am_error = xfs_attrmulti_attr_set(vp,
+			ops[i].am_error = xfs_attrmulti_attr_set(inode,
 					attr_name, ops[i].am_attrvalue,
 					ops[i].am_length, ops[i].am_flags);
 			break;
 		case ATTR_OP_REMOVE:
-			ops[i].am_error = xfs_attrmulti_attr_remove(vp,
+			ops[i].am_error = xfs_attrmulti_attr_remove(inode,
 					attr_name, ops[i].am_flags);
 			break;
 		default:
@@ -1182,7 +1182,7 @@ xfs_ioc_xattr(
 	case XFS_IOC_FSGETXATTR: {
 		vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
 				 XFS_AT_NEXTENTS | XFS_AT_PROJID;
-		error = bhv_vop_getattr(vp, vattr, 0, NULL);
+		error = xfs_getattr(ip, vattr, 0);
 		if (unlikely(error)) {
 			error = -error;
 			break;
@@ -1215,7 +1215,7 @@ xfs_ioc_xattr(
 		vattr->va_extsize = fa.fsx_extsize;
 		vattr->va_projid  = fa.fsx_projid;
 
-		error = bhv_vop_setattr(vp, vattr, attr_flags, NULL);
+		error = xfs_setattr(ip, vattr, attr_flags, NULL);
 		if (likely(!error))
 			__vn_revalidate(vp, vattr);	/* update flags */
 		error = -error;
@@ -1225,7 +1225,7 @@ xfs_ioc_xattr(
 	case XFS_IOC_FSGETXATTRA: {
 		vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
 				 XFS_AT_ANEXTENTS | XFS_AT_PROJID;
-		error = bhv_vop_getattr(vp, vattr, 0, NULL);
+		error = xfs_getattr(ip, vattr, 0);
 		if (unlikely(error)) {
 			error = -error;
 			break;
@@ -1271,7 +1271,7 @@ xfs_ioc_xattr(
 		vattr->va_xflags = xfs_merge_ioc_xflags(flags,
 							xfs_ip2xflags(ip));
 
-		error = bhv_vop_setattr(vp, vattr, attr_flags, NULL);
+		error = xfs_setattr(ip, vattr, attr_flags, NULL);
 		if (likely(!error))
 			__vn_revalidate(vp, vattr);	/* update flags */
 		error = -error;
fs/xfs/linux-2.6/xfs_aops.c +14 -11
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c
===================================================================
@@ -37,6 +37,7 @@
 #include "xfs_error.h"
 #include "xfs_rw.h"
 #include "xfs_iomap.h"
+#include "xfs_vnodeops.h"
 #include <linux/mpage.h>
 #include <linux/pagevec.h>
 #include <linux/writeback.h>
@@ -231,7 +232,8 @@ xfs_end_bio_unwritten(
 	size_t			size = ioend->io_size;
 
 	if (likely(!ioend->io_error)) {
-		bhv_vop_bmap(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL);
+		xfs_bmap(xfs_vtoi(vp), offset, size,
+				BMAPI_UNWRITTEN, NULL, NULL);
 		xfs_setfilesize(ioend);
 	}
 	xfs_destroy_ioend(ioend);
@@ -304,7 +306,8 @@ xfs_map_blocks(
 	bhv_vnode_t		*vp = vn_from_inode(inode);
 	int			error, nmaps = 1;
 
-	error = bhv_vop_bmap(vp, offset, count, flags, mapp, &nmaps);
+	error = xfs_bmap(xfs_vtoi(vp), offset, count,
+				flags, mapp, &nmaps);
 	if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE)))
 		VMODIFY(vp);
 	return -error;
@@ -1322,7 +1325,6 @@ __xfs_get_blocks(
 	int			direct,
 	bmapi_flags_t		flags)
 {
-	bhv_vnode_t		*vp = vn_from_inode(inode);
 	xfs_iomap_t		iomap;
 	xfs_off_t		offset;
 	ssize_t			size;
@@ -1332,7 +1334,7 @@ __xfs_get_blocks(
 	offset = (xfs_off_t)iblock << inode->i_blkbits;
 	ASSERT(bh_result->b_size >= (1 << inode->i_blkbits));
 	size = bh_result->b_size;
-	error = bhv_vop_bmap(vp, offset, size,
+	error = xfs_bmap(XFS_I(inode), offset, size,
 			     create ? flags : BMAPI_READ, &iomap, &niomap);
 	if (error)
 		return -error;
@@ -1480,13 +1482,13 @@ xfs_vm_direct_IO(
 {
 	struct file	*file = iocb->ki_filp;
 	struct inode	*inode = file->f_mapping->host;
-	bhv_vnode_t	*vp = vn_from_inode(inode);
 	xfs_iomap_t	iomap;
 	int		maps = 1;
 	int		error;
 	ssize_t		ret;
 
-	error = bhv_vop_bmap(vp, offset, 0, BMAPI_DEVICE, &iomap, &maps);
+	error = xfs_bmap(XFS_I(inode), offset, 0,
+				BMAPI_DEVICE, &iomap, &maps);
 	if (error)
 		return -error;
 
@@ -1527,12 +1529,13 @@ xfs_vm_bmap(
 	sector_t		block)
 {
 	struct inode		*inode = (struct inode *)mapping->host;
-	bhv_vnode_t		*vp = vn_from_inode(inode);
+	struct xfs_inode	*ip = XFS_I(inode);
 
-	vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
-	bhv_vop_rwlock(vp, VRWLOCK_READ);
-	bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF);
-	bhv_vop_rwunlock(vp, VRWLOCK_READ);
+	vn_trace_entry(vn_from_inode(inode), __FUNCTION__,
+			(inst_t *)__return_address);
+	xfs_rwlock(ip, VRWLOCK_READ);
+	xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF);
+	xfs_rwunlock(ip, VRWLOCK_READ);
 	return generic_block_bmap(mapping, block, xfs_get_blocks);
 }
 
fs/xfs/linux-2.6/xfs_export.c +5 -3
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_export.c
===================================================================
@@ -25,6 +25,9 @@
 #include "xfs_dmapi.h"
 #include "xfs_mount.h"
 #include "xfs_export.h"
+#include "xfs_vnodeops.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_inode.h"
 
 static struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, };
 
@@ -161,12 +164,11 @@ xfs_fs_get_parent(
 	struct dentry		*child)
 {
 	int			error;
-	bhv_vnode_t		*vp, *cvp;
+	bhv_vnode_t		*cvp;
 	struct dentry		*parent;
 
 	cvp = NULL;
-	vp = vn_from_inode(child->d_inode);
-	error = bhv_vop_lookup(vp, &dotdot, &cvp, 0, NULL, NULL);
+	error = xfs_lookup(XFS_I(child->d_inode), &dotdot, &cvp);
 	if (unlikely(error))
 		return ERR_PTR(-error);
 
fs/xfs/linux-2.6/xfs_ioctl32.c +3 -2
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c
===================================================================
@@ -43,6 +43,7 @@
 #include "xfs_itable.h"
 #include "xfs_error.h"
 #include "xfs_dfrag.h"
+#include "xfs_vnodeops.h"
 
 #define  _NATIVE_IOC(cmd, type) \
 	  _IOC(_IOC_DIR(cmd), _IOC_TYPE(cmd), _IOC_NR(cmd), sizeof(type))
@@ -443,7 +444,7 @@ xfs_compat_ioctl(
 	case XFS_IOC_FSBULKSTAT_SINGLE_32:
 	case XFS_IOC_FSINUMBERS_32:
 		cmd = _NATIVE_IOC(cmd, struct xfs_fsop_bulkreq);
-		return xfs_ioc_bulkstat_compat(XFS_BHVTOI(VNHEAD(vp))->i_mount,
+		return xfs_ioc_bulkstat_compat(XFS_I(inode)->i_mount,
 				cmd, (void*)arg);
 	case XFS_IOC_FD_TO_HANDLE_32:
 	case XFS_IOC_PATH_TO_HANDLE_32:
@@ -457,7 +458,7 @@ xfs_compat_ioctl(
 		return -ENOIOCTLCMD;
 	}
 
-	error = bhv_vop_ioctl(vp, inode, file, mode, cmd, (void __user *)arg);
+	error = xfs_ioctl(XFS_I(inode), file, mode, cmd, (void __user *)arg);
 	VMODIFY(vp);
 
 	return error;
fs/xfs/linux-2.6/xfs_lrw.c +5 -3
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c
===================================================================
@@ -257,8 +257,9 @@ xfs_read(
 
 	if (unlikely(ioflags & IO_ISDIRECT)) {
 		if (VN_CACHED(vp))
-			ret = bhv_vop_flushinval_pages(vp, ctooff(offtoct(*offset)),
-						 -1, FI_REMAPF_LOCKED);
+			ret = xfs_flushinval_pages(ip,
+					ctooff(offtoct(*offset)),
+					-1, FI_REMAPF_LOCKED);
 		mutex_unlock(&inode->i_mutex);
 		if (ret) {
 			xfs_iunlock(ip, XFS_IOLOCK_SHARED);
@@ -809,7 +810,8 @@ retry:
 			WARN_ON(need_i_mutex == 0);
 			xfs_inval_cached_trace(io, pos, -1,
 					ctooff(offtoct(pos)), -1);
-			error = bhv_vop_flushinval_pages(vp, ctooff(offtoct(pos)),
+			error = xfs_flushinval_pages(xip,
+					ctooff(offtoct(pos)),
 					-1, FI_REMAPF_LOCKED);
 			if (error)
 				goto out_unlock_internal;
fs/xfs/linux-2.6/xfs_vnode.c +4 -4
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c
===================================================================
@@ -16,6 +16,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 #include "xfs.h"
+#include "xfs_vnodeops.h"
+#include "xfs_bmap_btree.h"
+#include "xfs_inode.h"
 
 uint64_t vn_generation;		/* vnode generation number */
 DEFINE_SPINLOCK(vnumber_lock);
@@ -90,9 +93,6 @@ vn_initialize(
 
 	ASSERT(VN_CACHED(vp) == 0);
 
-	/* Initialize the first behavior and the behavior chain head. */
-	vn_bhv_head_init(VN_BHV_HEAD(vp), "vnode");
-
 	atomic_set(&vp->v_iocount, 0);
 
 #ifdef	XFS_VNODE_TRACE
@@ -152,7 +152,7 @@ __vn_revalidate(
 
 	vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
 	vattr->va_mask = XFS_AT_STAT | XFS_AT_XFLAGS;
-	error = bhv_vop_getattr(vp, vattr, 0, NULL);
+	error = xfs_getattr(xfs_vtoi(vp), vattr, 0);
 	if (likely(!error)) {
 		vn_revalidate_core(vp, vattr);
 		VUNMODIFY(vp);
fs/xfs/linux-2.6/xfs_super.c +21 -17
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================
@@ -46,6 +46,7 @@
 #include "xfs_attr.h"
 #include "xfs_buf_item.h"
 #include "xfs_utils.h"
+#include "xfs_vnodeops.h"
 #include "xfs_version.h"
 
 #include <linux/namei.h>
@@ -203,16 +204,15 @@ void
 xfs_initialize_vnode(
 	bhv_desc_t		*bdp,
 	bhv_vnode_t		*vp,
-	bhv_desc_t		*inode_bhv,
+	struct xfs_inode	*ip,
 	int			unlock)
 {
-	xfs_inode_t		*ip = XFS_BHVTOI(inode_bhv);
 	struct inode		*inode = vn_to_inode(vp);
 
-	if (!inode_bhv->bd_vobj) {
+	if (!ip->i_vnode) {
 		vp->v_vfsp = bhvtovfs(bdp);
-		bhv_desc_init(inode_bhv, ip, vp, &xfs_vnodeops);
-		bhv_insert(VN_BHV_HEAD(vp), inode_bhv);
+		ip->i_vnode = vp;
+		inode->i_private = ip;
 	}
 
 	/*
@@ -411,17 +411,21 @@ xfs_fs_write_inode(
 	struct inode		*inode,
 	int			sync)
 {
-	bhv_vnode_t		*vp = vn_from_inode(inode);
 	int			error = 0, flags = FLUSH_INODE;
 
-	if (vp) {
-		vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
+	vn_trace_entry(vn_from_inode(inode), __FUNCTION__,
+			(inst_t *)__return_address);
+	if (sync)
+		flags |= FLUSH_SYNC;
+	error = xfs_inode_flush(XFS_I(inode), flags);
+	if (error == EAGAIN) {
 		if (sync)
-			flags |= FLUSH_SYNC;
-		error = bhv_vop_iflush(vp, flags);
-		if (error == EAGAIN)
-			error = sync? bhv_vop_iflush(vp, flags | FLUSH_LOG) : 0;
+			error = xfs_inode_flush(XFS_I(inode),
+						       flags | FLUSH_LOG);
+		else
+			error = 0;
 	}
+
 	return -error;
 }
 
@@ -442,18 +446,18 @@ xfs_fs_clear_inode(
 	 * This can happen because xfs_iget_core calls xfs_idestroy if we
 	 * find an inode with di_mode == 0 but without IGET_CREATE set.
 	 */
-	if (VNHEAD(vp))
-		bhv_vop_inactive(vp, NULL);
+	if (XFS_I(inode))
+		xfs_inactive(XFS_I(inode));
 
 	VN_LOCK(vp);
 	vp->v_flag &= ~VMODIFIED;
 	VN_UNLOCK(vp, 0);
 
-	if (VNHEAD(vp))
-		if (bhv_vop_reclaim(vp))
+	if (XFS_I(inode))
+		if (xfs_reclaim(XFS_I(inode)))
 			panic("%s: cannot reclaim 0x%p\n", __FUNCTION__, vp);
 
-	ASSERT(VNHEAD(vp) == NULL);
+	ASSERT(XFS_I(inode) == NULL);
 
 #ifdef XFS_VNODE_TRACE
 	ktrace_free(vp->v_trace);
fs/xfs/xfs_acl.c +14 -10
Index: linux-2.6-xfs/fs/xfs/xfs_acl.c
===================================================================
@@ -32,6 +32,7 @@
 #include "xfs_btree.h"
 #include "xfs_acl.h"
 #include "xfs_attr.h"
+#include "xfs_vnodeops.h"
 
 #include <linux/capability.h>
 #include <linux/posix_acl_xattr.h>
@@ -241,7 +242,7 @@ xfs_acl_vget(
 			bhv_vattr_t	va;
 
 			va.va_mask = XFS_AT_MODE;
-			error = bhv_vop_getattr(vp, &va, 0, sys_cred);
+			error = xfs_getattr(xfs_vtoi(vp), &va, 0);
 			if (error)
 				goto out;
 			xfs_acl_sync_mode(va.va_mode, xfs_acl);
@@ -265,9 +266,10 @@ xfs_acl_vremove(
 	VN_HOLD(vp);
 	error = xfs_acl_allow_set(vp, kind);
 	if (!error) {
-		error = bhv_vop_attr_remove(vp, kind == _ACL_TYPE_DEFAULT?
+		error = xfs_attr_remove(xfs_vtoi(vp),
+						kind == _ACL_TYPE_DEFAULT?
 						SGI_ACL_DEFAULT: SGI_ACL_FILE,
-						ATTR_ROOT, sys_cred);
+						ATTR_ROOT);
 		if (error == ENOATTR)
 			error = 0;	/* 'scool */
 	}
@@ -380,7 +382,7 @@ xfs_acl_allow_set(
 	if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
 		return EROFS;
 	va.va_mask = XFS_AT_UID;
-	error = bhv_vop_getattr(vp, &va, 0, NULL);
+	error = xfs_getattr(xfs_vtoi(vp), &va, 0);
 	if (error)
 		return error;
 	if (va.va_uid != current->fsuid && !capable(CAP_FOWNER))
@@ -614,7 +616,8 @@ xfs_acl_get_attr(
 
 	ASSERT((flags & ATTR_KERNOVAL) ? (aclp == NULL) : 1);
 	flags |= ATTR_ROOT;
-	*error = bhv_vop_attr_get(vp, kind == _ACL_TYPE_ACCESS ?
+	*error = xfs_attr_get(xfs_vtoi(vp),
+					kind == _ACL_TYPE_ACCESS ?
 					SGI_ACL_FILE : SGI_ACL_DEFAULT,
 					(char *)aclp, &len, flags, sys_cred);
 	if (*error || (flags & ATTR_KERNOVAL))
@@ -652,9 +655,10 @@ xfs_acl_set_attr(
 		INT_SET(newace->ae_perm, ARCH_CONVERT, ace->ae_perm);
 	}
 	INT_SET(newacl->acl_cnt, ARCH_CONVERT, aclp->acl_cnt);
-	*error = bhv_vop_attr_set(vp, kind == _ACL_TYPE_ACCESS ?
+	*error = xfs_attr_set(xfs_vtoi(vp),
+				kind == _ACL_TYPE_ACCESS ?
 				SGI_ACL_FILE: SGI_ACL_DEFAULT,
-				(char *)newacl, len, ATTR_ROOT, sys_cred);
+				(char *)newacl, len, ATTR_ROOT);
 	_ACL_FREE(newacl);
 }
 
@@ -676,7 +680,7 @@ xfs_acl_vtoacl(
 		if (!error) {
 			/* Got the ACL, need the mode... */
 			va.va_mask = XFS_AT_MODE;
-			error = bhv_vop_getattr(vp, &va, 0, sys_cred);
+			error = xfs_getattr(xfs_vtoi(vp), &va, 0);
 		}
 
 		if (error)
@@ -774,7 +778,7 @@ xfs_acl_setmode(
 	 * mode.  The m:: bits take precedence over the g:: bits.
 	 */
 	va.va_mask = XFS_AT_MODE;
-	error = bhv_vop_getattr(vp, &va, 0, sys_cred);
+	error = xfs_getattr(xfs_vtoi(vp), &va, 0);
 	if (error)
 		return error;
 
@@ -808,7 +812,7 @@ xfs_acl_setmode(
 	if (gap && nomask)
 		va.va_mode |= gap->ae_perm << 3;
 
-	return bhv_vop_setattr(vp, &va, 0, sys_cred);
+	return xfs_setattr(xfs_vtoi(vp), &va, 0, sys_cred);
 }
 
 /*
fs/xfs/xfs_attr.c +6 -4
Index: linux-2.6-xfs/fs/xfs/xfs_attr.c
===================================================================
@@ -49,6 +49,7 @@
 #include "xfs_trans_space.h"
 #include "xfs_acl.h"
 #include "xfs_rw.h"
+#include "xfs_vnodeops.h"
 
 /*
  * xfs_attr.c
@@ -2512,7 +2513,7 @@ STATIC int
 attr_generic_set(
 	bhv_vnode_t *vp, char *name, void *data, size_t size, int xflags)
 {
-	return -bhv_vop_attr_set(vp, name, data, size, xflags, NULL);
+	return -xfs_attr_set(xfs_vtoi(vp), name, data, size, xflags);
 }
 
 STATIC int
@@ -2521,7 +2522,8 @@ attr_generic_get(
 {
 	int	error, asize = size;
 
-	error = bhv_vop_attr_get(vp, name, data, &asize, xflags, NULL);
+	error = xfs_attr_get(xfs_vtoi(vp), name, data,
+				    &asize, xflags, NULL);
 	if (!error)
 		return asize;
 	return -error;
@@ -2531,7 +2533,7 @@ STATIC int
 attr_generic_remove(
 	bhv_vnode_t *vp, char *name, int xflags)
 {
-	return -bhv_vop_attr_remove(vp, name, xflags, NULL);
+	return -xfs_attr_remove(xfs_vtoi(vp), name, xflags);
 }
 
 STATIC int
@@ -2586,7 +2588,7 @@ attr_generic_list(
 	attrlist_cursor_kern_t	cursor = { 0 };
 	int			error;
 
-	error = bhv_vop_attr_list(vp, data, size, xflags, &cursor, NULL);
+	error = xfs_attr_list(xfs_vtoi(vp), data, size, xflags, &cursor);
 	if (error > 0)
 		return -error;
 	*result = -error;
fs/xfs/xfs_bmap.c +3 -1
Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c
===================================================================
@@ -53,6 +53,7 @@
 #include "xfs_trans_space.h"
 #include "xfs_buf_item.h"
 #include "xfs_filestream.h"
+#include "xfs_vnodeops.h"
 
 
 #ifdef DEBUG
@@ -5868,7 +5869,8 @@ xfs_getbmap(
 	if (whichfork == XFS_DATA_FORK &&
 		(ip->i_delayed_blks || ip->i_size > ip->i_d.di_size)) {
 		/* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */
-		error = bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF);
+		error = xfs_flush_pages(ip, (xfs_off_t)0,
+					       -1, 0, FI_REMAPF);
 	}
 
 	ASSERT(whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0);
fs/xfs/xfs_dfrag.c +4 -2
Index: linux-2.6-xfs/fs/xfs/xfs_dfrag.c
===================================================================
@@ -42,6 +42,7 @@
 #include "xfs_dfrag.h"
 #include "xfs_error.h"
 #include "xfs_rw.h"
+#include "xfs_vnodeops.h"
 
 /*
  * Syssgi interface for swapext
@@ -199,7 +200,8 @@ xfs_swap_extents(
 
 	if (VN_CACHED(tvp) != 0) {
 		xfs_inval_cached_trace(&tip->i_iocore, 0, -1, 0, -1);
-		error = bhv_vop_flushinval_pages(tvp, 0, -1, FI_REMAPF_LOCKED);
+		error = xfs_flushinval_pages(tip, 0, -1,
+				FI_REMAPF_LOCKED);
 		if (error)
 			goto error0;
 	}
@@ -265,7 +267,7 @@ xfs_swap_extents(
 	 * fields change.
 	 */
 
-	bhv_vop_toss_pages(vp, 0, -1, FI_REMAPF);
+	xfs_tosspages(ip, 0, -1, FI_REMAPF);
 
 	tp = xfs_trans_alloc(mp, XFS_TRANS_SWAPEXT);
 	if ((error = xfs_trans_reserve(tp, 0,
fs/xfs/xfs_inode.c +6 -3
Index: linux-2.6-xfs/fs/xfs/xfs_inode.c
===================================================================
@@ -49,6 +49,7 @@
 #include "xfs_quota.h"
 #include "xfs_acl.h"
 #include "xfs_filestream.h"
+#include "xfs_vnodeops.h"
 
 kmem_zone_t *xfs_ifork_zone;
 kmem_zone_t *xfs_inode_zone;
@@ -1267,7 +1268,7 @@ xfs_ialloc(
 	xfs_trans_log_inode(tp, ip, flags);
 
 	/* now that we have an i_mode we can setup inode ops and unlock */
-	bhv_vfs_init_vnode(XFS_MTOVFS(tp->t_mountp), vp, XFS_ITOBHV(ip), 1);
+	bhv_vfs_init_vnode(XFS_MTOVFS(tp->t_mountp), vp, ip, 1);
 
 	*ipp = ip;
 	return 0;
@@ -1489,9 +1490,11 @@ xfs_itruncate_start(
 			 last_byte);
 	if (last_byte > toss_start) {
 		if (flags & XFS_ITRUNC_DEFINITE) {
-			bhv_vop_toss_pages(vp, toss_start, -1, FI_REMAPF_LOCKED);
+			xfs_tosspages(ip, toss_start,
+					-1, FI_REMAPF_LOCKED);
 		} else {
-			error = bhv_vop_flushinval_pages(vp, toss_start, -1, FI_REMAPF_LOCKED);
+			error = xfs_flushinval_pages(ip, toss_start,
+					-1, FI_REMAPF_LOCKED);
 		}
 	}
 
fs/xfs/xfs_rename.c +1 -4
Index: linux-2.6-xfs/fs/xfs/xfs_rename.c
===================================================================
@@ -586,11 +586,8 @@ xfs_rename(
 	/*
 	 * Let interposed file systems know about removed links.
 	 */
-	if (target_ip_dropped) {
-		bhv_vop_link_removed(XFS_ITOV(target_ip), target_dir_vp,
-					target_link_zero);
+	if (target_ip_dropped)
 		IRELE(target_ip);
-	}
 
 	IRELE(src_ip);
 
fs/xfs/xfs_vfsops.c +7 -4
Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c
===================================================================
@@ -54,6 +54,8 @@
 #include "xfs_mru_cache.h"
 #include "xfs_filestream.h"
 #include "xfs_fsops.h"
+#include "xfs_vnodeops.h"
+
 
 STATIC int	xfs_sync(bhv_desc_t *, int, cred_t *);
 
@@ -1191,12 +1193,13 @@ xfs_sync_inodes(
 			if (flags & SYNC_CLOSE) {
 				/* Shutdown case. Flush and invalidate. */
 				if (XFS_FORCED_SHUTDOWN(mp))
-					bhv_vop_toss_pages(vp, 0, -1, FI_REMAPF);
+					xfs_tosspages(ip, 0, -1,
+							     FI_REMAPF);
 				else
-					error = bhv_vop_flushinval_pages(vp, 0,
-								-1, FI_REMAPF);
+					error = xfs_flushinval_pages(ip,
+							0, -1, FI_REMAPF);
 			} else if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) {
-				error = bhv_vop_flush_pages(vp, (xfs_off_t)0,
+				error = xfs_flush_pages(ip, 0,
 							-1, fflag, FI_NONE);
 			}
 
fs/xfs/xfs_vnodeops.c +6 -24
Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c
===================================================================
@@ -592,7 +592,7 @@ xfs_setattr(
 		if (!code &&
 		    (ip->i_size != ip->i_d.di_size) &&
 		    (vap->va_size > ip->i_d.di_size)) {
-			code = bhv_vop_flush_pages(XFS_ITOV(ip),
+			code = xfs_flush_pages(ip,
 					ip->i_d.di_size, vap->va_size,
 					XFS_B_ASYNC, FI_NONE);
 		}
@@ -864,10 +864,6 @@ xfs_setattr(
 	 * racing calls to vop_vnode_change.
 	 */
 	mandlock_after = MANDLOCK(vp, ip->i_d.di_mode);
-	if (mandlock_before != mandlock_after) {
-		bhv_vop_vnode_change(vp, VCHANGE_FLAGS_ENF_LOCKING,
-				 mandlock_after);
-	}
 
 	xfs_iunlock(ip, lock_flags);
 
@@ -1541,7 +1537,7 @@ xfs_release(
 		 * be exposed to that problem.
 		 */
 		if (VUNTRUNCATE(vp) && VN_DIRTY(vp) && ip->i_delayed_blks > 0)
-			bhv_vop_flush_pages(vp, 0, -1, XFS_B_ASYNC, FI_NONE);
+			xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE);
 	}
 
 #ifdef HAVE_REFCACHE
@@ -2005,12 +2001,6 @@ xfs_create(
 	XFS_QM_DQRELE(mp, udqp);
 	XFS_QM_DQRELE(mp, gdqp);
 
-	/*
-	 * Propagate the fact that the vnode changed after the
-	 * xfs_inode locks have been released.
-	 */
-	bhv_vop_vnode_change(vp, VCHANGE_FLAGS_TRUNCATED, 3);
-
 	*vpp = vp;
 
 	/* Fallthrough to std_return with error = 0  */
@@ -2509,11 +2499,6 @@ xfs_remove(
 
 	vn_trace_exit(XFS_ITOV(ip), __FUNCTION__, (inst_t *)__return_address);
 
-	/*
-	 * Let interposed file systems know about removed links.
-	 */
-	bhv_vop_link_removed(XFS_ITOV(ip), dir_vp, link_zero);
-
 	IRELE(ip);
 
 /*	Fall through to std_return with error = 0 */
@@ -3143,11 +3128,6 @@ xfs_rmdir(
 	}
 
 
-	/*
-	 * Let interposed file systems know about removed links.
-	 */
-	bhv_vop_link_removed(XFS_ITOV(cdp), dir_vp, last_cdp_link);
-
 	IRELE(cdp);
 
 	/* Fall through to std_return with error = 0 or the errno
@@ -3728,7 +3708,8 @@ xfs_reclaim(
 		XFS_MOUNT_ILOCK(mp);
 		spin_lock(&ip->i_flags_lock);
 		__xfs_iflags_set(ip, XFS_IRECLAIMABLE);
-		vn_bhv_remove(VN_BHV_HEAD(vp), XFS_ITOBHV(ip));
+		vn_to_inode(vp)->i_private = NULL;
+		ip->i_vnode = NULL;
 		spin_unlock(&ip->i_flags_lock);
 		list_add_tail(&ip->i_reclaim, &mp->m_del_inodes);
 		XFS_MOUNT_IUNLOCK(mp);
@@ -4210,7 +4191,8 @@ xfs_free_file_space(
 	if (VN_CACHED(vp) != 0) {
 		xfs_inval_cached_trace(&ip->i_iocore, ioffset, -1,
 				ctooff(offtoct(ioffset)), -1);
-		error = bhv_vop_flushinval_pages(vp, ctooff(offtoct(ioffset)),
+		error = xfs_flushinval_pages(ip,
+				ctooff(offtoct(ioffset)),
 				-1, FI_REMAPF_LOCKED);
 		if (error)
 			goto out_unlock_iolock;
fs/xfs/linux-2.6/xfs_vnode.h +1 -225

250 lines not on this page · raw message

fs/xfs/xfs_vnodeops_bhv.c deleted +0 -438

438 lines not on this page · raw message

fs/xfs/xfs_inode.h +3 -9
Index: linux-2.6-xfs/fs/xfs/xfs_inode.h
===================================================================
@@ -257,7 +257,7 @@ typedef struct xfs_inode {
 	struct xfs_inode	*i_mprev;	/* ptr to prev inode */
 	struct xfs_mount	*i_mount;	/* fs mount struct ptr */
 	struct list_head	i_reclaim;	/* reclaim list */
-	struct bhv_desc		i_bhv_desc;	/* inode behavior descriptor*/
+	struct bhv_vnode	*i_vnode;	/* vnode backpointer */
 	struct xfs_dquot	*i_udquot;	/* user dquot */
 	struct xfs_dquot	*i_gdquot;	/* group dquot */
 
@@ -465,12 +465,8 @@ xfs_iflags_test(xfs_inode_t *ip, unsigne
 #define	XFS_ITRUNC_DEFINITE	0x1
 #define	XFS_ITRUNC_MAYBE	0x2
 
-#define	XFS_ITOV(ip)		BHV_TO_VNODE(XFS_ITOBHV(ip))
-#define	XFS_ITOV_NULL(ip)	BHV_TO_VNODE_NULL(XFS_ITOBHV(ip))
-#define	XFS_ITOBHV(ip)		((struct bhv_desc *)(&((ip)->i_bhv_desc)))
-#define	XFS_BHVTOI(bhvp)	((xfs_inode_t *)((char *)(bhvp) - \
-				(char *)&(((xfs_inode_t *)0)->i_bhv_desc)))
-#define BHV_IS_XFS(bdp)		(BHV_OPS(bdp) == &xfs_vnodeops)
+#define	XFS_ITOV(ip)		((ip)->i_vnode)
+#define	XFS_ITOV_NULL(ip)	((ip)->i_vnode)
 
 /*
  * For multiple groups support: if S_ISGID bit is set in the parent
@@ -557,8 +553,6 @@ void		xfs_ichgtime(xfs_inode_t *, int);
 xfs_fsize_t	xfs_file_last_byte(xfs_inode_t *);
 void		xfs_lock_inodes(xfs_inode_t **, int, int, uint);
 
-xfs_inode_t	*xfs_vtoi(struct bhv_vnode *vp);
-
 void		xfs_synchronize_atime(xfs_inode_t *);
 
 xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t);
fs/xfs/Makefile-linux-2.6 +0 -1
Index: linux-2.6-xfs/fs/xfs/Makefile-linux-2.6
===================================================================
@@ -79,7 +79,6 @@ xfs-y				+= xfs_alloc.o \
 				   xfs_utils.o \
 				   xfs_vfsops.o \
 				   xfs_vnodeops.o \
-				   xfs_vnodeops_bhv.o \
 				   xfs_rw.o \
 				   xfs_dmops.o \
 				   xfs_qmops.o
fs/xfs/linux-2.6/xfs_vfs.h +3 -2
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vfs.h
===================================================================
@@ -28,6 +28,7 @@ struct fid;
 struct cred;
 struct seq_file;
 struct super_block;
+struct xfs_inode;
 struct xfs_mount_args;
 
 typedef struct kstatfs	bhv_statvfs_t;
@@ -131,7 +132,7 @@ typedef int	(*vfs_vget_t)(bhv_desc_t *, 
 typedef int	(*vfs_dmapiops_t)(bhv_desc_t *, caddr_t);
 typedef int	(*vfs_quotactl_t)(bhv_desc_t *, int, int, caddr_t);
 typedef void	(*vfs_init_vnode_t)(bhv_desc_t *,
-				struct bhv_vnode *, bhv_desc_t *, int);
+				struct bhv_vnode *, struct xfs_inode *, int);
 typedef void	(*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int);
 typedef void	(*vfs_freeze_t)(bhv_desc_t *);
 typedef	struct inode * (*vfs_get_inode_t)(bhv_desc_t *, xfs_ino_t, int);
@@ -206,7 +207,7 @@ extern int vfs_vget(bhv_desc_t *, struct
 extern int vfs_dmapiops(bhv_desc_t *, caddr_t);
 extern int vfs_quotactl(bhv_desc_t *, int, int, caddr_t);
 extern struct inode *vfs_get_inode(bhv_desc_t *, xfs_ino_t, int);
-extern void vfs_init_vnode(bhv_desc_t *, struct bhv_vnode *, bhv_desc_t *, int);
+extern void vfs_init_vnode(bhv_desc_t *, struct bhv_vnode *, struct xfs_inode *, int);
 extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int);
 extern void vfs_freeze(bhv_desc_t *);
 
fs/xfs/xfs_iget.c +3 -2
Index: linux-2.6-xfs/fs/xfs/xfs_iget.c
===================================================================
@@ -342,7 +342,7 @@ finish_inode:
 	 * If we have a real type for an on-disk inode, we can set ops(&unlock)
 	 * now.	 If it's a new inode being created, xfs_ialloc will handle it.
 	 */
-	bhv_vfs_init_vnode(XFS_MTOVFS(mp), vp, XFS_ITOBHV(ip), 1);
+	bhv_vfs_init_vnode(XFS_MTOVFS(mp), vp, ip, 1);
 
 	return 0;
 }
@@ -536,7 +536,8 @@ xfs_ireclaim(xfs_inode_t *ip)
 	 */
 	vp = XFS_ITOV_NULL(ip);
 	if (vp) {
-		vn_bhv_remove(VN_BHV_HEAD(vp), XFS_ITOBHV(ip));
+		vn_to_inode(vp)->i_private = NULL;
+		ip->i_vnode = NULL;
 	}
 
 	/*
fs/xfs/linux-2.6/xfs_super.h +1 -1
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.h
===================================================================
@@ -77,7 +77,7 @@ struct block_device;
 extern __uint64_t xfs_max_file_offset(unsigned int);
 
 extern struct inode *xfs_get_inode(bhv_desc_t *, xfs_ino_t, int);
-extern void xfs_initialize_vnode(bhv_desc_t *, bhv_vnode_t *, bhv_desc_t *, int);
+extern void xfs_initialize_vnode(bhv_desc_t *, bhv_vnode_t *, struct xfs_inode *, int);
 
 extern void xfs_flush_inode(struct xfs_inode *);
 extern void xfs_flush_device(struct xfs_inode *);
fs/xfs/linux-2.6/xfs_vfs.c +2 -2
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vfs.c
===================================================================
@@ -200,7 +200,7 @@ void
 vfs_init_vnode(
 	struct bhv_desc		*bdp,
 	struct bhv_vnode	*vp,
-	struct bhv_desc		*bp,
+	struct xfs_inode	*ip,
 	int			unlock)
 {
 	struct bhv_desc		*next = bdp;
@@ -208,7 +208,7 @@ vfs_init_vnode(
 	ASSERT(next);
 	while (! (bhvtovfsops(next))->vfs_init_vnode)
 		next = BHV_NEXT(next);
-	((*bhvtovfsops(next)->vfs_init_vnode)(next, vp, bp, unlock));
+	((*bhvtovfsops(next)->vfs_init_vnode)(next, vp, ip, unlock));
 }
 
 void
fs/xfs/dmapi/xfs_dm.c +16 -21
Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c
===================================================================
@@ -575,11 +575,11 @@ xfs_dm_bulkall_iget_one(
 	dm_ip_to_handle(vn_to_inode(vp), &handle);
 	xfs_dm_handle_to_xstat(xbuf, xstat_sz, &handle, sizeof(handle));
 
-	/* Drop ILOCK_SHARED for call to bhv_vop_attr_get */
+	/* Drop ILOCK_SHARED for call to xfs_attr_get */
 	xfs_iunlock(ip, XFS_ILOCK_SHARED);
 
 	memset(&xbuf->dx_attrdata, 0, sizeof(dm_vardata_t));
-	error = bhv_vop_attr_get(vp, attr_name, attr_buf,
+	error = xfs_attr_get(ip, attr_name, attr_buf,
 				 &value_len, ATTR_ROOT, sys_cred);
 	VN_RELE(vp);
 
@@ -1736,7 +1736,6 @@ xfs_dm_get_destroy_dmattr(
 	int		value_len;
 	char		*value;
 	int		error;
-	bhv_vnode_t	*vp = vn_from_inode(inode);
 
 	/* Returns negative errors to DMAPI */
 
@@ -1752,7 +1751,7 @@ xfs_dm_get_destroy_dmattr(
 		(char *)attrnamep->an_chars, DM_ATTR_NAME_SIZE + 1);
 	dkattrname.dan_chars[sizeof(dkattrname.dan_chars) - 1] = '\0';
 
-	/* bhv_vop_attr_get will not return anything if the buffer is too small,
+	/* xfs_attr_get will not return anything if the buffer is too small,
 	   and we don't know how big to make the buffer, so this may take
 	   two tries to get it right.  The initial try must use a buffer of
 	   at least XFS_BUG_KLUDGE bytes to prevent buffer overflow because
@@ -1764,7 +1763,7 @@ xfs_dm_get_destroy_dmattr(
 	if (value == NULL)
 		return(-ENOMEM);
 
-	error = bhv_vop_attr_get(vp, dkattrname.dan_chars, value, &value_len,
+	error = xfs_attr_get(XFS_I(inode), dkattrname.dan_chars, value, &value_len,
 					ATTR_ROOT, sys_cred);
 	if (error == ERANGE) {
 		kfree(value);
@@ -1773,7 +1772,7 @@ xfs_dm_get_destroy_dmattr(
 		if (value == NULL)
 			return(-ENOMEM);
 
-		error = bhv_vop_attr_get(vp, dkattrname.dan_chars, value,
+		error = xfs_attr_get(XFS_I(inode), dkattrname.dan_chars, value,
 					&value_len, ATTR_ROOT, sys_cred);
 	}
 	if (error) {
@@ -1970,7 +1969,7 @@ xfs_dm_get_dirattrs_rvp(
 	mutex_lock(&inode->i_mutex);
 	error = -ENOENT;
 	if (!IS_DEADDIR(inode)) {
-		error = -bhv_vop_readdir(vp, cb, dp->i_size,
+		error = -xfs_readdir(dp, cb, dp->i_size,
 					 (xfs_off_t *)&loc, dm_filldir);
 	}
 	mutex_unlock(&inode->i_mutex);
@@ -2017,7 +2016,6 @@ xfs_dm_get_dmattr(
 	int		value_len;
 	int		alloc_size;
 	int		error;
-	bhv_vnode_t	*vp = vn_from_inode(inode);
 
 	/* Returns negative errors to DMAPI */
 
@@ -2050,7 +2048,7 @@ xfs_dm_get_dmattr(
 
 	value_len = alloc_size;		/* in/out parameter */
 
-	error = bhv_vop_attr_get(vp, name.dan_chars, value, &value_len,
+	error = xfs_attr_get(XFS_I(inode), name.dan_chars, value, &value_len,
 					ATTR_ROOT, NULL);
 	DM_EA_XLATE_ERR(error);
 
@@ -2202,7 +2200,6 @@ xfs_dm_getall_dmattr(
 	int		total_size;
 	int		list_size = 8192;	/* should be big enough */
 	int		error;
-	bhv_vnode_t	*vp = vn_from_inode(inode);
 
 	/* Returns negative errors to DMAPI */
 
@@ -2243,8 +2240,8 @@ xfs_dm_getall_dmattr(
 		   more or if we encounter an error, then finish up.
 		*/
 
-		error = bhv_vop_attr_list(vp, (char *)attrlist, list_size,
-						ATTR_ROOT, &cursor, NULL);
+		error = xfs_attr_list(XFS_I(inode), (char *)attrlist, list_size,
+						ATTR_ROOT, &cursor);
 		DM_EA_XLATE_ERR(error);
 
 		if (error || attrlist->al_count == 0)
@@ -2302,7 +2299,7 @@ xfs_dm_getall_dmattr(
 
 			value_len = entry->a_valuelen;
 
-			error = bhv_vop_attr_get(vp, entry->a_name,
+			error = xfs_attr_get(XFS_I(inode), entry->a_name,
 						(void *)(ulist + 1), &value_len,
 						ATTR_ROOT, NULL);
 			DM_EA_XLATE_ERR(error);
@@ -2665,7 +2662,6 @@ xfs_dm_remove_dmattr(
 {
 	dm_dkattrname_t name;
 	int		error;
-	bhv_vnode_t	*vp = vn_from_inode(inode);
 
 	/* Returns negative errors to DMAPI */
 
@@ -2677,8 +2673,8 @@ xfs_dm_remove_dmattr(
 
 	/* Remove the attribute from the object. */
 
-	error = bhv_vop_attr_remove(vp, name.dan_chars, setdtime ?
-				ATTR_ROOT : (ATTR_ROOT|ATTR_KERNOTIME), NULL);
+	error = xfs_attr_remove(XFS_I(inode), name.dan_chars, setdtime ?
+				ATTR_ROOT : (ATTR_ROOT|ATTR_KERNOTIME));
 	DM_EA_XLATE_ERR(error);
 
 	if (error == ENOATTR)
@@ -2725,7 +2721,6 @@ xfs_dm_set_dmattr(
 	char		*value;
 	int		alloc_size;
 	int		error;
-	bhv_vnode_t	*vp = vn_from_inode(inode);
 
 	/* Returns negative errors to DMAPI */
 
@@ -2748,9 +2743,9 @@ xfs_dm_set_dmattr(
 	if (copy_from_user( value, bufp, buflen)) {
 		error = EFAULT;
 	} else {
-		error = bhv_vop_attr_set(vp, name.dan_chars, value, buflen,
+		error = xfs_attr_set(XFS_I(inode), name.dan_chars, value, buflen,
 					setdtime ? ATTR_ROOT :
-					(ATTR_ROOT|ATTR_KERNOTIME), NULL);
+					(ATTR_ROOT|ATTR_KERNOTIME));
 		DM_EA_XLATE_ERR(error);
 	}
 	kmem_free(value, alloc_size);
@@ -2849,7 +2844,7 @@ xfs_dm_set_fileattr(
 		vat.va_size = stat.fa_size;
 	}
 
-	error = bhv_vop_setattr(vp, &vat, ATTR_DMI, NULL);
+	error = xfs_setattr(XFS_I(inode), &vat, ATTR_DMI, NULL);
 	if (!error)
 		vn_revalidate(vp);	/* update Linux inode flags */
 	return(-error); /* Return negative error to DMAPI */
@@ -3003,7 +2998,7 @@ xfs_dm_sync_by_handle(
 	/* We need to protect against concurrent writers.. */
 	ret = filemap_fdatawrite(inode->i_mapping);
 	down_rw_sems(inode, DM_FLAGS_IMUX);
-	err = bhv_vop_fsync(vp, FSYNC_WAIT, NULL, (xfs_off_t)0,(xfs_off_t)-1);
+	err = xfs_fsync(XFS_I(inode), FSYNC_WAIT, 0, -1);
 	if (!ret)
 		ret = err;
 	up_rw_sems(inode, DM_FLAGS_IMUX);
fs/xfs/dmapi/xfs_dm_bhv.c +8 -8
Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm_bhv.c
===================================================================
@@ -72,14 +72,14 @@ xfs_dm_mount(
 	error = bhv_vfs_root(vfsp, &rootvp);
 	if (error)
 		return error;
-	if (bhv_lookup_range(VN_BHV_HEAD(rootvp),
-			     VNODE_POSITION_XFS, VNODE_POSITION_XFS)) {
-		vfsp->vfs_flag |= VFS_DMI;
-		error = dm_send_mount_event(vfsp->vfs_super,
-				DM_RIGHT_NULL, NULL, DM_RIGHT_NULL,
-				vn_to_inode(rootvp),
-				DM_RIGHT_NULL, args->mtpt, args->fsname);
-	}
+
+
+	vfsp->vfs_flag |= VFS_DMI;
+	error = dm_send_mount_event(vfsp->vfs_super,
+			DM_RIGHT_NULL, NULL, DM_RIGHT_NULL,
+			vn_to_inode(rootvp),
+			DM_RIGHT_NULL, args->mtpt, args->fsname);
+
 	VN_RELE(rootvp);
 	if (error)
 		error = -error; /* DMAPI returns negative errs */
fs/xfs/dmapi/xfs_dm_fsops.c +4 -3
Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm_fsops.c
===================================================================
@@ -44,6 +44,7 @@
 #include "xfs_acl.h"
 #include "xfs_attr.h"
 #include "xfs_inode_item.h"
+#include "xfs_vnodeops.h"
 #include <dmapi.h>
 #include <dmapi_kern.h>
 #include "xfs_dm.h"
@@ -84,11 +85,11 @@ xfs_dm_fh_to_inode(
 
 STATIC int
 xfs_dm_inode_to_fh(
-	struct inode		*ip,
+	struct inode		*inode,
 	dm_fid_t		*dmfid,
 	dm_fsid_t		*dmfsid)
 {
-	bhv_vnode_t	*vp = vn_from_inode(ip);
+	bhv_vnode_t	*vp = vn_from_inode(inode);
 	int		error;
 	fid_t		fid;
 
@@ -96,7 +97,7 @@ xfs_dm_inode_to_fh(
 
 	if (vp->v_vfsp->vfs_altfsid == NULL)
 		return -EINVAL;
-	error = bhv_vop_fid2(vp, &fid);
+	error = xfs_fid2(XFS_I(inode), &fid);
 	if (error)
 		return -error; /* Return negative error to DMAPI */
 
fs/xfs/linux-2.6/xfs_ksyms.c +7 -2
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c
===================================================================
@@ -298,6 +298,13 @@ EXPORT_SYMBOL(xfs_read_buf);
 EXPORT_SYMBOL(xfs_rwlock);
 EXPORT_SYMBOL(xfs_rwunlock);
 EXPORT_SYMBOL(xfs_setattr);
+EXPORT_SYMBOL(xfs_fid2);
+EXPORT_SYMBOL(xfs_attr_get);
+EXPORT_SYMBOL(xfs_attr_set);
+EXPORT_SYMBOL(xfs_fsync);
+EXPORT_SYMBOL(xfs_attr_remove);
+EXPORT_SYMBOL(xfs_attr_list);
+EXPORT_SYMBOL(xfs_readdir);
 EXPORT_SYMBOL(xfs_setsize_buftarg);
 EXPORT_SYMBOL(xfs_syncsub);
 EXPORT_SYMBOL(xfs_sync_inodes);
@@ -326,8 +333,6 @@ EXPORT_SYMBOL(xfs_truncate_file);
 EXPORT_SYMBOL(xfs_unmount_flush);
 EXPORT_SYMBOL(xfs_unmountfs_writesb);
 EXPORT_SYMBOL(xfs_vfsops);
-EXPORT_SYMBOL(xfs_vnodeops);
-EXPORT_SYMBOL(xfs_vtoi);
 EXPORT_SYMBOL(xfs_write_clear_setuid);
 EXPORT_SYMBOL(xfs_dinode_from_disk);
 EXPORT_SYMBOL(xfs_sb_from_disk);
fs/xfs/xfsidbg.c +0 -3
Index: linux-2.6-xfs/fs/xfs/xfsidbg.c
===================================================================
@@ -1796,9 +1796,6 @@ static void printbhv(bhv_desc_t *bdp)
 static void	printvnode(bhv_vnode_t *vp, unsigned long addr)
 {
 	kdb_printf("vnode: 0x%lx\n", addr);
-	kdb_printf(" v_bh 0x%p\n", &vp->v_bh);
-
-	printbhv(VNHEAD(vp));
 
 	printflags((__psunsigned_t)vp->v_flag, tab_vflags, "flag =");
 	kdb_printf("\n");
fs/xfs/xfs_mount.h +0 -1
Index: linux-2.6-xfs/fs/xfs/xfs_mount.h
===================================================================
@@ -66,7 +66,6 @@ struct xfs_swapext;
 struct xfs_mru_cache;
 
 extern struct bhv_vfsops xfs_vfsops;
-extern struct bhv_vnodeops xfs_vnodeops;
 
 #define	AIL_LOCK_T		lock_t
 #define	AIL_LOCKINIT(x,y)	spinlock_init(x,y)