diff options
author | Denis Efremov <efremov@linux.com> | 2019-09-25 19:49:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-26 13:10:44 -0400 |
commit | cc22c800e15b03c87f0e97400f75eba998e75c6a (patch) | |
tree | 437eeb0056fa689d9ea01d82f1ae7254e1e85264 | |
parent | 7b0b69259433fc1758408a899224db4fcc41b865 (diff) |
ntfs: remove (un)?likely() from IS_ERR() conditions
"likely(!IS_ERR(x))" is excessive. IS_ERR() already uses
unlikely() internally.
Link: http://lkml.kernel.org/r/20190829165025.15750-11-efremov@linux.com
Signed-off-by: Denis Efremov <efremov@linux.com>
Cc: Anton Altaparmakov <anton@tuxera.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/ntfs/mft.c | 12 | ||||
-rw-r--r-- | fs/ntfs/namei.c | 2 | ||||
-rw-r--r-- | fs/ntfs/runlist.c | 2 | ||||
-rw-r--r-- | fs/ntfs/super.c | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 20c841a906f2..3aac5c917afe 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c | |||
@@ -71,7 +71,7 @@ static inline MFT_RECORD *map_mft_record_page(ntfs_inode *ni) | |||
71 | } | 71 | } |
72 | /* Read, map, and pin the page. */ | 72 | /* Read, map, and pin the page. */ |
73 | page = ntfs_map_page(mft_vi->i_mapping, index); | 73 | page = ntfs_map_page(mft_vi->i_mapping, index); |
74 | if (likely(!IS_ERR(page))) { | 74 | if (!IS_ERR(page)) { |
75 | /* Catch multi sector transfer fixup errors. */ | 75 | /* Catch multi sector transfer fixup errors. */ |
76 | if (likely(ntfs_is_mft_recordp((le32*)(page_address(page) + | 76 | if (likely(ntfs_is_mft_recordp((le32*)(page_address(page) + |
77 | ofs)))) { | 77 | ofs)))) { |
@@ -154,7 +154,7 @@ MFT_RECORD *map_mft_record(ntfs_inode *ni) | |||
154 | mutex_lock(&ni->mrec_lock); | 154 | mutex_lock(&ni->mrec_lock); |
155 | 155 | ||
156 | m = map_mft_record_page(ni); | 156 | m = map_mft_record_page(ni); |
157 | if (likely(!IS_ERR(m))) | 157 | if (!IS_ERR(m)) |
158 | return m; | 158 | return m; |
159 | 159 | ||
160 | mutex_unlock(&ni->mrec_lock); | 160 | mutex_unlock(&ni->mrec_lock); |
@@ -271,7 +271,7 @@ MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref, | |||
271 | m = map_mft_record(ni); | 271 | m = map_mft_record(ni); |
272 | /* map_mft_record() has incremented this on success. */ | 272 | /* map_mft_record() has incremented this on success. */ |
273 | atomic_dec(&ni->count); | 273 | atomic_dec(&ni->count); |
274 | if (likely(!IS_ERR(m))) { | 274 | if (!IS_ERR(m)) { |
275 | /* Verify the sequence number. */ | 275 | /* Verify the sequence number. */ |
276 | if (likely(le16_to_cpu(m->sequence_number) == seq_no)) { | 276 | if (likely(le16_to_cpu(m->sequence_number) == seq_no)) { |
277 | ntfs_debug("Done 1."); | 277 | ntfs_debug("Done 1."); |
@@ -1303,7 +1303,7 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol) | |||
1303 | read_unlock_irqrestore(&mftbmp_ni->size_lock, flags); | 1303 | read_unlock_irqrestore(&mftbmp_ni->size_lock, flags); |
1304 | rl = ntfs_attr_find_vcn_nolock(mftbmp_ni, | 1304 | rl = ntfs_attr_find_vcn_nolock(mftbmp_ni, |
1305 | (ll - 1) >> vol->cluster_size_bits, NULL); | 1305 | (ll - 1) >> vol->cluster_size_bits, NULL); |
1306 | if (unlikely(IS_ERR(rl) || !rl->length || rl->lcn < 0)) { | 1306 | if (IS_ERR(rl) || unlikely(!rl->length || rl->lcn < 0)) { |
1307 | up_write(&mftbmp_ni->runlist.lock); | 1307 | up_write(&mftbmp_ni->runlist.lock); |
1308 | ntfs_error(vol->sb, "Failed to determine last allocated " | 1308 | ntfs_error(vol->sb, "Failed to determine last allocated " |
1309 | "cluster of mft bitmap attribute."); | 1309 | "cluster of mft bitmap attribute."); |
@@ -1734,7 +1734,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol) | |||
1734 | read_unlock_irqrestore(&mft_ni->size_lock, flags); | 1734 | read_unlock_irqrestore(&mft_ni->size_lock, flags); |
1735 | rl = ntfs_attr_find_vcn_nolock(mft_ni, | 1735 | rl = ntfs_attr_find_vcn_nolock(mft_ni, |
1736 | (ll - 1) >> vol->cluster_size_bits, NULL); | 1736 | (ll - 1) >> vol->cluster_size_bits, NULL); |
1737 | if (unlikely(IS_ERR(rl) || !rl->length || rl->lcn < 0)) { | 1737 | if (IS_ERR(rl) || unlikely(!rl->length || rl->lcn < 0)) { |
1738 | up_write(&mft_ni->runlist.lock); | 1738 | up_write(&mft_ni->runlist.lock); |
1739 | ntfs_error(vol->sb, "Failed to determine last allocated " | 1739 | ntfs_error(vol->sb, "Failed to determine last allocated " |
1740 | "cluster of mft data attribute."); | 1740 | "cluster of mft data attribute."); |
@@ -1776,7 +1776,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol) | |||
1776 | do { | 1776 | do { |
1777 | rl2 = ntfs_cluster_alloc(vol, old_last_vcn, nr, lcn, MFT_ZONE, | 1777 | rl2 = ntfs_cluster_alloc(vol, old_last_vcn, nr, lcn, MFT_ZONE, |
1778 | true); | 1778 | true); |
1779 | if (likely(!IS_ERR(rl2))) | 1779 | if (!IS_ERR(rl2)) |
1780 | break; | 1780 | break; |
1781 | if (PTR_ERR(rl2) != -ENOSPC || nr == min_nr) { | 1781 | if (PTR_ERR(rl2) != -ENOSPC || nr == min_nr) { |
1782 | ntfs_error(vol->sb, "Failed to allocate the minimal " | 1782 | ntfs_error(vol->sb, "Failed to allocate the minimal " |
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c index 2d3cc9e3395d..4e6a44bc654c 100644 --- a/fs/ntfs/namei.c +++ b/fs/ntfs/namei.c | |||
@@ -115,7 +115,7 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent, | |||
115 | dent_ino = MREF(mref); | 115 | dent_ino = MREF(mref); |
116 | ntfs_debug("Found inode 0x%lx. Calling ntfs_iget.", dent_ino); | 116 | ntfs_debug("Found inode 0x%lx. Calling ntfs_iget.", dent_ino); |
117 | dent_inode = ntfs_iget(vol->sb, dent_ino); | 117 | dent_inode = ntfs_iget(vol->sb, dent_ino); |
118 | if (likely(!IS_ERR(dent_inode))) { | 118 | if (!IS_ERR(dent_inode)) { |
119 | /* Consistency check. */ | 119 | /* Consistency check. */ |
120 | if (is_bad_inode(dent_inode) || MSEQNO(mref) == | 120 | if (is_bad_inode(dent_inode) || MSEQNO(mref) == |
121 | NTFS_I(dent_inode)->seq_no || | 121 | NTFS_I(dent_inode)->seq_no || |
diff --git a/fs/ntfs/runlist.c b/fs/ntfs/runlist.c index 508744a93180..97932fb5179c 100644 --- a/fs/ntfs/runlist.c +++ b/fs/ntfs/runlist.c | |||
@@ -951,7 +951,7 @@ mpa_err: | |||
951 | } | 951 | } |
952 | /* Now combine the new and old runlists checking for overlaps. */ | 952 | /* Now combine the new and old runlists checking for overlaps. */ |
953 | old_rl = ntfs_runlists_merge(old_rl, rl); | 953 | old_rl = ntfs_runlists_merge(old_rl, rl); |
954 | if (likely(!IS_ERR(old_rl))) | 954 | if (!IS_ERR(old_rl)) |
955 | return old_rl; | 955 | return old_rl; |
956 | ntfs_free(rl); | 956 | ntfs_free(rl); |
957 | ntfs_error(vol->sb, "Failed to merge runlists."); | 957 | ntfs_error(vol->sb, "Failed to merge runlists."); |
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 29621d40f448..7dc3bc604f78 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
@@ -1475,7 +1475,7 @@ not_enabled: | |||
1475 | kfree(name); | 1475 | kfree(name); |
1476 | /* Get the inode. */ | 1476 | /* Get the inode. */ |
1477 | tmp_ino = ntfs_iget(vol->sb, MREF(mref)); | 1477 | tmp_ino = ntfs_iget(vol->sb, MREF(mref)); |
1478 | if (unlikely(IS_ERR(tmp_ino) || is_bad_inode(tmp_ino))) { | 1478 | if (IS_ERR(tmp_ino) || unlikely(is_bad_inode(tmp_ino))) { |
1479 | if (!IS_ERR(tmp_ino)) | 1479 | if (!IS_ERR(tmp_ino)) |
1480 | iput(tmp_ino); | 1480 | iput(tmp_ino); |
1481 | ntfs_error(vol->sb, "Failed to load $UsnJrnl."); | 1481 | ntfs_error(vol->sb, "Failed to load $UsnJrnl."); |