Skip to contentSkip to conversation

decontaminate vfs operations from behavior details

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

lore
Share & tools
lore
#0 lore raw

PATCH 12/17 decontaminate vfs operations from behavior details

All vfs ops now take struct xfs_mount pointers and the behaviour related glue is split out into methods of it's own.

fs/xfs/Makefile-linux-2.6 +1 -0
Index: linux-2.6-xfs/fs/xfs/Makefile-linux-2.6
===================================================================
@@ -78,6 +78,7 @@ 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/linux-2.6/xfs_super.c +4 -4
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c
===================================================================
@@ -202,7 +202,7 @@ xfs_revalidate_inode(
 
 void
 xfs_initialize_vnode(
-	bhv_desc_t		*bdp,
+	struct xfs_mount	*mp,
 	bhv_vnode_t		*vp,
 	struct xfs_inode	*ip,
 	int			unlock)
@@ -222,7 +222,7 @@ xfs_initialize_vnode(
 	 * finish our work.
 	 */
 	if (ip->i_d.di_mode != 0 && unlock && (inode->i_state & I_NEW)) {
-		xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip);
+		xfs_revalidate_inode(mp, vp, ip);
 		xfs_set_inodeops(inode);
 
 		xfs_iflags_clear(ip, XFS_INEW);
@@ -234,11 +234,11 @@ xfs_initialize_vnode(
 
 struct inode *
 xfs_get_inode(
-	bhv_desc_t	*bdp,
+	xfs_mount_t	*mp,
 	xfs_ino_t	ino,
 	int		flags)
 {
-	return iget_locked(bhvtovfs(bdp)->vfs_super, ino);
+	return iget_locked(XFS_MTOVFS(mp)->vfs_super, ino);
 }
 
 int
fs/xfs/linux-2.6/xfs_super.h +0 -3
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.h
===================================================================
@@ -76,9 +76,6 @@ 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 *, struct xfs_inode *, int);
-
 extern void xfs_flush_inode(struct xfs_inode *);
 extern void xfs_flush_device(struct xfs_inode *);
 
fs/xfs/xfs_mount.h +0 -1
Index: linux-2.6-xfs/fs/xfs/xfs_mount.h
===================================================================
@@ -650,7 +650,6 @@ extern struct xfs_buf *xfs_getsb(xfs_mou
 extern int	xfs_readsb(xfs_mount_t *, int);
 extern void	xfs_freesb(xfs_mount_t *);
 extern int	xfs_fs_writable(xfs_mount_t *);
-extern void	xfs_do_force_shutdown(bhv_desc_t *, int, char *, int);
 extern int	xfs_syncsub(xfs_mount_t *, int, int *);
 extern int	xfs_sync_inodes(xfs_mount_t *, int, int *);
 extern xfs_agnumber_t	xfs_initialize_perag(struct bhv_vfs *, xfs_mount_t *,
fs/xfs/xfs_rw.c +1 -4
Index: linux-2.6-xfs/fs/xfs/xfs_rw.c
===================================================================
@@ -178,18 +178,15 @@ xfs_write_sync_logforce(
  * the shop, make sure that absolutely nothing persistent happens to
  * this filesystem after this point.
  */
-
 void
 xfs_do_force_shutdown(
-	bhv_desc_t	*bdp,
+	xfs_mount_t	*mp,
 	int		flags,
 	char		*fname,
 	int		lnnum)
 {
 	int		logerror;
-	xfs_mount_t	*mp;
 
-	mp = XFS_BHVTOM(bdp);
 	logerror = flags & SHUTDOWN_LOG_IO_ERROR;
 
 	if (!(flags & SHUTDOWN_FORCE_UMOUNT)) {
fs/xfs/xfs_vfsops.c +28 -60

209 lines not on this page · raw message

fs/xfs/xfs_vfsops.h new file +31 -0
Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.h
===================================================================
@@ -0,0 +1,31 @@
+#ifndef _XFS_VFSOPS_H
+#define _XFS_VFSOPS_H 1
+
+struct cred;
+struct fid;
+struct inode;
+struct kstatfs;
+struct xfs_mount;
+struct xfs_mount_args;
+
+int xfs_mount(struct xfs_mount *mp, struct xfs_mount_args *args,
+		struct cred *credp);
+int xfs_unmount(struct xfs_mount *mp, int flags, struct cred *credp);
+int xfs_mntupdate(struct xfs_mount *mp, int *flags,
+		struct xfs_mount_args *args);
+int xfs_root(struct xfs_mount *mp, bhv_vnode_t **vpp);
+int xfs_statvfs(struct xfs_mount *mp, struct kstatfs *statp,
+		bhv_vnode_t *vp);
+int xfs_sync(struct xfs_mount *mp, int flags);
+int xfs_vget(struct xfs_mount *mp, bhv_vnode_t **vpp, struct fid *fidp);
+int xfs_parseargs(struct xfs_mount *mp, char *options,
+		struct xfs_mount_args *args, int update);
+int xfs_showargs(struct xfs_mount *mp, struct seq_file *m);
+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 new file +143 -0

143 lines not on this page · raw message