Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b0542a4 authored by Wang Shilong's avatar Wang Shilong Committed by Jan Kara
Browse files

Ext2: 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: default avatarWang shilong <wangsl-fnst@cn.fujitsu.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 61f43e68
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1500,7 +1500,7 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
			bh = sb_bread(sb, tmp_bh.b_blocknr);
		else
			bh = sb_getblk(sb, tmp_bh.b_blocknr);
		if (!bh) {
		if (unlikely(!bh)) {
			err = -EIO;
			goto out;
		}
+1 −1
Original line number Diff line number Diff line
@@ -662,7 +662,7 @@ ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
			ea_idebug(inode, "creating block %d", block);

			new_bh = sb_getblk(sb, block);
			if (!new_bh) {
			if (unlikely(!new_bh)) {
				ext2_free_blocks(inode, block, 1);
				mark_inode_dirty(inode);
				error = -EIO;