diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/quota.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index f58072efafc9..976bf1097706 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -1459,35 +1459,17 @@ fail: void gfs2_quota_cleanup(struct gfs2_sbd *sdp) { - struct list_head *head = &sdp->sd_quota_list; struct gfs2_quota_data *qd; + LIST_HEAD(dispose); spin_lock(&qd_lock); - while (!list_empty(head)) { - qd = list_last_entry(head, struct gfs2_quota_data, qd_list); - - list_del(&qd->qd_list); - - /* Also remove if this qd exists in the reclaim list */ + list_for_each_entry(qd, &sdp->sd_quota_list, qd_list) { list_lru_del(&gfs2_qd_lru, &qd->qd_lru); - atomic_dec(&sdp->sd_quota_count); - spin_unlock(&qd_lock); - - spin_lock_bucket(qd->qd_hash); - hlist_bl_del_rcu(&qd->qd_hlist); - spin_unlock_bucket(qd->qd_hash); - - gfs2_assert_warn(sdp, !qd->qd_change); - gfs2_assert_warn(sdp, !qd->qd_slot_count); - gfs2_assert_warn(sdp, !qd->qd_bh_count); - - gfs2_glock_put(qd->qd_gl); - call_rcu(&qd->qd_rcu, gfs2_qd_dealloc); - - spin_lock(&qd_lock); + list_add(&qd->qd_lru, &dispose); } spin_unlock(&qd_lock); + gfs2_qd_dispose(&dispose); gfs2_assert_warn(sdp, !atomic_read(&sdp->sd_quota_count)); kvfree(sdp->sd_quota_bitmap); |