diff options
author | Nathan Scott <nathans@sgi.com> | 2006-06-09 03:11:55 -0400 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-06-09 03:11:55 -0400 |
commit | 34327e138481137a81a2e33060b8eb0944013801 (patch) | |
tree | d78521e82598c0b1aae46e466f38a5fa99a2b842 | |
parent | 8285fb58e75bfdb447c7a2c533ec9efdb238f966 (diff) |
[XFS] Cleanup a missed porting conversion, and freezing.
SGI-PV: 953338
SGI-Modid: xfs-linux-melb:xfs-kern:26109a
Signed-off-by: Nathan Scott <nathans@sgi.com>
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 4 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vfs.h | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_log.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_trans.c | 17 |
4 files changed, 11 insertions, 19 deletions
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 8696096f8d22..3e76c5c9dda1 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -668,11 +668,11 @@ xfs_write( | |||
668 | io = &xip->i_iocore; | 668 | io = &xip->i_iocore; |
669 | mp = io->io_mount; | 669 | mp = io->io_mount; |
670 | 670 | ||
671 | vfs_wait_for_freeze(vp->v_vfsp, SB_FREEZE_WRITE); | ||
672 | |||
671 | if (XFS_FORCED_SHUTDOWN(mp)) | 673 | if (XFS_FORCED_SHUTDOWN(mp)) |
672 | return -EIO; | 674 | return -EIO; |
673 | 675 | ||
674 | fs_check_frozen(vp->v_vfsp, SB_FREEZE_WRITE); | ||
675 | |||
676 | if (ioflags & IO_ISDIRECT) { | 676 | if (ioflags & IO_ISDIRECT) { |
677 | xfs_buftarg_t *target = | 677 | xfs_buftarg_t *target = |
678 | (xip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? | 678 | (xip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? |
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h index 7b88eeae0f26..91fc2c4b3353 100644 --- a/fs/xfs/linux-2.6/xfs_vfs.h +++ b/fs/xfs/linux-2.6/xfs_vfs.h | |||
@@ -190,6 +190,9 @@ extern void vfs_init_vnode(bhv_desc_t *, struct bhv_vnode *, bhv_desc_t *, int); | |||
190 | extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int); | 190 | extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int); |
191 | extern void vfs_freeze(bhv_desc_t *); | 191 | extern void vfs_freeze(bhv_desc_t *); |
192 | 192 | ||
193 | #define vfs_test_for_freeze(vfs) ((vfs)->vfs_super->s_frozen) | ||
194 | #define vfs_wait_for_freeze(vfs,l) vfs_check_frozen((vfs)->vfs_super, (l)) | ||
195 | |||
193 | typedef struct bhv_module_vfsops { | 196 | typedef struct bhv_module_vfsops { |
194 | struct bhv_vfsops bhv_common; | 197 | struct bhv_vfsops bhv_common; |
195 | void * bhv_custom; | 198 | void * bhv_custom; |
@@ -211,8 +214,4 @@ extern void bhv_insert_all_vfsops(struct bhv_vfs *); | |||
211 | extern void bhv_remove_all_vfsops(struct bhv_vfs *, int); | 214 | extern void bhv_remove_all_vfsops(struct bhv_vfs *, int); |
212 | extern void bhv_remove_vfsops(struct bhv_vfs *, int); | 215 | extern void bhv_remove_vfsops(struct bhv_vfs *, int); |
213 | 216 | ||
214 | #define fs_frozen(vfsp) ((vfsp)->vfs_super->s_frozen) | ||
215 | #define fs_check_frozen(vfsp, level) \ | ||
216 | vfs_check_frozen(vfsp->vfs_super, level); | ||
217 | |||
218 | #endif /* __XFS_VFS_H__ */ | 217 | #endif /* __XFS_VFS_H__ */ |
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 9f70ab3e0983..95d679cd4e75 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -817,7 +817,7 @@ xfs_log_need_covered(xfs_mount_t *mp) | |||
817 | xlog_t *log = mp->m_log; | 817 | xlog_t *log = mp->m_log; |
818 | bhv_vfs_t *vfsp = XFS_MTOVFS(mp); | 818 | bhv_vfs_t *vfsp = XFS_MTOVFS(mp); |
819 | 819 | ||
820 | if (fs_frozen(vfsp) || XFS_FORCED_SHUTDOWN(mp) || | 820 | if (vfs_test_for_freeze(vfsp) || XFS_FORCED_SHUTDOWN(mp) || |
821 | (vfsp->vfs_flag & VFS_RDONLY)) | 821 | (vfsp->vfs_flag & VFS_RDONLY)) |
822 | return 0; | 822 | return 0; |
823 | 823 | ||
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 7a99ed3b187f..39f0b1ed3224 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c | |||
@@ -236,11 +236,8 @@ xfs_trans_alloc( | |||
236 | xfs_mount_t *mp, | 236 | xfs_mount_t *mp, |
237 | uint type) | 237 | uint type) |
238 | { | 238 | { |
239 | fs_check_frozen(XFS_MTOVFS(mp), SB_FREEZE_TRANS); | 239 | vfs_wait_for_freeze(XFS_MTOVFS(mp), SB_FREEZE_TRANS); |
240 | atomic_inc(&mp->m_active_trans); | 240 | return _xfs_trans_alloc(mp, type); |
241 | |||
242 | return (_xfs_trans_alloc(mp, type)); | ||
243 | |||
244 | } | 241 | } |
245 | 242 | ||
246 | xfs_trans_t * | 243 | xfs_trans_t * |
@@ -250,12 +247,9 @@ _xfs_trans_alloc( | |||
250 | { | 247 | { |
251 | xfs_trans_t *tp; | 248 | xfs_trans_t *tp; |
252 | 249 | ||
253 | ASSERT(xfs_trans_zone != NULL); | 250 | atomic_inc(&mp->m_active_trans); |
254 | tp = kmem_zone_zalloc(xfs_trans_zone, KM_SLEEP); | ||
255 | 251 | ||
256 | /* | 252 | tp = kmem_zone_zalloc(xfs_trans_zone, KM_SLEEP); |
257 | * Initialize the transaction structure. | ||
258 | */ | ||
259 | tp->t_magic = XFS_TRANS_MAGIC; | 253 | tp->t_magic = XFS_TRANS_MAGIC; |
260 | tp->t_type = type; | 254 | tp->t_type = type; |
261 | tp->t_mountp = mp; | 255 | tp->t_mountp = mp; |
@@ -263,8 +257,7 @@ _xfs_trans_alloc( | |||
263 | tp->t_busy_free = XFS_LBC_NUM_SLOTS; | 257 | tp->t_busy_free = XFS_LBC_NUM_SLOTS; |
264 | XFS_LIC_INIT(&(tp->t_items)); | 258 | XFS_LIC_INIT(&(tp->t_items)); |
265 | XFS_LBC_INIT(&(tp->t_busy)); | 259 | XFS_LBC_INIT(&(tp->t_busy)); |
266 | 260 | return tp; | |
267 | return (tp); | ||
268 | } | 261 | } |
269 | 262 | ||
270 | /* | 263 | /* |