Skip to content

Commit 0e072ca

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
gfs2: change qd_slot_count to qd_slot_ref
Variable qd_slot_count is a reference count, not a count of slots. This patch renames it to qd_slot_ref to make that more clear. Signed-off-by: Bob Peterson <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 06aa6fd commit 0e072ca

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

fs/gfs2/incore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ struct gfs2_quota_data {
452452
s64 qd_change_sync;
453453

454454
unsigned int qd_slot;
455-
unsigned int qd_slot_count;
455+
unsigned int qd_slot_ref;
456456

457457
struct buffer_head *qd_bh;
458458
struct gfs2_quota_change *qd_bh_qc;

fs/gfs2/quota.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static void gfs2_qd_dispose(struct gfs2_quota_data *qd)
130130

131131
if (!gfs2_withdrawn(sdp)) {
132132
gfs2_assert_warn(sdp, !qd->qd_change);
133-
gfs2_assert_warn(sdp, !qd->qd_slot_count);
133+
gfs2_assert_warn(sdp, !qd->qd_slot_ref);
134134
gfs2_assert_warn(sdp, !qd->qd_bh_count);
135135
}
136136

@@ -342,7 +342,7 @@ static int slot_get(struct gfs2_quota_data *qd)
342342
int error = 0;
343343

344344
spin_lock(&sdp->sd_bitmap_lock);
345-
if (qd->qd_slot_count == 0) {
345+
if (qd->qd_slot_ref == 0) {
346346
bit = find_first_zero_bit(sdp->sd_quota_bitmap,
347347
sdp->sd_quota_slots);
348348
if (bit >= sdp->sd_quota_slots) {
@@ -352,7 +352,7 @@ static int slot_get(struct gfs2_quota_data *qd)
352352
set_bit(bit, sdp->sd_quota_bitmap);
353353
qd->qd_slot = bit;
354354
}
355-
qd->qd_slot_count++;
355+
qd->qd_slot_ref++;
356356
out:
357357
spin_unlock(&sdp->sd_bitmap_lock);
358358
return error;
@@ -363,8 +363,8 @@ static void slot_hold(struct gfs2_quota_data *qd)
363363
struct gfs2_sbd *sdp = qd->qd_sbd;
364364

365365
spin_lock(&sdp->sd_bitmap_lock);
366-
gfs2_assert(sdp, qd->qd_slot_count);
367-
qd->qd_slot_count++;
366+
gfs2_assert(sdp, qd->qd_slot_ref);
367+
qd->qd_slot_ref++;
368368
spin_unlock(&sdp->sd_bitmap_lock);
369369
}
370370

@@ -373,8 +373,8 @@ static void slot_put(struct gfs2_quota_data *qd)
373373
struct gfs2_sbd *sdp = qd->qd_sbd;
374374

375375
spin_lock(&sdp->sd_bitmap_lock);
376-
gfs2_assert(sdp, qd->qd_slot_count);
377-
if (!--qd->qd_slot_count) {
376+
gfs2_assert(sdp, qd->qd_slot_ref);
377+
if (!--qd->qd_slot_ref) {
378378
BUG_ON(!test_and_clear_bit(qd->qd_slot, sdp->sd_quota_bitmap));
379379
qd->qd_slot = -1;
380380
}
@@ -1446,7 +1446,7 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
14461446
set_bit(QDF_CHANGE, &qd->qd_flags);
14471447
qd->qd_change = qc_change;
14481448
qd->qd_slot = slot;
1449-
qd->qd_slot_count = 1;
1449+
qd->qd_slot_ref = 1;
14501450

14511451
spin_lock(&qd_lock);
14521452
BUG_ON(test_and_set_bit(slot, sdp->sd_quota_bitmap));

0 commit comments

Comments
 (0)