diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2024-06-07 02:11:12 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2024-06-08 02:34:40 +0200 |
commit | 2aedfe847b4d91eabee11a44c27244055cef4eb3 (patch) | |
tree | 30d35fb99f4a63787c8d8b84317d39c42aab1674 /fs/gfs2/quota.c | |
parent | gfs2: Check quota consistency on mount (diff) | |
download | linux-2aedfe847b4d91eabee11a44c27244055cef4eb3.tar.xz linux-2aedfe847b4d91eabee11a44c27244055cef4eb3.zip |
gfs2: Revert "introduce qd_bh_get_or_undo"
The qd_bh_get_or_undo() helper introduced by that commit doesn't improve
the code much, so revert it and clean things up in a more useful way in
the next commit.
This reverts commit 7dbc6ae60dd7089d8ed42892b6a66c138f0aa7a0.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | fs/gfs2/quota.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 2984eaafdf6f..e0840b412d28 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -491,20 +491,6 @@ static int qd_check_sync(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd, return 1; } -static int qd_bh_get_or_undo(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd) -{ - int error; - - error = bh_get(qd); - if (!error) - return 0; - - clear_bit(QDF_LOCKED, &qd->qd_flags); - slot_put(qd); - qd_put(qd); - return error; -} - static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp) { struct gfs2_quota_data *qd = NULL, *iter; @@ -527,12 +513,17 @@ static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp) spin_unlock(&qd_lock); if (qd) { - error = qd_bh_get_or_undo(sdp, qd); - if (error) + error = bh_get(qd); + if (error) { + clear_bit(QDF_LOCKED, &qd->qd_flags); + slot_put(qd); + qd_put(qd); return error; - *qdp = qd; + } } + *qdp = qd; + return 0; } @@ -1189,8 +1180,15 @@ void gfs2_quota_unlock(struct gfs2_inode *ip) if (!found) continue; - if (!qd_bh_get_or_undo(sdp, qd)) - qda[count++] = qd; + gfs2_assert_warn(sdp, qd->qd_change_sync); + if (bh_get(qd)) { + clear_bit(QDF_LOCKED, &qd->qd_flags); + slot_put(qd); + qd_put(qd); + continue; + } + + qda[count++] = qd; } if (count) { |