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 13/17 call common xfs vnode-level helpers directly and remove vnode operations

Also remove the now dead behavior code.

fs/xfs/Makefile-linux-2.6 +0 -2
Index: linux-2.6-xfs/fs/xfs/Makefile-linux-2.6
===================================================================
@@ -39,7 +39,6 @@ xfs-y				+= xfs_alloc.o \
 				   xfs_alloc_btree.o \
 				   xfs_attr.o \
 				   xfs_attr_leaf.o \
-				   xfs_behavior.o \
 				   xfs_bit.o \
 				   xfs_bmap.o \
 				   xfs_bmap_btree.o \
@@ -78,7 +77,6 @@ xfs-y				+= xfs_alloc.o \
 				   xfs_trans_item.o \
 				   xfs_utils.o \
 				   xfs_vfsops.o \
-				   xfs_vfsops_bhv.o \
 				   xfs_vnodeops.o \
 				   xfs_rw.o \
 				   xfs_dmops.o \
fs/xfs/dmapi/xfs_dm_fsops.c +4 -3
Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm_fsops.c
===================================================================
@@ -45,6 +45,7 @@
 #include "xfs_attr.h"
 #include "xfs_inode_item.h"
 #include "xfs_vnodeops.h"
+#include "xfs_vfsops.h"
 #include <dmapi.h>
 #include <dmapi_kern.h>
 #include "xfs_dm.h"
