@@ -942,7 +942,7 @@ static int ext4_ext_split(handle_t *handle, struct
inode *inode,
goto cleanup;
}
bh = sb_getblk(inode->i_sb, newblock);
- if (!bh) {
+ if (unlikely(!bh)) {
err = -EIO;
goto cleanup;
}
@@ -1015,7 +1015,7 @@ static int ext4_ext_split(handle_t *handle,
struct inode *inode,
oldblock = newblock;
newblock = ablocks[--a];
bh = sb_getblk(inode->i_sb, newblock);
- if (!bh) {
+ if (unlikely(!bh)) {
err = -EIO;
goto cleanup;
}
@@ -1128,7 +1128,7 @@ static int ext4_ext_grow_indepth(handle_t
*handle, struct inode *inode,
return err;
bh = sb_getblk(inode->i_sb, newblock);
- if (!bh) {
+ if (unlikely(!bh)) {
err = -EIO;
ext4_std_error(inode->i_sb, err);
return err;
@@ -739,7 +739,7 @@ struct buffer_head *ext4_getblk(handle_t *handle,
struct inode *inode,
*errp = 0;
bh = sb_getblk(inode->i_sb, map.m_pblk);
- if (!bh) {
+ if (unlikely(!bh)) {
*errp = -EIO;
return NULL;
}
@@ -3590,7 +3590,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
iloc->offset = (inode_offset % inodes_per_block) * EXT4_INODE_SIZE(sb);
bh = sb_getblk(sb, block);
- if (!bh) {
+ if (unlikely(!bh)) {
EXT4_ERROR_INODE_BLOCK(inode, block,
"unable to read itable block");
return -EIO;
@@ -3626,7 +3626,7 @@ static int __ext4_get_inode_loc(struct inode *inode,
/* Is the inode bitmap in cache? */
bitmap_bh = sb_getblk(sb, ext4_inode_bitmap(sb, gdp));
- if (!bitmap_bh)
+ if (unlikely(!bitmap_bh))
goto make_io;
/*
@@ -91,7 +91,7 @@ static int read_mmp_block(struct super_block *sb,
struct buffer_head **bh,
*bh = NULL;
}
}
- if (!*bh) {
+ if (unlikely(!*bh)) {
ext4_warning(sb, "Error while reading MMP block %llu",
mmp_block);
return -EIO;
@@ -309,7 +309,7 @@ static struct buffer_head *bclean(handle_t
*handle, struct super_block *sb,
int err;
bh = sb_getblk(sb, blk);
- if (!bh)
+ if (unlikely(!bh))
return ERR_PTR(-EIO);
if ((err = ext4_journal_get_write_access(handle, bh))) {
brelse(bh);
@@ -386,7 +386,7 @@ static int set_flexbg_block_bitmap(struct
super_block *sb, handle_t *handle,
return err;
bh = sb_getblk(sb, flex_gd->groups[group].block_bitmap);
- if (!bh)
+ if (unlikely(!bh))
return -EIO;
err = ext4_journal_get_write_access(handle, bh);
@@ -461,7 +461,7 @@ static int setup_new_flex_group_blocks(struct
super_block *sb,
goto out;
gdb = sb_getblk(sb, block);
- if (!gdb) {
+ if (unlikely(!gdb)) {
err = -EIO;
goto out;
}
@@ -983,7 +983,7 @@ static void update_backups(struct super_block *sb,
break;
bh = sb_getblk(sb, group * bpg + blk_off);
- if (!bh) {
+ if (unlikely(!bh)) {
err = -EIO;
break;
}
@@ -1074,7 +1074,7 @@ static int ext4_add_new_descs(handle_t *handle,
struct super_block *sb,
static struct buffer_head *ext4_get_bitmap(struct super_block *sb, __u64 block)
{
struct buffer_head *bh = sb_getblk(sb, block);
- if (!bh)
+ if (unlikely(!bh))
return NULL;
if (bitmap_uptodate(bh))
@@ -897,7 +897,7 @@ inserted:
(unsigned long long)block);
new_bh = sb_getblk(sb, block);
- if (!new_bh) {
+ if (unlikely(!new_bh)) {
getblk_failed:
ext4_free_blocks(handle, inode, NULL, block, 1,
EXT4_FREE_BLOCKS_METADATA);