Skip to content

Commit 1b7d498

Browse files
author
Andreas Gruenbacher
committed
gfs2: Rename gfs2_{withdrawing_or_ => }withdrawn
With delayed withdraws and the SDF_WITHDRAWING flag gone, we can now rename gfs2_withdrawing_or_withdrawn() back to gfs2_withdrawn(). Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 8daf6c2 commit 1b7d498

15 files changed

Lines changed: 42 additions & 43 deletions

File tree

fs/gfs2/aops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ static int gfs2_read_folio(struct file *file, struct folio *folio)
435435
error = mpage_read_folio(folio, gfs2_block_map);
436436
}
437437

438-
if (gfs2_withdrawing_or_withdrawn(sdp))
438+
if (gfs2_withdrawn(sdp))
439439
return -EIO;
440440

441441
return error;

fs/gfs2/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
14461446

14471447
if (!(fl->c.flc_flags & FL_POSIX))
14481448
return -ENOLCK;
1449-
if (gfs2_withdrawing_or_withdrawn(sdp)) {
1449+
if (gfs2_withdrawn(sdp)) {
14501450
if (lock_is_unlock(fl))
14511451
locks_lock_file_wait(file, fl);
14521452
return -EIO;

fs/gfs2/glock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static bool glock_blocked_by_withdraw(struct gfs2_glock *gl)
154154
{
155155
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
156156

157-
if (!gfs2_withdrawing_or_withdrawn(sdp))
157+
if (!gfs2_withdrawn(sdp))
158158
return false;
159159
if (gl->gl_ops->go_flags & GLOF_NONDISK)
160160
return false;
@@ -270,7 +270,7 @@ static void __gfs2_glock_put(struct gfs2_glock *gl)
270270
GLOCK_BUG_ON(gl, !list_empty(&gl->gl_holders));
271271
if (mapping) {
272272
truncate_inode_pages_final(mapping);
273-
if (!gfs2_withdrawing_or_withdrawn(sdp))
273+
if (!gfs2_withdrawn(sdp))
274274
GLOCK_BUG_ON(gl, !mapping_empty(mapping));
275275
}
276276
trace_gfs2_glock_put(gl);
@@ -755,7 +755,7 @@ __acquires(&gl->gl_lockref.lock)
755755
* gfs2_gl_hash_clear calls clear_glock) and recovery is complete
756756
* then it's okay to tell dlm to unlock it.
757757
*/
758-
if (unlikely(sdp->sd_log_error) && !gfs2_withdrawing_or_withdrawn(sdp))
758+
if (unlikely(sdp->sd_log_error) && !gfs2_withdrawn(sdp))
759759
gfs2_withdraw(sdp);
760760
if (glock_blocked_by_withdraw(gl) &&
761761
(target != LM_ST_UNLOCKED ||
@@ -803,7 +803,7 @@ __acquires(&gl->gl_lockref.lock)
803803
*/
804804
} else {
805805
fs_err(sdp, "lm_lock ret %d\n", ret);
806-
GLOCK_BUG_ON(gl, !gfs2_withdrawing_or_withdrawn(sdp));
806+
GLOCK_BUG_ON(gl, !gfs2_withdrawn(sdp));
807807
return;
808808
}
809809
}

fs/gfs2/glops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int gfs2_rgrp_metasync(struct gfs2_glock *gl)
175175

176176
filemap_fdatawrite_range(metamapping, start, end);
177177
error = filemap_fdatawait_range(metamapping, start, end);
178-
WARN_ON_ONCE(error && !gfs2_withdrawing_or_withdrawn(sdp));
178+
WARN_ON_ONCE(error && !gfs2_withdrawn(sdp));
179179
mapping_set_error(metamapping, error);
180180
if (error)
181181
gfs2_io_error(sdp);

fs/gfs2/lock_dlm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ static void gdlm_recover_prep(void *arg)
11951195
struct gfs2_sbd *sdp = arg;
11961196
struct lm_lockstruct *ls = &sdp->sd_lockstruct;
11971197

1198-
if (gfs2_withdrawing_or_withdrawn(sdp)) {
1198+
if (gfs2_withdrawn(sdp)) {
11991199
fs_err(sdp, "recover_prep ignored due to withdraw.\n");
12001200
return;
12011201
}
@@ -1221,7 +1221,7 @@ static void gdlm_recover_slot(void *arg, struct dlm_slot *slot)
12211221
struct lm_lockstruct *ls = &sdp->sd_lockstruct;
12221222
int jid = slot->slot - 1;
12231223

1224-
if (gfs2_withdrawing_or_withdrawn(sdp)) {
1224+
if (gfs2_withdrawn(sdp)) {
12251225
fs_err(sdp, "recover_slot jid %d ignored due to withdraw.\n",
12261226
jid);
12271227
return;
@@ -1250,7 +1250,7 @@ static void gdlm_recover_done(void *arg, struct dlm_slot *slots, int num_slots,
12501250
struct gfs2_sbd *sdp = arg;
12511251
struct lm_lockstruct *ls = &sdp->sd_lockstruct;
12521252

1253-
if (gfs2_withdrawing_or_withdrawn(sdp)) {
1253+
if (gfs2_withdrawn(sdp)) {
12541254
fs_err(sdp, "recover_done ignored due to withdraw.\n");
12551255
return;
12561256
}
@@ -1281,7 +1281,7 @@ static void gdlm_recovery_result(struct gfs2_sbd *sdp, unsigned int jid,
12811281
{
12821282
struct lm_lockstruct *ls = &sdp->sd_lockstruct;
12831283

1284-
if (gfs2_withdrawing_or_withdrawn(sdp)) {
1284+
if (gfs2_withdrawn(sdp)) {
12851285
fs_err(sdp, "recovery_result jid %d ignored due to withdraw.\n",
12861286
jid);
12871287
return;

fs/gfs2/log.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ __acquires(&sdp->sd_ail_lock)
118118
}
119119
}
120120

121-
if (gfs2_withdrawing_or_withdrawn(sdp)) {
121+
if (gfs2_withdrawn(sdp)) {
122122
gfs2_remove_from_ail(bd);
123123
continue;
124124
}
@@ -834,7 +834,7 @@ void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
834834
struct super_block *sb = sdp->sd_vfs;
835835
u64 dblock;
836836

837-
if (gfs2_withdrawing_or_withdrawn(sdp))
837+
if (gfs2_withdrawn(sdp))
838838
return;
839839

840840
page = mempool_alloc(gfs2_page_pool, GFP_NOIO);
@@ -981,7 +981,7 @@ static void empty_ail1_list(struct gfs2_sbd *sdp)
981981
gfs2_ail1_wait(sdp);
982982
empty = gfs2_ail1_empty(sdp, 0);
983983

984-
if (gfs2_withdrawing_or_withdrawn(sdp))
984+
if (gfs2_withdrawn(sdp))
985985
break;
986986
}
987987
}
@@ -1044,7 +1044,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl, u32 flags)
10441044
* Do this check while holding the log_flush_lock to prevent new
10451045
* buffers from being added to the ail via gfs2_pin()
10461046
*/
1047-
if (gfs2_withdrawing_or_withdrawn(sdp) ||
1047+
if (gfs2_withdrawn(sdp) ||
10481048
!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags))
10491049
goto out;
10501050

@@ -1094,22 +1094,22 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl, u32 flags)
10941094
goto out_withdraw;
10951095

10961096
gfs2_ordered_write(sdp);
1097-
if (gfs2_withdrawing_or_withdrawn(sdp))
1097+
if (gfs2_withdrawn(sdp))
10981098
goto out_withdraw;
10991099
lops_before_commit(sdp, tr);
1100-
if (gfs2_withdrawing_or_withdrawn(sdp))
1100+
if (gfs2_withdrawn(sdp))
11011101
goto out_withdraw;
11021102
if (sdp->sd_jdesc)
11031103
gfs2_log_submit_bio(&sdp->sd_jdesc->jd_log_bio, REQ_OP_WRITE);
1104-
if (gfs2_withdrawing_or_withdrawn(sdp))
1104+
if (gfs2_withdrawn(sdp))
11051105
goto out_withdraw;
11061106

11071107
if (sdp->sd_log_head != sdp->sd_log_flush_head) {
11081108
log_write_header(sdp, flags);
11091109
} else if (sdp->sd_log_tail != sdp->sd_log_flush_tail && !sdp->sd_log_idle) {
11101110
log_write_header(sdp, flags);
11111111
}
1112-
if (gfs2_withdrawing_or_withdrawn(sdp))
1112+
if (gfs2_withdrawn(sdp))
11131113
goto out_withdraw;
11141114
lops_after_commit(sdp, tr);
11151115

@@ -1127,7 +1127,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl, u32 flags)
11271127
if (!(flags & GFS2_LOG_HEAD_FLUSH_NORMAL)) {
11281128
if (!sdp->sd_log_idle) {
11291129
empty_ail1_list(sdp);
1130-
if (gfs2_withdrawing_or_withdrawn(sdp))
1130+
if (gfs2_withdrawn(sdp))
11311131
goto out_withdraw;
11321132
log_write_header(sdp, flags);
11331133
}
@@ -1296,7 +1296,7 @@ int gfs2_logd(void *data)
12961296

12971297
set_freezable();
12981298
while (!kthread_should_stop()) {
1299-
if (gfs2_withdrawing_or_withdrawn(sdp))
1299+
if (gfs2_withdrawn(sdp))
13001300
break;
13011301

13021302
/* Check for errors writing to the journal */
@@ -1333,7 +1333,7 @@ int gfs2_logd(void *data)
13331333
gfs2_ail_flush_reqd(sdp) ||
13341334
gfs2_jrnl_flush_reqd(sdp) ||
13351335
sdp->sd_log_error ||
1336-
gfs2_withdrawing_or_withdrawn(sdp) ||
1336+
gfs2_withdrawn(sdp) ||
13371337
kthread_should_stop(),
13381338
t);
13391339
}

fs/gfs2/meta_io.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
263263
struct buffer_head *bh, *bhs[2];
264264
int num = 0;
265265

266-
if (gfs2_withdrawing_or_withdrawn(sdp) &&
266+
if (gfs2_withdrawn(sdp) &&
267267
!gfs2_withdraw_in_prog(sdp)) {
268268
*bhp = NULL;
269269
return -EIO;
@@ -322,7 +322,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
322322

323323
int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh)
324324
{
325-
if (gfs2_withdrawing_or_withdrawn(sdp) &&
325+
if (gfs2_withdrawn(sdp) &&
326326
!gfs2_withdraw_in_prog(sdp))
327327
return -EIO;
328328

@@ -334,7 +334,7 @@ int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh)
334334
gfs2_io_error_bh_wd(sdp, bh);
335335
return -EIO;
336336
}
337-
if (gfs2_withdrawing_or_withdrawn(sdp) &&
337+
if (gfs2_withdrawn(sdp) &&
338338
!gfs2_withdraw_in_prog(sdp))
339339
return -EIO;
340340

fs/gfs2/ops_fstype.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ static int gfs2_lm_mount(struct gfs2_sbd *sdp, int silent)
10401040
void gfs2_lm_unmount(struct gfs2_sbd *sdp)
10411041
{
10421042
const struct lm_lockops *lm = sdp->sd_lockstruct.ls_ops;
1043-
if (!gfs2_withdrawing_or_withdrawn(sdp) && lm->lm_unmount)
1043+
if (!gfs2_withdrawn(sdp) && lm->lm_unmount)
10441044
lm->lm_unmount(sdp, true);
10451045
}
10461046

fs/gfs2/quota.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static void gfs2_qd_dispose(struct gfs2_quota_data *qd)
125125
hlist_bl_del_rcu(&qd->qd_hlist);
126126
spin_unlock_bucket(qd->qd_hash);
127127

128-
if (!gfs2_withdrawing_or_withdrawn(sdp)) {
128+
if (!gfs2_withdrawn(sdp)) {
129129
gfs2_assert_warn(sdp, !qd->qd_change);
130130
gfs2_assert_warn(sdp, !qd->qd_slot_ref);
131131
gfs2_assert_warn(sdp, !qd->qd_bh_count);
@@ -1551,7 +1551,7 @@ static void quotad_error(struct gfs2_sbd *sdp, const char *msg, int error)
15511551
{
15521552
if (error == 0 || error == -EROFS)
15531553
return;
1554-
if (!gfs2_withdrawing_or_withdrawn(sdp)) {
1554+
if (!gfs2_withdrawn(sdp)) {
15551555
if (!cmpxchg(&sdp->sd_log_error, 0, error))
15561556
fs_err(sdp, "gfs2_quotad: %s error %d\n", msg, error);
15571557
wake_up(&sdp->sd_logd_waitq);
@@ -1583,7 +1583,7 @@ int gfs2_quotad(void *data)
15831583
while (!kthread_should_stop()) {
15841584
unsigned long t;
15851585

1586-
if (gfs2_withdrawing_or_withdrawn(sdp))
1586+
if (gfs2_withdrawn(sdp))
15871587
break;
15881588

15891589
now = jiffies;
@@ -1614,7 +1614,7 @@ int gfs2_quotad(void *data)
16141614
t = min(statfs_deadline - now, quotad_deadline - now);
16151615
wait_event_freezable_timeout(sdp->sd_quota_wait,
16161616
sdp->sd_statfs_force_sync ||
1617-
gfs2_withdrawing_or_withdrawn(sdp) ||
1617+
gfs2_withdrawn(sdp) ||
16181618
kthread_should_stop(),
16191619
t);
16201620

fs/gfs2/recovery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ void gfs2_recover_func(struct work_struct *work)
408408
int error = 0;
409409
int jlocked = 0;
410410

411-
if (gfs2_withdrawing_or_withdrawn(sdp)) {
411+
if (gfs2_withdrawn(sdp)) {
412412
fs_err(sdp, "jid=%u: Recovery not attempted due to withdraw.\n",
413413
jd->jd_jid);
414414
goto fail;

0 commit comments

Comments
 (0)