Remove now-unneeded open-coded unlikelies around IS_ERR().
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
nd->dentry = lookup_create(nd, is_dir);
nd->flags |= LOOKUP_PARENT;
- if (unlikely(IS_ERR(nd->dentry)))
+ if (IS_ERR(nd->dentry))
return PTR_ERR(nd->dentry);
if (!nd->dentry->d_inode)
*dentry = lookup_create(&nd, is_dir);
- if (unlikely(IS_ERR(*dentry)))
+ if (IS_ERR(*dentry))
return PTR_ERR(*dentry);
*parent_inode = (*dentry)->d_parent->d_inode;
return 0;
if (fd >= 0) {
struct file *f = filp_open(tmp, flags, mode);
error = PTR_ERR(f);
- if (unlikely(IS_ERR(f))) {
+ if (IS_ERR(f)) {
put_unused_fd(fd);
fd = error;
} else
/* Map, pin, and lock the mft record. */
mrec = map_mft_record(base_ni);
- if (unlikely(IS_ERR(mrec))) {
+ if (IS_ERR(mrec)) {
err = PTR_ERR(mrec);
goto err_out;
}
/* Map, pin, and lock the mft record. */
m = map_mft_record(base_ni);
- if (unlikely(IS_ERR(m))) {
+ if (IS_ERR(m)) {
err = PTR_ERR(m);
m = NULL;
ctx = NULL;
/* Map, pin, and lock the mft record. */
m = map_mft_record(base_ni);
- if (unlikely(IS_ERR(m))) {
+ if (IS_ERR(m)) {
err = PTR_ERR(m);
m = NULL;
ctx = NULL;
/* Check for silly calling... */
if (unlikely(!srl))
return drl;
- if (unlikely(IS_ERR(srl) || IS_ERR(drl)))
+ if (IS_ERR(srl) || IS_ERR(drl))
return ERR_PTR(-EINVAL);
/* Check for the case where the first mapping is being done now. */
rl = decompress_mapping_pairs(ni->vol, ctx->attr,
ni->run_list.rl);
- if (unlikely(IS_ERR(rl)))
+ if (IS_ERR(rl))
err = PTR_ERR(rl);
else
ni->run_list.rl = rl;
BUG_ON(NInoAttr(dir_ni));
/* Get hold of the mft record for the directory. */
m = map_mft_record(dir_ni);
- if (unlikely(IS_ERR(m))) {
+ if (IS_ERR(m)) {
ntfs_error(sb, "map_mft_record() failed with error code %ld.",
-PTR_ERR(m));
return ERR_MREF(PTR_ERR(m));
goto skip_index_root;
/* Get hold of the mft record for the directory. */
m = map_mft_record(ndir);
- if (unlikely(IS_ERR(m))) {
+ if (IS_ERR(m)) {
err = PTR_ERR(m);
m = NULL;
goto err_out;
if (unlikely(!bmp_vi)) {
ntfs_debug("Inode 0x%lx, regetting index bitmap.", vdir->i_ino);
bmp_vi = ntfs_attr_iget(vdir, AT_BITMAP, I30, 4);
- if (unlikely(IS_ERR(bmp_vi))) {
+ if (IS_ERR(bmp_vi)) {
ntfs_error(sb, "Failed to get bitmap attribute.");
err = PTR_ERR(bmp_vi);
goto err_out;
((PAGE_CACHE_SIZE * 8) - 1));
bmp_page = ntfs_map_page(bmp_mapping,
bmp_pos >> (3 + PAGE_CACHE_SHIFT));
- if (unlikely(IS_ERR(bmp_page))) {
+ if (IS_ERR(bmp_page)) {
ntfs_error(sb, "Reading index bitmap failed.");
err = PTR_ERR(bmp_page);
bmp_page = NULL;
* reading it from disk if necessary.
*/
ia_page = ntfs_map_page(ia_mapping, ia_pos >> PAGE_CACHE_SHIFT);
- if (unlikely(IS_ERR(ia_page))) {
+ if (IS_ERR(ia_page)) {
ntfs_error(sb, "Reading index allocation data failed.");
err = PTR_ERR(ia_page);
ia_page = NULL;
}
/* Get hold of the mft record for the index inode. */
m = map_mft_record(base_ni);
- if (unlikely(IS_ERR(m))) {
+ if (IS_ERR(m)) {
ntfs_error(sb, "map_mft_record() failed with error code %ld.",
-PTR_ERR(m));
return PTR_ERR(m);
ctx = NULL;
/* Get the index bitmap attribute inode. */
bvi = ntfs_attr_iget(vi, AT_BITMAP, I30, 4);
- if (unlikely(IS_ERR(bvi))) {
+ if (IS_ERR(bvi)) {
ntfs_error(vi->i_sb, "Failed to get bitmap attribute.");
err = PTR_ERR(bvi);
goto unm_err_out;
ctx = NULL;
/* Get the index bitmap attribute inode. */
bvi = ntfs_attr_iget(base_vi, AT_BITMAP, ni->name, ni->name_len);
- if (unlikely(IS_ERR(bvi))) {
+ if (IS_ERR(bvi)) {
ntfs_error(vi->i_sb, "Failed to get bitmap attribute.");
err = PTR_ERR(bvi);
goto unm_err_out;
}
/* Map, pin, and lock the mft record belonging to the inode. */
m = map_mft_record(ni);
- if (unlikely(IS_ERR(m))) {
+ if (IS_ERR(m)) {
err = PTR_ERR(m);
goto err_out;
}
MFT_RECORD *tm = map_mft_record(tni);
int ret;
- if (unlikely(IS_ERR(tm))) {
+ if (IS_ERR(tm)) {
if (!err || err == -ENOMEM)
err = PTR_ERR(tm);
continue;
ni->ext.base_ntfs_ino = base_ni;
/* Now map the record. */
m = map_mft_record(ni);
- if (unlikely(IS_ERR(m))) {
+ if (IS_ERR(m)) {
up(&base_ni->extent_lock);
atomic_dec(&base_ni->count);
ntfs_clear_extent_inode(ni);
/* Get the page containing the mirror copy of the mft record @m. */
page = ntfs_map_page(vol->mftmirr_ino->i_mapping, ni->mft_no >>
(PAGE_CACHE_SHIFT - vol->mft_record_size_bits));
- if (unlikely(IS_ERR(page))) {
+ if (IS_ERR(page)) {
ntfs_error(vol->sb, "Failed to map mft mirror page.");
err = PTR_ERR(page);
goto err_out;
ntfs_debug("Entering for inode 0x%lx.", vi->i_ino);
/* Get the mft record of the inode belonging to the child dentry. */
mrec = map_mft_record(ni);
- if (unlikely(IS_ERR(mrec)))
+ if (IS_ERR(mrec))
return (struct dentry *)mrec;
/* Find the first file name attribute in the mft record. */
ctx = get_attr_search_ctx(ni, mrec);
unmap_mft_record(ni);
/* Get the inode of the parent directory. */
parent_vi = ntfs_iget(vi->i_sb, parent_ino);
- if (unlikely(IS_ERR(parent_vi) || is_bad_inode(parent_vi))) {
+ if (IS_ERR(parent_vi) || unlikely(is_bad_inode(parent_vi))) {
if (!IS_ERR(parent_vi))
iput(parent_vi);
ntfs_error(vi->i_sb, "Failed to get parent directory inode "
ntfs_debug("Entering for inode 0x%lx, generation 0x%x.", ino, gen);
vi = ntfs_iget(sb, ino);
- if (unlikely(IS_ERR(vi))) {
+ if (IS_ERR(vi)) {
ntfs_error(sb, "Failed to get inode 0x%lx.", ino);
return (struct dentry *)vi;
}
/* First try to allocate memory, before doing anything with
* existing queues. */
msg_ptr = load_msg(u_msg_ptr, msg_len);
- if (unlikely(IS_ERR(msg_ptr))) {
+ if (IS_ERR(msg_ptr)) {
ret = PTR_ERR(msg_ptr);
goto out_fput;
}