diff options
author | Wang Shilong <wangsl-fnst@cn.fujitsu.com> | 2013-01-12 16:28:47 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-01-12 16:28:47 -0500 |
commit | aebf02430d25b6bd2b8542126fdcdb90e75a24b8 (patch) | |
tree | 7f884e64b000d9bed3a59dd557b3075a2da4405d /fs/ext4/inode.c | |
parent | 860d21e2c585f7ee8a4ecc06f474fdc33c9474f4 (diff) |
ext4: use unlikely to improve the efficiency of the kernel
Because the function 'sb_getblk' seldomly fails to return NULL
value,it will be better to use 'unlikely' to optimize it.
Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 9ccc140b82d2..93a7e8453a68 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -713,7 +713,7 @@ struct buffer_head *ext4_getblk(handle_t *handle, struct inode *inode, | |||
713 | return NULL; | 713 | return NULL; |
714 | 714 | ||
715 | bh = sb_getblk(inode->i_sb, map.m_pblk); | 715 | bh = sb_getblk(inode->i_sb, map.m_pblk); |
716 | if (!bh) { | 716 | if (unlikely(!bh)) { |
717 | *errp = -ENOMEM; | 717 | *errp = -ENOMEM; |
718 | return NULL; | 718 | return NULL; |
719 | } | 719 | } |
@@ -3660,7 +3660,7 @@ static int __ext4_get_inode_loc(struct inode *inode, | |||
3660 | iloc->offset = (inode_offset % inodes_per_block) * EXT4_INODE_SIZE(sb); | 3660 | iloc->offset = (inode_offset % inodes_per_block) * EXT4_INODE_SIZE(sb); |
3661 | 3661 | ||
3662 | bh = sb_getblk(sb, block); | 3662 | bh = sb_getblk(sb, block); |
3663 | if (!bh) | 3663 | if (unlikely(!bh)) |
3664 | return -ENOMEM; | 3664 | return -ENOMEM; |
3665 | if (!buffer_uptodate(bh)) { | 3665 | if (!buffer_uptodate(bh)) { |
3666 | lock_buffer(bh); | 3666 | lock_buffer(bh); |
@@ -3693,7 +3693,7 @@ static int __ext4_get_inode_loc(struct inode *inode, | |||
3693 | 3693 | ||
3694 | /* Is the inode bitmap in cache? */ | 3694 | /* Is the inode bitmap in cache? */ |
3695 | bitmap_bh = sb_getblk(sb, ext4_inode_bitmap(sb, gdp)); | 3695 | bitmap_bh = sb_getblk(sb, ext4_inode_bitmap(sb, gdp)); |
3696 | if (!bitmap_bh) | 3696 | if (unlikely(!bitmap_bh)) |
3697 | goto make_io; | 3697 | goto make_io; |
3698 | 3698 | ||
3699 | /* | 3699 | /* |