ext4: convert ext4_bread() to use the ERR_PTR convention

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
Theodore Ts'o
2014-08-29 20:52:15 -04:00
parent 1056008226
commit 1c2150283c
5 changed files with 34 additions and 43 deletions

View File

@@ -791,27 +791,21 @@ errout:
}
struct buffer_head *ext4_bread(handle_t *handle, struct inode *inode,
ext4_lblk_t block, int create, int *err)
ext4_lblk_t block, int create)
{
struct buffer_head *bh;
*err = 0;
bh = ext4_getblk(handle, inode, block, create);
if (IS_ERR(bh)) {
*err = PTR_ERR(bh);
return NULL;
}
if (!bh)
if (IS_ERR(bh))
return bh;
if (buffer_uptodate(bh))
if (!bh || buffer_uptodate(bh))
return bh;
ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &bh);
wait_on_buffer(bh);
if (buffer_uptodate(bh))
return bh;
put_bh(bh);
*err = -EIO;
return NULL;
return ERR_PTR(-EIO);
}
int ext4_walk_page_buffers(handle_t *handle,