aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2009-11-14 11:17:24 -0500
committerAlex Elder <aelder@sgi.com>2009-12-11 16:11:23 -0500
commit30ac0683dd452ba273c8db92a74d8cf7aef981d8 (patch)
tree656d403388b16d451c340a3b8ed0880296755016 /fs/xfs
parent0c3dc2b02a4996c13e26eb91296e8a309e0c6227 (diff)
xfs: cleanup dmapi macros in the umount path
Stop the flag saving as we never mangle those in the unmount path, and hide all the weird arguents to the dmapi code inside the XFS_SEND_PREUNMOUNT / XFS_SEND_UNMOUNT macros. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c22
-rw-r--r--fs/xfs/xfs_mount.h23
2 files changed, 21 insertions, 24 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 25b6903a3bce..1bfb0e980193 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -1131,8 +1131,6 @@ xfs_fs_put_super(
1131 struct super_block *sb) 1131 struct super_block *sb)
1132{ 1132{
1133 struct xfs_mount *mp = XFS_M(sb); 1133 struct xfs_mount *mp = XFS_M(sb);
1134 struct xfs_inode *rip = mp->m_rootip;
1135 int unmount_event_flags = 0;
1136 1134
1137 xfs_syncd_stop(mp); 1135 xfs_syncd_stop(mp);
1138 1136
@@ -1148,20 +1146,7 @@ xfs_fs_put_super(
1148 xfs_sync_attr(mp, 0); 1146 xfs_sync_attr(mp, 0);
1149 } 1147 }
1150 1148
1151#ifdef HAVE_DMAPI 1149 XFS_SEND_PREUNMOUNT(mp);
1152 if (mp->m_flags & XFS_MOUNT_DMAPI) {
1153 unmount_event_flags =
1154 (mp->m_dmevmask & (1 << DM_EVENT_UNMOUNT)) ?
1155 0 : DM_FLAGS_UNWANTED;
1156 /*
1157 * Ignore error from dmapi here, first unmount is not allowed
1158 * to fail anyway, and second we wouldn't want to fail a
1159 * unmount because of dmapi.
1160 */
1161 XFS_SEND_PREUNMOUNT(mp, rip, DM_RIGHT_NULL, rip, DM_RIGHT_NULL,
1162 NULL, NULL, 0, 0, unmount_event_flags);
1163 }
1164#endif
1165 1150
1166 /* 1151 /*
1167 * Blow away any referenced inode in the filestreams cache. 1152 * Blow away any referenced inode in the filestreams cache.
@@ -1172,10 +1157,7 @@ xfs_fs_put_super(
1172 1157
1173 XFS_bflush(mp->m_ddev_targp); 1158 XFS_bflush(mp->m_ddev_targp);
1174 1159
1175 if (mp->m_flags & XFS_MOUNT_DMAPI) { 1160 XFS_SEND_UNMOUNT(mp);
1176 XFS_SEND_UNMOUNT(mp, rip, DM_RIGHT_NULL, 0, 0,
1177 unmount_event_flags);
1178 }
1179 1161
1180 xfs_unmountfs(mp); 1162 xfs_unmountfs(mp);
1181 xfs_freesb(mp); 1163 xfs_freesb(mp);
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index 23bf246fa85a..1df7e4502967 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -93,6 +93,9 @@ typedef struct xfs_dmops {
93 xfs_send_unmount_t xfs_send_unmount; 93 xfs_send_unmount_t xfs_send_unmount;
94} xfs_dmops_t; 94} xfs_dmops_t;
95 95
96#define XFS_DMAPI_UNMOUNT_FLAGS(mp) \
97 (((mp)->m_dmevmask & (1 << DM_EVENT_UNMOUNT)) ? 0 : DM_FLAGS_UNWANTED)
98
96#define XFS_SEND_DATA(mp, ev,ip,off,len,fl,lock) \ 99#define XFS_SEND_DATA(mp, ev,ip,off,len,fl,lock) \
97 (*(mp)->m_dm_ops->xfs_send_data)(ev,ip,off,len,fl,lock) 100 (*(mp)->m_dm_ops->xfs_send_data)(ev,ip,off,len,fl,lock)
98#define XFS_SEND_MMAP(mp, vma,fl) \ 101#define XFS_SEND_MMAP(mp, vma,fl) \
@@ -101,12 +104,24 @@ typedef struct xfs_dmops {
101 (*(mp)->m_dm_ops->xfs_send_destroy)(ip,right) 104 (*(mp)->m_dm_ops->xfs_send_destroy)(ip,right)
102#define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \ 105#define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
103 (*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl) 106 (*(mp)->m_dm_ops->xfs_send_namesp)(ev,NULL,b1,r1,b2,r2,n1,n2,mode,rval,fl)
104#define XFS_SEND_PREUNMOUNT(mp,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
105 (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT,mp,b1,r1,b2,r2,n1,n2,mode,rval,fl)
106#define XFS_SEND_MOUNT(mp,right,path,name) \ 107#define XFS_SEND_MOUNT(mp,right,path,name) \
107 (*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name) 108 (*(mp)->m_dm_ops->xfs_send_mount)(mp,right,path,name)
108#define XFS_SEND_UNMOUNT(mp, ip,right,mode,rval,fl) \ 109#define XFS_SEND_PREUNMOUNT(mp) \
109 (*(mp)->m_dm_ops->xfs_send_unmount)(mp,ip,right,mode,rval,fl) 110do { \
111 if (mp->m_flags & XFS_MOUNT_DMAPI) { \
112 (*(mp)->m_dm_ops->xfs_send_namesp)(DM_EVENT_PREUNMOUNT, mp, \
113 (mp)->m_rootip, DM_RIGHT_NULL, \
114 (mp)->m_rootip, DM_RIGHT_NULL, \
115 NULL, NULL, 0, 0, XFS_DMAPI_UNMOUNT_FLAGS(mp)); \
116 } \
117} while (0)
118#define XFS_SEND_UNMOUNT(mp) \
119do { \
120 if (mp->m_flags & XFS_MOUNT_DMAPI) { \
121 (*(mp)->m_dm_ops->xfs_send_unmount)(mp, (mp)->m_rootip, \
122 DM_RIGHT_NULL, 0, 0, XFS_DMAPI_UNMOUNT_FLAGS(mp)); \
123 } \
124} while (0)
110 125
111 126
112#ifdef HAVE_PERCPU_SB 127#ifdef HAVE_PERCPU_SB