lkml.org 
[lkml]   [2016]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH 12/16] md/bitmap: One check less in read_page() at the end
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Tue, 27 Sep 2016 16:30:25 +0200

    * Adjust a jump target.

    * Delete a repeated check which became unnecessary with this refactoring.

    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    ---
    drivers/md/bitmap.c | 10 +++++-----
    1 file changed, 5 insertions(+), 5 deletions(-)

    diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
    index c186e5d..e7a7fc8 100644
    --- a/drivers/md/bitmap.c
    +++ b/drivers/md/bitmap.c
    @@ -367,7 +367,7 @@ static int read_page(struct file *file, unsigned long index,
    bh = alloc_page_buffers(page, 1<<inode->i_blkbits, 0);
    if (!bh) {
    ret = -ENOMEM;
    - goto out;
    + goto report_failure;
    }
    attach_page_buffers(page, bh);
    block = index << (PAGE_SHIFT - inode->i_blkbits);
    @@ -379,7 +379,7 @@ static int read_page(struct file *file, unsigned long index,
    if (bh->b_blocknr == 0) {
    /* Cannot use this file! */
    ret = -EINVAL;
    - goto out;
    + goto report_failure;
    }
    bh->b_bdev = inode->i_sb->s_bdev;
    if (count < (1<<inode->i_blkbits))
    @@ -401,14 +401,14 @@ static int read_page(struct file *file, unsigned long index,

    wait_event(bitmap->write_wait,
    atomic_read(&bitmap->pending_writes)==0);
    - if (test_bit(BITMAP_WRITE_ERROR, &bitmap->flags))
    + if (test_bit(BITMAP_WRITE_ERROR, &bitmap->flags)) {
    ret = -EIO;
    -out:
    - if (ret)
    +report_failure:
    printk(KERN_ALERT "md: bitmap read error: (%dB @ %llu): %d\n",
    (int)PAGE_SIZE,
    (unsigned long long)index << PAGE_SHIFT,
    ret);
    + }
    return ret;
    }

    --
    2.10.0
    \
     
     \ /
      Last update: 2016-09-27 19:01    [W:4.040 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site