diff options
author | Christoph Hellwig <hch@lst.de> | 2008-12-03 06:20:36 -0500 |
---|---|---|
committer | Niv Sardi <xaiki@sgi.com> | 2008-12-03 23:39:23 -0500 |
commit | e57481dc269cd3773b22f53bfb869308780a7bf1 (patch) | |
tree | 0f93e375521a9afc49a8b5e143a0cff1945fc365 /fs/xfs/quota | |
parent | 070c4616ec62fc207e2aeef9d0f28af294c651d0 (diff) |
no explicit xfs_iflush for special inodes during unmount
Currently we explicitly call xfs_iflush on the quota, real-time and root
inodes from xfs_unmount_flush. But we just called xfs_sync_inodes with
SYNC_ATTR and do an XFS_bflush aka xfs_flush_buftarg to make sure all inodes
are on disk already, so there is no need for these special cases.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Diffstat (limited to 'fs/xfs/quota')
-rw-r--r-- | fs/xfs/quota/xfs_qm.c | 44 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm.h | 2 |
2 files changed, 9 insertions, 37 deletions
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index 5b198d15e76b..6b13960cf318 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -395,13 +395,10 @@ xfs_qm_mount_quotas( | |||
395 | /* | 395 | /* |
396 | * Called from the vfsops layer. | 396 | * Called from the vfsops layer. |
397 | */ | 397 | */ |
398 | int | 398 | void |
399 | xfs_qm_unmount_quotas( | 399 | xfs_qm_unmount_quotas( |
400 | xfs_mount_t *mp) | 400 | xfs_mount_t *mp) |
401 | { | 401 | { |
402 | xfs_inode_t *uqp, *gqp; | ||
403 | int error = 0; | ||
404 | |||
405 | /* | 402 | /* |
406 | * Release the dquots that root inode, et al might be holding, | 403 | * Release the dquots that root inode, et al might be holding, |
407 | * before we flush quotas and blow away the quotainfo structure. | 404 | * before we flush quotas and blow away the quotainfo structure. |
@@ -414,43 +411,18 @@ xfs_qm_unmount_quotas( | |||
414 | xfs_qm_dqdetach(mp->m_rsumip); | 411 | xfs_qm_dqdetach(mp->m_rsumip); |
415 | 412 | ||
416 | /* | 413 | /* |
417 | * Flush out the quota inodes. | 414 | * Release the quota inodes. |
418 | */ | 415 | */ |
419 | uqp = gqp = NULL; | ||
420 | if (mp->m_quotainfo) { | 416 | if (mp->m_quotainfo) { |
421 | if ((uqp = mp->m_quotainfo->qi_uquotaip) != NULL) { | 417 | if (mp->m_quotainfo->qi_uquotaip) { |
422 | xfs_ilock(uqp, XFS_ILOCK_EXCL); | 418 | IRELE(mp->m_quotainfo->qi_uquotaip); |
423 | xfs_iflock(uqp); | 419 | mp->m_quotainfo->qi_uquotaip = NULL; |
424 | error = xfs_iflush(uqp, XFS_IFLUSH_SYNC); | ||
425 | xfs_iunlock(uqp, XFS_ILOCK_EXCL); | ||
426 | if (unlikely(error == EFSCORRUPTED)) { | ||
427 | XFS_ERROR_REPORT("xfs_qm_unmount_quotas(1)", | ||
428 | XFS_ERRLEVEL_LOW, mp); | ||
429 | goto out; | ||
430 | } | ||
431 | } | 420 | } |
432 | if ((gqp = mp->m_quotainfo->qi_gquotaip) != NULL) { | 421 | if (mp->m_quotainfo->qi_gquotaip) { |
433 | xfs_ilock(gqp, XFS_ILOCK_EXCL); | 422 | IRELE(mp->m_quotainfo->qi_gquotaip); |
434 | xfs_iflock(gqp); | 423 | mp->m_quotainfo->qi_gquotaip = NULL; |
435 | error = xfs_iflush(gqp, XFS_IFLUSH_SYNC); | ||
436 | xfs_iunlock(gqp, XFS_ILOCK_EXCL); | ||
437 | if (unlikely(error == EFSCORRUPTED)) { | ||
438 | XFS_ERROR_REPORT("xfs_qm_unmount_quotas(2)", | ||
439 | XFS_ERRLEVEL_LOW, mp); | ||
440 | goto out; | ||
441 | } | ||
442 | } | 424 | } |
443 | } | 425 | } |
444 | if (uqp) { | ||
445 | IRELE(uqp); | ||
446 | mp->m_quotainfo->qi_uquotaip = NULL; | ||
447 | } | ||
448 | if (gqp) { | ||
449 | IRELE(gqp); | ||
450 | mp->m_quotainfo->qi_gquotaip = NULL; | ||
451 | } | ||
452 | out: | ||
453 | return XFS_ERROR(error); | ||
454 | } | 426 | } |
455 | 427 | ||
456 | /* | 428 | /* |
diff --git a/fs/xfs/quota/xfs_qm.h b/fs/xfs/quota/xfs_qm.h index 4f2de9771728..ddf09166387c 100644 --- a/fs/xfs/quota/xfs_qm.h +++ b/fs/xfs/quota/xfs_qm.h | |||
@@ -167,7 +167,7 @@ extern void xfs_qm_destroy_quotainfo(xfs_mount_t *); | |||
167 | extern void xfs_qm_mount_quotas(xfs_mount_t *); | 167 | extern void xfs_qm_mount_quotas(xfs_mount_t *); |
168 | extern int xfs_qm_quotacheck(xfs_mount_t *); | 168 | extern int xfs_qm_quotacheck(xfs_mount_t *); |
169 | extern void xfs_qm_unmount_quotadestroy(xfs_mount_t *); | 169 | extern void xfs_qm_unmount_quotadestroy(xfs_mount_t *); |
170 | extern int xfs_qm_unmount_quotas(xfs_mount_t *); | 170 | extern void xfs_qm_unmount_quotas(xfs_mount_t *); |
171 | extern int xfs_qm_write_sb_changes(xfs_mount_t *, __int64_t); | 171 | extern int xfs_qm_write_sb_changes(xfs_mount_t *, __int64_t); |
172 | extern int xfs_qm_sync(xfs_mount_t *, int); | 172 | extern int xfs_qm_sync(xfs_mount_t *, int); |
173 | 173 | ||