[lkml]   [2010]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH RFC] 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 <>

    This patch against 2.6.34-rc4
    compiled & tested on x86_64


    diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
    index 16ed028..4c62dd4 100644
    --- a/include/linux/buffer_head.h
    +++ b/include/linux/buffer_head.h
    @@ -305,15 +305,10 @@ map_bh(struct buffer_head *bh, struct super_block *sb, sector_t block)
    bh->b_size = sb->s_blocksize;

    - * Calling wait_on_buffer() for a zero-ref buffer is illegal, so we call into
    - * __wait_on_buffer() just to trip a debug check. Because debug code in inline
    - * functions is bloaty.
    - */
    static inline void wait_on_buffer(struct buffer_head *bh)
    - if (buffer_locked(bh) || atomic_read(&bh->b_count) == 0)
    + if (buffer_locked(bh))

     \ /
      Last update: 2010-04-16 13:01    [W:0.029 / U:47.960 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site