aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/buffer_head.h
diff options
context:
space:
mode:
authorRichard Kennedy <richard@rsk.demon.co.uk>2010-08-09 20:18:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-09 23:44:55 -0400
commita9877cc2937889e5669114f28612b494384152a4 (patch)
tree5ded18d250cc1b0c8c60aec55b249d4c4781ed6e /include/linux/buffer_head.h
parent76545066c8521f3e32c849744744842b4df25b79 (diff)
buffer_head: remove redundant test from wait_on_buffer
The comment suggests that when b_count equals zero it is calling __wait_no_buffer to trigger some debug, but as there is no debug in __wait_on_buffer the whole thing is redundant. AFAICT from the git log this has been the case for at least 5 years, so it seems safe just to remove this. Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Jens Axboe <axboe@kernel.dk> Cc: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/buffer_head.h')
-rw-r--r--include/linux/buffer_head.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 1b9ba193b789..2ce51fac7d3d 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -314,15 +314,10 @@ map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block)
314 bh->b_size = sb->s_blocksize; 314 bh->b_size = sb->s_blocksize;
315} 315}
316 316
317/*
318 * Calling wait_on_buffer() for a zero-ref buffer is illegal, so we call into
319 * __wait_on_buffer() just to trip a debug check. Because debug code in inline
320 * functions is bloaty.
321 */
322static inline void wait_on_buffer(struct buffer_head *bh) 317static inline void wait_on_buffer(struct buffer_head *bh)
323{ 318{
324 might_sleep(); 319 might_sleep();
325 if (buffer_locked(bh) || atomic_read(&bh->b_count) == 0) 320 if (buffer_locked(bh))
326 __wait_on_buffer(bh); 321 __wait_on_buffer(bh);
327} 322}
328 323