summaryrefslogtreecommitdiff
path: root/fs/gfs2
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2023-06-16 12:36:51 -0500
committerAndreas Gruenbacher <agruenba@redhat.com>2023-09-05 15:58:18 +0200
commita4d22e337d022d7bb8da25c18629bac2af24ec81 (patch)
treeffa47d5bbe7e76b0ab4207be4df33a33ffe66590 /fs/gfs2
parent03d468f1c0469707086f260d4544a2552c7bfa6e (diff)
gfs2: move qdsb_put and reduce redundancy
This patch looks more invasive than it is. It simply moves function qdsb_put before qd_unlock, then changes qd_unlock to call it rather than open coding it. Again, this reduces redundancy. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/quota.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index 9be210f3dbd8..21100feb1db7 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -509,15 +509,20 @@ static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp)
return 0;
}
-static void qd_unlock(struct gfs2_quota_data *qd)
+static void qdsb_put(struct gfs2_quota_data *qd)
{
- gfs2_assert_warn(qd->qd_sbd, test_bit(QDF_LOCKED, &qd->qd_flags));
- clear_bit(QDF_LOCKED, &qd->qd_flags);
bh_put(qd);
slot_put(qd);
qd_put(qd);
}
+static void qd_unlock(struct gfs2_quota_data *qd)
+{
+ gfs2_assert_warn(qd->qd_sbd, test_bit(QDF_LOCKED, &qd->qd_flags));
+ clear_bit(QDF_LOCKED, &qd->qd_flags);
+ qdsb_put(qd);
+}
+
static int qdsb_get(struct gfs2_sbd *sdp, struct kqid qid,
struct gfs2_quota_data **qdp)
{
@@ -544,13 +549,6 @@ fail:
return error;
}
-static void qdsb_put(struct gfs2_quota_data *qd)
-{
- bh_put(qd);
- slot_put(qd);
- qd_put(qd);
-}
-
/**
* gfs2_qa_get - make sure we have a quota allocations data structure,
* if necessary