Skip to content

Commit a4d22e3

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
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 <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 03d468f commit a4d22e3

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

fs/gfs2/quota.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -509,15 +509,20 @@ static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp)
509509
return 0;
510510
}
511511

512-
static void qd_unlock(struct gfs2_quota_data *qd)
512+
static void qdsb_put(struct gfs2_quota_data *qd)
513513
{
514-
gfs2_assert_warn(qd->qd_sbd, test_bit(QDF_LOCKED, &qd->qd_flags));
515-
clear_bit(QDF_LOCKED, &qd->qd_flags);
516514
bh_put(qd);
517515
slot_put(qd);
518516
qd_put(qd);
519517
}
520518

519+
static void qd_unlock(struct gfs2_quota_data *qd)
520+
{
521+
gfs2_assert_warn(qd->qd_sbd, test_bit(QDF_LOCKED, &qd->qd_flags));
522+
clear_bit(QDF_LOCKED, &qd->qd_flags);
523+
qdsb_put(qd);
524+
}
525+
521526
static int qdsb_get(struct gfs2_sbd *sdp, struct kqid qid,
522527
struct gfs2_quota_data **qdp)
523528
{
@@ -544,13 +549,6 @@ static int qdsb_get(struct gfs2_sbd *sdp, struct kqid qid,
544549
return error;
545550
}
546551

547-
static void qdsb_put(struct gfs2_quota_data *qd)
548-
{
549-
bh_put(qd);
550-
slot_put(qd);
551-
qd_put(qd);
552-
}
553-
554552
/**
555553
* gfs2_qa_get - make sure we have a quota allocations data structure,
556554
* if necessary

0 commit comments

Comments
 (0)