Commit cc22c800 authored by Denis Efremov's avatar Denis Efremov Committed by Linus Torvalds

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.comSigned-off-by: default avatarDenis Efremov <efremov@linux.com>
Cc: Anton Altaparmakov <anton@tuxera.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7b0b6925
...@@ -71,7 +71,7 @@ static inline MFT_RECORD *map_mft_record_page(ntfs_inode *ni) ...@@ -71,7 +71,7 @@ static inline MFT_RECORD *map_mft_record_page(ntfs_inode *ni)
} }
/* Read, map, and pin the page. */ /* Read, map, and pin the page. */
page = ntfs_map_page(mft_vi->i_mapping, index); page = ntfs_map_page(mft_vi->i_mapping, index);
if (likely(!IS_ERR(page))) { if (!IS_ERR(page)) {
/* Catch multi sector transfer fixup errors. */ /* Catch multi sector transfer fixup errors. */
if (likely(ntfs_is_mft_recordp((le32*)(page_address(page) + if (likely(ntfs_is_mft_recordp((le32*)(page_address(page) +
ofs)))) { ofs)))) {
...@@ -154,7 +154,7 @@ MFT_RECORD *map_mft_record(ntfs_inode *ni) ...@@ -154,7 +154,7 @@ MFT_RECORD *map_mft_record(ntfs_inode *ni)
mutex_lock(&ni->mrec_lock); mutex_lock(&ni->mrec_lock);
m = map_mft_record_page(ni); m = map_mft_record_page(ni);
if (likely(!IS_ERR(m))) if (!IS_ERR(m))
return m; return m;
mutex_unlock(&ni->mrec_lock); mutex_unlock(&ni->mrec_lock);
...@@ -271,7 +271,7 @@ MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref, ...@@ -271,7 +271,7 @@ MFT_RECORD *map_extent_mft_record(ntfs_inode *base_ni, MFT_REF mref,
m = map_mft_record(ni); m = map_mft_record(ni);
/* map_mft_record() has incremented this on success. */ /* map_mft_record() has incremented this on success. */
atomic_dec(&ni->count); atomic_dec(&ni->count);
if (likely(!IS_ERR(m))) { if (!IS_ERR(m)) {
/* Verify the sequence number. */ /* Verify the sequence number. */
if (likely(le16_to_cpu(m->sequence_number) == seq_no)) { if (likely(le16_to_cpu(m->sequence_number) == seq_no)) {
ntfs_debug("Done 1."); ntfs_debug("Done 1.");
...@@ -1303,7 +1303,7 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol) ...@@ -1303,7 +1303,7 @@ static int ntfs_mft_bitmap_extend_allocation_nolock(ntfs_volume *vol)
read_unlock_irqrestore(&mftbmp_ni->size_lock, flags); read_unlock_irqrestore(&mftbmp_ni->size_lock, flags);
rl = ntfs_attr_find_vcn_nolock(mftbmp_ni, rl = ntfs_attr_find_vcn_nolock(mftbmp_ni,
(ll - 1) >> vol->cluster_size_bits, NULL); (ll - 1) >> vol->cluster_size_bits, NULL);
if (unlikely(IS_ERR(rl) || !rl->length || rl->lcn < 0)) { if (IS_ERR(rl) || unlikely(!rl->length || rl->lcn < 0)) {
up_write(&mftbmp_ni->runlist.lock); up_write(&mftbmp_ni->runlist.lock);
ntfs_error(vol->sb, "Failed to determine last allocated " ntfs_error(vol->sb, "Failed to determine last allocated "
"cluster of mft bitmap attribute."); "cluster of mft bitmap attribute.");
...@@ -1734,7 +1734,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol) ...@@ -1734,7 +1734,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol)
read_unlock_irqrestore(&mft_ni->size_lock, flags); read_unlock_irqrestore(&mft_ni->size_lock, flags);
rl = ntfs_attr_find_vcn_nolock(mft_ni, rl = ntfs_attr_find_vcn_nolock(mft_ni,
(ll - 1) >> vol->cluster_size_bits, NULL); (ll - 1) >> vol->cluster_size_bits, NULL);
if (unlikely(IS_ERR(rl) || !rl->length || rl->lcn < 0)) { if (IS_ERR(rl) || unlikely(!rl->length || rl->lcn < 0)) {
up_write(&mft_ni->runlist.lock); up_write(&mft_ni->runlist.lock);
ntfs_error(vol->sb, "Failed to determine last allocated " ntfs_error(vol->sb, "Failed to determine last allocated "
"cluster of mft data attribute."); "cluster of mft data attribute.");
...@@ -1776,7 +1776,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol) ...@@ -1776,7 +1776,7 @@ static int ntfs_mft_data_extend_allocation_nolock(ntfs_volume *vol)
do { do {
rl2 = ntfs_cluster_alloc(vol, old_last_vcn, nr, lcn, MFT_ZONE, rl2 = ntfs_cluster_alloc(vol, old_last_vcn, nr, lcn, MFT_ZONE,
true); true);
if (likely(!IS_ERR(rl2))) if (!IS_ERR(rl2))
break; break;
if (PTR_ERR(rl2) != -ENOSPC || nr == min_nr) { if (PTR_ERR(rl2) != -ENOSPC || nr == min_nr) {
ntfs_error(vol->sb, "Failed to allocate the minimal " ntfs_error(vol->sb, "Failed to allocate the minimal "
......
...@@ -115,7 +115,7 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent, ...@@ -115,7 +115,7 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent,
dent_ino = MREF(mref); dent_ino = MREF(mref);
ntfs_debug("Found inode 0x%lx. Calling ntfs_iget.", dent_ino); ntfs_debug("Found inode 0x%lx. Calling ntfs_iget.", dent_ino);
dent_inode = ntfs_iget(vol->sb, dent_ino); dent_inode = ntfs_iget(vol->sb, dent_ino);
if (likely(!IS_ERR(dent_inode))) { if (!IS_ERR(dent_inode)) {
/* Consistency check. */ /* Consistency check. */
if (is_bad_inode(dent_inode) || MSEQNO(mref) == if (is_bad_inode(dent_inode) || MSEQNO(mref) ==
NTFS_I(dent_inode)->seq_no || NTFS_I(dent_inode)->seq_no ||
......
...@@ -951,7 +951,7 @@ runlist_element *ntfs_mapping_pairs_decompress(const ntfs_volume *vol, ...@@ -951,7 +951,7 @@ runlist_element *ntfs_mapping_pairs_decompress(const ntfs_volume *vol,
} }
/* Now combine the new and old runlists checking for overlaps. */ /* Now combine the new and old runlists checking for overlaps. */
old_rl = ntfs_runlists_merge(old_rl, rl); old_rl = ntfs_runlists_merge(old_rl, rl);
if (likely(!IS_ERR(old_rl))) if (!IS_ERR(old_rl))
return old_rl; return old_rl;
ntfs_free(rl); ntfs_free(rl);
ntfs_error(vol->sb, "Failed to merge runlists."); ntfs_error(vol->sb, "Failed to merge runlists.");
......
...@@ -1475,7 +1475,7 @@ static bool load_and_init_usnjrnl(ntfs_volume *vol) ...@@ -1475,7 +1475,7 @@ static bool load_and_init_usnjrnl(ntfs_volume *vol)
kfree(name); kfree(name);
/* Get the inode. */ /* Get the inode. */
tmp_ino = ntfs_iget(vol->sb, MREF(mref)); tmp_ino = ntfs_iget(vol->sb, MREF(mref));
if (unlikely(IS_ERR(tmp_ino) || is_bad_inode(tmp_ino))) { if (IS_ERR(tmp_ino) || unlikely(is_bad_inode(tmp_ino))) {
if (!IS_ERR(tmp_ino)) if (!IS_ERR(tmp_ino))
iput(tmp_ino); iput(tmp_ino);
ntfs_error(vol->sb, "Failed to load $UsnJrnl."); ntfs_error(vol->sb, "Failed to load $UsnJrnl.");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment