Skip to content

Commit 2aedfe8

Browse files
author
Andreas Gruenbacher
committed
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 7dbc6ae. Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent de0d95c commit 2aedfe8

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

fs/gfs2/quota.c

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -491,20 +491,6 @@ static int qd_check_sync(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd,
491491
return 1;
492492
}
493493

494-
static int qd_bh_get_or_undo(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd)
495-
{
496-
int error;
497-
498-
error = bh_get(qd);
499-
if (!error)
500-
return 0;
501-
502-
clear_bit(QDF_LOCKED, &qd->qd_flags);
503-
slot_put(qd);
504-
qd_put(qd);
505-
return error;
506-
}
507-
508494
static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp)
509495
{
510496
struct gfs2_quota_data *qd = NULL, *iter;
@@ -527,12 +513,17 @@ static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp)
527513
spin_unlock(&qd_lock);
528514

529515
if (qd) {
530-
error = qd_bh_get_or_undo(sdp, qd);
531-
if (error)
516+
error = bh_get(qd);
517+
if (error) {
518+
clear_bit(QDF_LOCKED, &qd->qd_flags);
519+
slot_put(qd);
520+
qd_put(qd);
532521
return error;
533-
*qdp = qd;
522+
}
534523
}
535524

525+
*qdp = qd;
526+
536527
return 0;
537528
}
538529

@@ -1189,8 +1180,15 @@ void gfs2_quota_unlock(struct gfs2_inode *ip)
11891180
if (!found)
11901181
continue;
11911182

1192-
if (!qd_bh_get_or_undo(sdp, qd))
1193-
qda[count++] = qd;
1183+
gfs2_assert_warn(sdp, qd->qd_change_sync);
1184+
if (bh_get(qd)) {
1185+
clear_bit(QDF_LOCKED, &qd->qd_flags);
1186+
slot_put(qd);
1187+
qd_put(qd);
1188+
continue;
1189+
}
1190+
1191+
qda[count++] = qd;
11941192
}
11951193

11961194
if (count) {

0 commit comments

Comments
 (0)