diff options
Diffstat (limited to 'fs/xfs/quota/xfs_qm.c')
-rw-r--r-- | fs/xfs/quota/xfs_qm.c | 57 |
1 files changed, 11 insertions, 46 deletions
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index df0ffef9775a..6b13960cf318 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include "xfs_bit.h" | 20 | #include "xfs_bit.h" |
21 | #include "xfs_log.h" | 21 | #include "xfs_log.h" |
22 | #include "xfs_inum.h" | 22 | #include "xfs_inum.h" |
23 | #include "xfs_clnt.h" | ||
24 | #include "xfs_trans.h" | 23 | #include "xfs_trans.h" |
25 | #include "xfs_sb.h" | 24 | #include "xfs_sb.h" |
26 | #include "xfs_ag.h" | 25 | #include "xfs_ag.h" |
@@ -396,13 +395,10 @@ xfs_qm_mount_quotas( | |||
396 | /* | 395 | /* |
397 | * Called from the vfsops layer. | 396 | * Called from the vfsops layer. |
398 | */ | 397 | */ |
399 | int | 398 | void |
400 | xfs_qm_unmount_quotas( | 399 | xfs_qm_unmount_quotas( |
401 | xfs_mount_t *mp) | 400 | xfs_mount_t *mp) |
402 | { | 401 | { |
403 | xfs_inode_t *uqp, *gqp; | ||
404 | int error = 0; | ||
405 | |||
406 | /* | 402 | /* |
407 | * Release the dquots that root inode, et al might be holding, | 403 | * Release the dquots that root inode, et al might be holding, |
408 | * before we flush quotas and blow away the quotainfo structure. | 404 | * before we flush quotas and blow away the quotainfo structure. |
@@ -415,43 +411,18 @@ xfs_qm_unmount_quotas( | |||
415 | xfs_qm_dqdetach(mp->m_rsumip); | 411 | xfs_qm_dqdetach(mp->m_rsumip); |
416 | 412 | ||
417 | /* | 413 | /* |
418 | * Flush out the quota inodes. | 414 | * Release the quota inodes. |
419 | */ | 415 | */ |
420 | uqp = gqp = NULL; | ||
421 | if (mp->m_quotainfo) { | 416 | if (mp->m_quotainfo) { |
422 | if ((uqp = mp->m_quotainfo->qi_uquotaip) != NULL) { | 417 | if (mp->m_quotainfo->qi_uquotaip) { |
423 | xfs_ilock(uqp, XFS_ILOCK_EXCL); | 418 | IRELE(mp->m_quotainfo->qi_uquotaip); |
424 | xfs_iflock(uqp); | 419 | mp->m_quotainfo->qi_uquotaip = NULL; |
425 | error = xfs_iflush(uqp, XFS_IFLUSH_SYNC); | ||
426 | xfs_iunlock(uqp, XFS_ILOCK_EXCL); | ||
427 | if (unlikely(error == EFSCORRUPTED)) { | ||
428 | XFS_ERROR_REPORT("xfs_qm_unmount_quotas(1)", | ||
429 | XFS_ERRLEVEL_LOW, mp); | ||
430 | goto out; | ||
431 | } | ||
432 | } | 420 | } |
433 | if ((gqp = mp->m_quotainfo->qi_gquotaip) != NULL) { | 421 | if (mp->m_quotainfo->qi_gquotaip) { |
434 | xfs_ilock(gqp, XFS_ILOCK_EXCL); | 422 | IRELE(mp->m_quotainfo->qi_gquotaip); |
435 | xfs_iflock(gqp); | 423 | mp->m_quotainfo->qi_gquotaip = NULL; |
436 | error = xfs_iflush(gqp, XFS_IFLUSH_SYNC); | ||
437 | xfs_iunlock(gqp, XFS_ILOCK_EXCL); | ||
438 | if (unlikely(error == EFSCORRUPTED)) { | ||
439 | XFS_ERROR_REPORT("xfs_qm_unmount_quotas(2)", | ||
440 | XFS_ERRLEVEL_LOW, mp); | ||
441 | goto out; | ||
442 | } | ||
443 | } | 424 | } |
444 | } | 425 | } |
445 | if (uqp) { | ||
446 | IRELE(uqp); | ||
447 | mp->m_quotainfo->qi_uquotaip = NULL; | ||
448 | } | ||
449 | if (gqp) { | ||
450 | IRELE(gqp); | ||
451 | mp->m_quotainfo->qi_gquotaip = NULL; | ||
452 | } | ||
453 | out: | ||
454 | return XFS_ERROR(error); | ||
455 | } | 426 | } |
456 | 427 | ||
457 | /* | 428 | /* |
@@ -987,14 +958,10 @@ xfs_qm_dqdetach( | |||
987 | } | 958 | } |
988 | 959 | ||
989 | /* | 960 | /* |
990 | * This is called by VFS_SYNC and flags arg determines the caller, | 961 | * This is called to sync quotas. We can be told to use non-blocking |
991 | * and its motives, as done in xfs_sync. | 962 | * semantics by either the SYNC_BDFLUSH flag or the absence of the |
992 | * | 963 | * SYNC_WAIT flag. |
993 | * vfs_sync: SYNC_FSDATA|SYNC_ATTR|SYNC_BDFLUSH 0x31 | ||
994 | * syscall sync: SYNC_FSDATA|SYNC_ATTR|SYNC_DELWRI 0x25 | ||
995 | * umountroot : SYNC_WAIT | SYNC_CLOSE | SYNC_ATTR | SYNC_FSDATA | ||
996 | */ | 964 | */ |
997 | |||
998 | int | 965 | int |
999 | xfs_qm_sync( | 966 | xfs_qm_sync( |
1000 | xfs_mount_t *mp, | 967 | xfs_mount_t *mp, |
@@ -1137,7 +1104,6 @@ xfs_qm_init_quotainfo( | |||
1137 | return error; | 1104 | return error; |
1138 | } | 1105 | } |
1139 | 1106 | ||
1140 | spin_lock_init(&qinf->qi_pinlock); | ||
1141 | xfs_qm_list_init(&qinf->qi_dqlist, "mpdqlist", 0); | 1107 | xfs_qm_list_init(&qinf->qi_dqlist, "mpdqlist", 0); |
1142 | qinf->qi_dqreclaims = 0; | 1108 | qinf->qi_dqreclaims = 0; |
1143 | 1109 | ||
@@ -1234,7 +1200,6 @@ xfs_qm_destroy_quotainfo( | |||
1234 | */ | 1200 | */ |
1235 | xfs_qm_rele_quotafs_ref(mp); | 1201 | xfs_qm_rele_quotafs_ref(mp); |
1236 | 1202 | ||
1237 | spinlock_destroy(&qi->qi_pinlock); | ||
1238 | xfs_qm_list_destroy(&qi->qi_dqlist); | 1203 | xfs_qm_list_destroy(&qi->qi_dqlist); |
1239 | 1204 | ||
1240 | if (qi->qi_uquotaip) { | 1205 | if (qi->qi_uquotaip) { |