diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-12-06 16:58:25 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2011-12-15 15:38:30 -0500 |
commit | 7ae4440723a413c7a52edd27f654c34680dd4ea2 (patch) | |
tree | 14ec4a743f812d84a00177f7df20f832cd428e62 /fs/xfs/xfs_qm.c | |
parent | 97e7ade506cdd7157d8b64c77696c082fb997476 (diff) |
xfs: remove XFS_QMOPT_DQSUSER
Just read the id 0 dquot from disk directly in xfs_qm_init_quotainfo instead
of going through dqget and requiring a special flag to not add the dquot to
any lists.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_qm.c')
-rw-r--r-- | fs/xfs/xfs_qm.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index cd7460ba4e69..b8df0bda5a54 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c | |||
@@ -858,18 +858,21 @@ xfs_qm_init_quotainfo( | |||
858 | /* | 858 | /* |
859 | * We try to get the limits from the superuser's limits fields. | 859 | * We try to get the limits from the superuser's limits fields. |
860 | * This is quite hacky, but it is standard quota practice. | 860 | * This is quite hacky, but it is standard quota practice. |
861 | * | ||
861 | * We look at the USR dquot with id == 0 first, but if user quotas | 862 | * We look at the USR dquot with id == 0 first, but if user quotas |
862 | * are not enabled we goto the GRP dquot with id == 0. | 863 | * are not enabled we goto the GRP dquot with id == 0. |
863 | * We don't really care to keep separate default limits for user | 864 | * We don't really care to keep separate default limits for user |
864 | * and group quotas, at least not at this point. | 865 | * and group quotas, at least not at this point. |
866 | * | ||
867 | * Since we may not have done a quotacheck by this point, just read | ||
868 | * the dquot without attaching it to any hashtables or lists. | ||
865 | */ | 869 | */ |
866 | error = xfs_qm_dqget(mp, NULL, (xfs_dqid_t)0, | 870 | error = xfs_qm_dqread(mp, 0, |
867 | XFS_IS_UQUOTA_RUNNING(mp) ? XFS_DQ_USER : | 871 | XFS_IS_UQUOTA_RUNNING(mp) ? XFS_DQ_USER : |
868 | (XFS_IS_GQUOTA_RUNNING(mp) ? XFS_DQ_GROUP : | 872 | (XFS_IS_GQUOTA_RUNNING(mp) ? XFS_DQ_GROUP : |
869 | XFS_DQ_PROJ), | 873 | XFS_DQ_PROJ), |
870 | XFS_QMOPT_DQSUSER|XFS_QMOPT_DOWARN, | 874 | XFS_QMOPT_DOWARN, &dqp); |
871 | &dqp); | 875 | if (!error) { |
872 | if (! error) { | ||
873 | xfs_disk_dquot_t *ddqp = &dqp->q_core; | 876 | xfs_disk_dquot_t *ddqp = &dqp->q_core; |
874 | 877 | ||
875 | /* | 878 | /* |
@@ -896,11 +899,6 @@ xfs_qm_init_quotainfo( | |||
896 | qinf->qi_rtbhardlimit = be64_to_cpu(ddqp->d_rtb_hardlimit); | 899 | qinf->qi_rtbhardlimit = be64_to_cpu(ddqp->d_rtb_hardlimit); |
897 | qinf->qi_rtbsoftlimit = be64_to_cpu(ddqp->d_rtb_softlimit); | 900 | qinf->qi_rtbsoftlimit = be64_to_cpu(ddqp->d_rtb_softlimit); |
898 | 901 | ||
899 | /* | ||
900 | * We sent the XFS_QMOPT_DQSUSER flag to dqget because | ||
901 | * we don't want this dquot cached. We haven't done a | ||
902 | * quotacheck yet, and quotacheck doesn't like incore dquots. | ||
903 | */ | ||
904 | xfs_qm_dqdestroy(dqp); | 902 | xfs_qm_dqdestroy(dqp); |
905 | } else { | 903 | } else { |
906 | qinf->qi_btimelimit = XFS_QM_BTIMELIMIT; | 904 | qinf->qi_btimelimit = XFS_QM_BTIMELIMIT; |