Skip to content

Commit fab27b4

Browse files
author
Andreas Gruenbacher
committed
gfs2: Kill gfs2_io_error_bh_wd
All callers of gfs2_io_error_bh() call gfs2_withdraw() as well, so change gfs2_io_error_bh() to call gfs2_withdraw() directly. This also brings it in line with other similar error reporting functions. With that, gfs2_io_error_bh() is the same as gfs2_io_error_bh_wd(), so remove the latter. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 0e2038a commit fab27b4

5 files changed

Lines changed: 10 additions & 22 deletions

File tree

fs/gfs2/log.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,8 @@ __acquires(&sdp->sd_ail_lock)
112112
&tr->tr_ail2_list);
113113
continue;
114114
}
115-
if (!cmpxchg(&sdp->sd_log_error, 0, -EIO)) {
115+
if (!cmpxchg(&sdp->sd_log_error, 0, -EIO))
116116
gfs2_io_error_bh(sdp, bh);
117-
gfs2_withdraw(sdp);
118-
}
119117
}
120118

121119
if (gfs2_withdrawn(sdp)) {
@@ -324,10 +322,8 @@ static int gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct gfs2_trans *tr,
324322
continue;
325323
}
326324
if (!buffer_uptodate(bh) &&
327-
!cmpxchg(&sdp->sd_log_error, 0, -EIO)) {
325+
!cmpxchg(&sdp->sd_log_error, 0, -EIO))
328326
gfs2_io_error_bh(sdp, bh);
329-
gfs2_withdraw(sdp);
330-
}
331327
/*
332328
* If we have space for revokes and the bd is no longer on any
333329
* buf list, we can just add a revoke for it immediately and

fs/gfs2/lops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh)
4949
if (test_set_buffer_pinned(bh))
5050
gfs2_assert_withdraw(sdp, 0);
5151
if (!buffer_uptodate(bh))
52-
gfs2_io_error_bh_wd(sdp, bh);
52+
gfs2_io_error_bh(sdp, bh);
5353
bd = bh->b_private;
5454
/* If this buffer is in the AIL and it has already been written
5555
* to in-place disk block, remove it from the AIL.

fs/gfs2/meta_io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
303303
if (unlikely(!buffer_uptodate(bh))) {
304304
struct gfs2_trans *tr = current->journal_info;
305305
if (tr && test_bit(TR_TOUCHED, &tr->tr_flags))
306-
gfs2_io_error_bh_wd(sdp, bh);
306+
gfs2_io_error_bh(sdp, bh);
307307
brelse(bh);
308308
*bhp = NULL;
309309
return -EIO;
@@ -331,7 +331,7 @@ int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh)
331331
if (!buffer_uptodate(bh)) {
332332
struct gfs2_trans *tr = current->journal_info;
333333
if (tr && test_bit(TR_TOUCHED, &tr->tr_flags))
334-
gfs2_io_error_bh_wd(sdp, bh);
334+
gfs2_io_error_bh(sdp, bh);
335335
return -EIO;
336336
}
337337
if (gfs2_withdrawn(sdp) &&

fs/gfs2/util.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -516,13 +516,11 @@ void gfs2_io_error_i(struct gfs2_sbd *sdp, const char *function, char *file,
516516
}
517517

518518
/*
519-
* gfs2_io_error_bh_i - Flag a buffer I/O error
520-
* @withdraw: withdraw the filesystem
519+
* gfs2_io_error_bh_i - Flag a buffer I/O error and withdraw
521520
*/
522521

523522
void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh,
524-
const char *function, char *file, unsigned int line,
525-
bool withdraw)
523+
const char *function, char *file, unsigned int line)
526524
{
527525
if (gfs2_withdrawn(sdp))
528526
return;
@@ -531,7 +529,5 @@ void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh,
531529
"block = %llu, "
532530
"function = %s, file = %s, line = %u\n",
533531
(unsigned long long)bh->b_blocknr, function, file, line);
534-
if (withdraw)
535-
gfs2_withdraw(sdp);
532+
gfs2_withdraw(sdp);
536533
}
537-

fs/gfs2/util.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,10 @@ gfs2_io_error_i((sdp), __func__, __FILE__, __LINE__)
151151

152152

153153
void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh,
154-
const char *function, char *file, unsigned int line,
155-
bool withdraw);
156-
157-
#define gfs2_io_error_bh_wd(sdp, bh) \
158-
gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, true)
154+
const char *function, char *file, unsigned int line);
159155

160156
#define gfs2_io_error_bh(sdp, bh) \
161-
gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__, false)
157+
gfs2_io_error_bh_i((sdp), (bh), __func__, __FILE__, __LINE__)
162158

163159

164160
extern struct kmem_cache *gfs2_glock_cachep;

0 commit comments

Comments
 (0)