@@ -64,7 +65,7 @@ xfs_dm_fh_to_inode(
 	dm_fid_t		*dmfid)
 {
 	bhv_vnode_t	*vp = NULL;
-	bhv_vfs_t	*vfsp = vfs_from_sb(sb);
+	xfs_mount_t	*mp = XFS_M(sb);
 	int		error;
 	fid_t		fid;
 
@@ -73,10 +74,10 @@ xfs_dm_fh_to_inode(
 	*ip = NULL;
 	memcpy(&fid, dmfid, sizeof(*dmfid));
 	if (fid.fid_len) {	/* file object handle */
-		error = bhv_vfs_vget(vfsp, &vp, &fid);
+		error = xfs_vget(mp, &vp, &fid);
 	}
 	else {			/* filesystem handle */
-		error = bhv_vfs_root(vfsp, &vp);
+		error = xfs_root(mp, &vp);
 	}
 	if (vp && (error == 0))
 		*ip = vn_to_inode(vp);
fs/xfs/linux-2.6/xfs_export.c +2 -2
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_export.c
===================================================================
@@ -28,6 +28,7 @@
 #include "xfs_vnodeops.h"
 #include "xfs_bmap_btree.h"
 #include "xfs_inode.h"
+#include "xfs_vfsops.h"
 
 static struct dentry dotdot = { .d_name.name = "..", .d_name.len = 2, };
 
@@ -143,10 +144,9 @@ xfs_fs_get_dentry(
 	bhv_vnode_t		*vp;
 	struct inode		*inode;
 	struct dentry		*result;
-	bhv_vfs_t		*vfsp = vfs_from_sb(sb);
 	int			error;
 
-	error = bhv_vfs_vget(vfsp, &vp, (fid_t *)data);
+	error = xfs_vget(XFS_M(sb), &vp, (fid_t *)data);
 	if (error || vp == NULL)
 		return ERR_PTR(-ESTALE) ;
 
fs/xfs/linux-2.6/xfs_ksyms.c +5 -24
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c
===================================================================
@@ -65,6 +65,7 @@
 #include "xfs_iomap.h"
 #include "xfs_filestream.h"
 #include "xfs_vnodeops.h"
+#include "xfs_vfsops.h"
 #include "support/ktrace.h"
 
 
@@ -140,17 +141,6 @@ EXPORT_SYMBOL(xfs_get_buftarg_list);
 
 EXPORT_SYMBOL(assfail);
 EXPORT_SYMBOL(cmn_err);
-EXPORT_SYMBOL(bhv_base);
-EXPORT_SYMBOL(bhv_get_vfsops);
-EXPORT_SYMBOL(bhv_head_destroy);
-EXPORT_SYMBOL(bhv_insert);
-EXPORT_SYMBOL(bhv_insert_initial);
-EXPORT_SYMBOL(bhv_lookup_range);
-EXPORT_SYMBOL(bhv_module_init);
-EXPORT_SYMBOL(bhv_module_exit);
-EXPORT_SYMBOL(bhv_remove_vfsops);
-EXPORT_SYMBOL(bhv_remove_all_vfsops);
-EXPORT_SYMBOL(bhv_remove_not_first);
 EXPORT_SYMBOL(xfs_flush_pages);
 EXPORT_SYMBOL(xfs_flushinval_pages);
 EXPORT_SYMBOL(xfs_tosspages);
@@ -190,18 +180,6 @@ EXPORT_SYMBOL(uuid_getnodeuniq);
 EXPORT_SYMBOL(uuid_hash64);
 EXPORT_SYMBOL(uuid_is_nil);
 EXPORT_SYMBOL(uuid_table_remove);
-EXPORT_SYMBOL(vfs_mount);
-EXPORT_SYMBOL(vfs_parseargs);
-EXPORT_SYMBOL(vfs_showargs);
-EXPORT_SYMBOL(vfs_unmount);
-EXPORT_SYMBOL(vfs_mntupdate);
-EXPORT_SYMBOL(vfs_root);
-EXPORT_SYMBOL(vfs_statvfs);
-EXPORT_SYMBOL(vfs_sync);
-EXPORT_SYMBOL(vfs_vget);
-EXPORT_SYMBOL(vfs_get_inode);
-EXPORT_SYMBOL(vfs_init_vnode);
-EXPORT_SYMBOL(vfs_force_shutdown);
 EXPORT_SYMBOL(vfs_from_sb);
 EXPORT_SYMBOL(vn_hold);
 EXPORT_SYMBOL(vn_initialize);
@@ -330,7 +308,6 @@ EXPORT_SYMBOL(xfs_trans_unlocked_item);
 EXPORT_SYMBOL(xfs_truncate_file);
 EXPORT_SYMBOL(xfs_unmount_flush);
 EXPORT_SYMBOL(xfs_unmountfs_writesb);
-EXPORT_SYMBOL(xfs_vfsops);
 EXPORT_SYMBOL(xfs_write_clear_setuid);
 EXPORT_SYMBOL(xfs_dinode_from_disk);
 EXPORT_SYMBOL(xfs_sb_from_disk);
@@ -338,3 +315,7 @@ EXPORT_SYMBOL(xfs_zero_eof);
 EXPORT_SYMBOL(xlog_recover_process_iunlinks);
 EXPORT_SYMBOL(xfs_ichgtime_fast);
 EXPORT_SYMBOL(xfs_free_eofblocks);
+
+EXPORT_SYMBOL(xfs_do_force_shutdown);
+EXPORT_SYMBOL(xfs_vget);
+EXPORT_SYMBOL(xfs_root);
fs/xfs/linux-2.6/xfs_linux.h +0 -1
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_linux.h
===================================================================
@@ -83,7 +83,6 @@
 #include <asm/byteorder.h>
 #include <asm/unaligned.h>
 
-#include <xfs_behavior.h>
 #include <xfs_vfs.h>
 #include <xfs_cred.h>
 #include <xfs_vnode.h>
fs/xfs/linux-2.6/xfs_lrw.h +0 -1
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.h
===================================================================
@@ -18,7 +18,6 @@
 #ifndef __XFS_LRW_H__
 #define __XFS_LRW_H__
 
-struct bhv_desc;
 struct xfs_mount;
 struct xfs_iocore;
 struct xfs_inode;
fs/xfs/linux-2.6/xfs_super.c +28 -37

182 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_vfs.c +0 -356

373 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_vfs.h +2 -138

172 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_vnode.c +1 -3
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c
===================================================================
@@ -76,10 +76,8 @@ vn_ioerror(
 	char		*f,
 	int		l)
 {
-	bhv_vfs_t	*vfsp = XFS_MTOVFS(ip->i_mount);
-
 	if (unlikely(error == -ENODEV))
-		bhv_vfs_force_shutdown(vfsp, SHUTDOWN_DEVICE_REQ, f, l);
+		xfs_do_force_shutdown(ip->i_mount, SHUTDOWN_DEVICE_REQ, f, l);
 }
 
 bhv_vnode_t *
fs/xfs/xfs_behavior.c deleted +0 -183

183 lines not on this page · raw message

fs/xfs/xfs_behavior.h deleted +0 -188

188 lines not on this page · raw message

fs/xfs/xfs_iget.c +3 -3
Index: linux-2.6-xfs/fs/xfs/xfs_iget.c
===================================================================
@@ -353,8 +353,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, ip, 1);
-
+	xfs_initialize_vnode(mp, vp, ip);
 	return 0;
 }
 
@@ -380,7 +379,8 @@ xfs_iget(
 	XFS_STATS_INC(xs_ig_attempts);
 
 retry:
-	if ((inode = bhv_vfs_get_inode(XFS_MTOVFS(mp), ino, 0))) {
+	inode = iget_locked(XFS_MTOVFS(mp)->vfs_super, ino);
+	if (inode) {
 		xfs_inode_t	*ip;
 
 		vp = vn_from_inode(inode);
fs/xfs/xfs_mount.c +2 -10
Index: linux-2.6-xfs/fs/xfs/xfs_mount.c
===================================================================
@@ -157,8 +157,7 @@ xfs_mount_init(void)
  */
 void
 xfs_mount_free(
-	xfs_mount_t	*mp,
-	int		remove_bhv)
+	xfs_mount_t	*mp)
 {
 	if (mp->m_perag) {
 		int	agno;
@@ -186,13 +185,6 @@ xfs_mount_free(
 	if (mp->m_logname != NULL)
 		kmem_free(mp->m_logname, strlen(mp->m_logname) + 1);
 
-	if (remove_bhv) {
-		struct bhv_vfs	*vfsp = XFS_MTOVFS(mp);
-
-		bhv_remove_all_vfsops(vfsp, 0);
-		VFS_REMOVEBHV(vfsp, &mp->m_bhv);
-	}
-
 	xfs_icsb_destroy_counters(mp);
 }
 
@@ -1284,7 +1276,7 @@ xfs_unmountfs(xfs_mount_t *mp, struct cr
 	xfs_errortag_clearall_umount(fsid, mp->m_fsname, 0);
 #endif
 	XFS_IODONE(vfsp);
-	xfs_mount_free(mp, 1);
+	xfs_mount_free(mp);
 	return 0;
 }
 
fs/xfs/xfs_mount.h +7 -14
Index: linux-2.6-xfs/fs/xfs/xfs_mount.h
===================================================================
@@ -64,8 +64,6 @@ struct xfs_extdelta;
 struct xfs_swapext;
 struct xfs_mru_cache;
 
-extern struct bhv_vfsops xfs_vfsops;
-
 #define	AIL_LOCK_T		lock_t
 #define	AIL_LOCKINIT(x,y)	spinlock_init(x,y)
 #define	AIL_LOCK_DESTROY(x)	spinlock_destroy(x)
@@ -330,7 +328,7 @@ extern void	xfs_icsb_sync_counters_flags
 #endif
 
 typedef struct xfs_mount {
-	bhv_desc_t		m_bhv;		/* vfs xfs behavior */
+	struct bhv_vfs		*m_vfsp;
 	xfs_tid_t		m_tid;		/* next unused tid for fs */
 	AIL_LOCK_T		m_ail_lock;	/* fs AIL mutex */
 	xfs_ail_entry_t		m_ail;		/* fs active log item list */
@@ -527,8 +525,10 @@ xfs_preferred_iosize(xfs_mount_t *mp)
 #define XFS_LAST_UNMOUNT_WAS_CLEAN(mp)	\
 				((mp)->m_flags & XFS_MOUNT_WAS_CLEAN)
 #define XFS_FORCED_SHUTDOWN(mp)	((mp)->m_flags & XFS_MOUNT_FS_SHUTDOWN)
+void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
+		int lnnum);
 #define xfs_force_shutdown(m,f)	\
-	bhv_vfs_force_shutdown((XFS_MTOVFS(m)), f, __FILE__, __LINE__)
+	xfs_do_force_shutdown(m, f, __FILE__, __LINE__)
 
 /*
  * Flags for xfs_mountfs
@@ -548,20 +548,13 @@ xfs_preferred_iosize(xfs_mount_t *mp)
 #define	XFS_MTOVFS(mp)		xfs_mtovfs(mp)
 static inline struct bhv_vfs *xfs_mtovfs(xfs_mount_t *mp)
 {
-	return bhvtovfs(&mp->m_bhv);
-}
-
-#define	XFS_BHVTOM(bdp)	xfs_bhvtom(bdp)
-static inline xfs_mount_t *xfs_bhvtom(bhv_desc_t *bdp)
-{
-	return (xfs_mount_t *)BHV_PDATA(bdp);
+	return mp->m_vfsp;
 }
 
 #define XFS_VFSTOM(vfs) xfs_vfstom(vfs)
 static inline xfs_mount_t *xfs_vfstom(bhv_vfs_t *vfs)
 {
-	return XFS_BHVTOM(bhv_lookup_range(VFS_BHVHEAD(vfs),
-				VFS_POSITION_XFS, VFS_POSITION_XFS));
+	return vfs->vfs_mount;
 }
 
 #define XFS_DADDR_TO_AGNO(mp,d)         xfs_daddr_to_agno(mp,d)
@@ -633,7 +626,7 @@ typedef struct xfs_mod_sb {
 extern xfs_mount_t *xfs_mount_init(void);
 extern void	xfs_mod_sb(xfs_trans_t *, __int64_t);
 extern int	xfs_log_sbcount(xfs_mount_t *, uint);
-extern void	xfs_mount_free(xfs_mount_t *mp, int remove_bhv);
+extern void	xfs_mount_free(xfs_mount_t *mp);
 extern int	xfs_mountfs(struct bhv_vfs *, xfs_mount_t *mp, int);
 extern void	xfs_mountfs_check_barriers(xfs_mount_t *mp);
 
fs/xfs/xfs_vfsops.c +2 -7
Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c
===================================================================
@@ -439,7 +439,6 @@ xfs_mount(
 	cred_t			*credp)
 {
 	struct bhv_vfs		*vfsp = XFS_MTOVFS(mp);
-	struct bhv_desc		*p;
 	struct block_device	*ddev, *logdev, *rtdev;
 	int			flags = 0, error;
 
@@ -453,11 +452,7 @@ xfs_mount(
 	if (error)
 		return error;
 
-	/*
-	 * Setup xfs_mount function vectors from available behaviors
-	 */
-	p = vfs_bhv_lookup(vfsp, VFS_POSITION_IO);
-	mp->m_io_ops = p ? *(xfs_ioops_t *) vfs_bhv_custom(p) : xfs_iocore_xfs;
+	mp->m_io_ops = xfs_iocore_xfs;
 
 	if (args->flags & XFSMNT_QUIET)
 		flags |= XFS_MFSI_QUIET;
@@ -740,7 +735,7 @@ xfs_mntupdate(
 		}
 	} else if (!(vfsp->vfs_flag & VFS_RDONLY)) {	/* rw -> ro */
 		xfs_filestream_flush(mp);
-		bhv_vfs_sync(vfsp, SYNC_DATA_QUIESCE, NULL);
+		xfs_sync(mp, SYNC_DATA_QUIESCE);
 		xfs_attr_quiesce(mp);
 		vfsp->vfs_flag |= VFS_RDONLY;
 	}
fs/xfs/xfs_vfsops.h +0 -3
Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.h
===================================================================
@@ -24,8 +24,5 @@ int xfs_showargs(struct xfs_mount *mp, s
 void xfs_freeze(struct xfs_mount *mp);
 void xfs_do_force_shutdown(struct xfs_mount *mp, int flags, char *fname,
 		int lnnum);
-struct inode *xfs_get_inode(struct xfs_mount *mp, xfs_ino_t ino, int flags);
-void xfs_initialize_vnode(struct xfs_mount *mp, bhv_vnode_t *vp,
-		struct xfs_inode *ip, int unlock);
 
 #endif /* _XFS_VFSOPS_H */
fs/xfs/xfs_vfsops_bhv.c deleted +0 -143

143 lines not on this page · raw message

fs/xfs/xfsidbg.c +0 -54

72 lines not on this page · raw message

fs/xfs/linux-2.6/xfs_super.h +3 -0
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.h
===================================================================
@@ -76,6 +76,9 @@ struct block_device;
 
 extern __uint64_t xfs_max_file_offset(unsigned int);
 
+extern void xfs_initialize_vnode(struct xfs_mount *mp, bhv_vnode_t *vp,
+		struct xfs_inode *ip);
+
 extern void xfs_flush_inode(struct xfs_inode *);
 extern void xfs_flush_device(struct xfs_inode *);
 
fs/xfs/xfs_inode.c +1 -1
Index: linux-2.6-xfs/fs/xfs/xfs_inode.c
===================================================================
@@ -1272,7 +1272,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, ip, 1);
+	xfs_initialize_vnode(tp->t_mountp, vp, ip);
 
 	*ipp = ip;
 	return 0;