Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+10 -22
+2 -6
fs/gfs2/log.c
··· 112 112 &tr->tr_ail2_list); 113 113 continue; 114 114 } 115 - if (!cmpxchg(&sdp->sd_log_error, 0, -EIO)) { 115 + if (!cmpxchg(&sdp->sd_log_error, 0, -EIO)) 116 116 gfs2_io_error_bh(sdp, bh); 117 - gfs2_withdraw(sdp); 118 - } 119 117 } 120 118 121 119 if (gfs2_withdrawn(sdp)) { ··· 322 324 continue; 323 325 } 324 326 if (!buffer_uptodate(bh) && 325 - !cmpxchg(&sdp->sd_log_error, 0, -EIO)) { 327 + !cmpxchg(&sdp->sd_log_error, 0, -EIO)) 326 328 gfs2_io_error_bh(sdp, bh); 327 - gfs2_withdraw(sdp); 328 - } 329 329 /* 330 330 * If we have space for revokes and the bd is no longer on any 331 331 * buf list, we can just add a revoke for it immediately and
+1 -1
fs/gfs2/lops.c
··· 49 49 if (test_set_buffer_pinned(bh)) 50 50 gfs2_assert_withdraw(sdp, 0); 51 51 if (!buffer_uptodate(bh)) 52 - gfs2_io_error_bh_wd(sdp, bh); 52 + gfs2_io_error_bh(sdp, bh); 53 53 bd = bh->b_private; 54 54 /* If this buffer is in the AIL and it has already been written 55 55 * to in-place disk block, remove it from the AIL.
+2 -2
fs/gfs2/meta_io.c
··· 303 303 if (unlikely(!buffer_uptodate(bh))) { 304 304 struct gfs2_trans *tr = current->journal_info; 305 305 if (tr && test_bit(TR_TOUCHED, &tr->tr_flags)) 306 - gfs2_io_error_bh_wd(sdp, bh); 306 + gfs2_io_error_bh(sdp, bh); 307 307 brelse(bh); 308 308 *bhp = NULL; 309 309 return -EIO; ··· 331 331 if (!buffer_uptodate(bh)) { 332 332 struct gfs2_trans *tr = current->journal_info; 333 333 if (tr && test_bit(TR_TOUCHED, &tr->tr_flags)) 334 - gfs2_io_error_bh_wd(sdp, bh); 334 + gfs2_io_error_bh(sdp, bh); 335 335 return -EIO; 336 336 } 337 337 if (gfs2_withdrawn(sdp) &&
+3 -7
fs/gfs2/util.c
··· 516 516 } 517 517 518 518 /* 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 521 520 */ 522 521 523 522 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) 526 524 { 527 525 if (gfs2_withdrawn(sdp)) 528 526 return; ··· 529 531 "block = %llu, " 530 532 "function = %s, file = %s, line = %u\n", 531 533 (unsigned long long)bh->b_blocknr, function, file, line); 532 - if (withdraw) 533 - gfs2_withdraw(sdp); 534 + gfs2_withdraw(sdp); 534 535 } 535 -
+2 -6
fs/gfs2/util.h
··· 151 151 152 152 153 153 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); 159 155 160 156 #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__) 162 158 163 159 164 160 extern struct kmem_cache *gfs2_glock_cachep;