Skip to content

Commit 6e42240

Browse files
author
Andreas Gruenbacher
committed
gfs2: Turn gfs2_withdraw into a void function
Since commit 601ef0d ("gfs2: Force withdraw to replay journals and wait for it to finish"), gfs2_withdraw() always returns -1, so turn it into a straight void function. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: Andrew Price <anprice@redhat.com>
1 parent 418c854 commit 6e42240

2 files changed

Lines changed: 9 additions & 14 deletions

File tree

fs/gfs2/util.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void gfs2_lm(struct gfs2_sbd *sdp, const char *fmt, ...)
309309
va_end(args);
310310
}
311311

312-
int gfs2_withdraw(struct gfs2_sbd *sdp)
312+
void gfs2_withdraw(struct gfs2_sbd *sdp)
313313
{
314314
struct lm_lockstruct *ls = &sdp->sd_lockstruct;
315315
const struct lm_lockops *lm = ls->ls_ops;
@@ -322,7 +322,7 @@ int gfs2_withdraw(struct gfs2_sbd *sdp)
322322
wait_on_bit(&sdp->sd_flags,
323323
SDF_WITHDRAW_IN_PROG,
324324
TASK_UNINTERRUPTIBLE);
325-
return -1;
325+
return;
326326
}
327327
new = old | BIT(SDF_WITHDRAWN) | BIT(SDF_WITHDRAW_IN_PROG);
328328
} while (unlikely(!try_cmpxchg(&sdp->sd_flags, &old, new)));
@@ -350,8 +350,6 @@ int gfs2_withdraw(struct gfs2_sbd *sdp)
350350

351351
if (sdp->sd_args.ar_errors == GFS2_ERRORS_PANIC)
352352
panic("GFS2: fsid=%s: panic requested\n", sdp->sd_fsname);
353-
354-
return -1;
355353
}
356354

357355
/*
@@ -481,16 +479,14 @@ int gfs2_meta_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
481479
const char *function, char *file,
482480
unsigned int line)
483481
{
484-
int me;
485-
486482
gfs2_lm(sdp,
487483
"fatal: invalid metadata block - "
488484
"bh = %llu (bad magic number), "
489485
"function = %s, file = %s, line = %u\n",
490486
(unsigned long long)bh->b_blocknr,
491487
function, file, line);
492-
me = gfs2_withdraw(sdp);
493-
return (me) ? -1 : -2;
488+
gfs2_withdraw(sdp);
489+
return -1;
494490
}
495491

496492
/*
@@ -503,16 +499,14 @@ int gfs2_metatype_check_ii(struct gfs2_sbd *sdp, struct buffer_head *bh,
503499
u16 type, u16 t, const char *function,
504500
char *file, unsigned int line)
505501
{
506-
int me;
507-
508502
gfs2_lm(sdp,
509503
"fatal: invalid metadata block - "
510504
"bh = %llu (type: exp=%u, found=%u), "
511505
"function = %s, file = %s, line = %u\n",
512506
(unsigned long long)bh->b_blocknr, type, t,
513507
function, file, line);
514-
me = gfs2_withdraw(sdp);
515-
return (me) ? -1 : -2;
508+
gfs2_withdraw(sdp);
509+
return -1;
516510
}
517511

518512
/*
@@ -528,7 +522,8 @@ int gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function, char *file,
528522
"fatal: I/O error - "
529523
"function = %s, file = %s, line = %u\n",
530524
function, file, line);
531-
return gfs2_withdraw(sdp);
525+
gfs2_withdraw(sdp);
526+
return -1;
532527
}
533528

534529
/*

fs/gfs2/util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,6 @@ gfs2_tune_get_i(&(sdp)->sd_tune, &(sdp)->sd_tune.field)
228228

229229
__printf(2, 3)
230230
void gfs2_lm(struct gfs2_sbd *sdp, const char *fmt, ...);
231-
int gfs2_withdraw(struct gfs2_sbd *sdp);
231+
void gfs2_withdraw(struct gfs2_sbd *sdp);
232232

233233
#endif /* __UTIL_DOT_H__ */

0 commit comments

Comments
 (0)