staging: lustre: llite: Remove IS_ERR tests

ll_iget() has been modified to always return NULL in case of error and
not a ERR_PTR.

Consequently, remove unnecessary IS_ERR tests as now ll_iget()
function can never return a ERR_PTR.

Additionally, reinitialising root and inode to NULL has been removed
since they have already been tested for the same.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Amitoj Kaur Chawla 2016-02-21 11:34:48 +05:30 committed by Greg Kroah-Hartman
parent b1752e864f
commit 020ecc6f32
2 changed files with 5 additions and 7 deletions

View File

@ -496,7 +496,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
md_free_lustre_md(sbi->ll_md_exp, &lmd); md_free_lustre_md(sbi->ll_md_exp, &lmd);
ptlrpc_req_finished(request); ptlrpc_req_finished(request);
if (IS_ERR_OR_NULL(root)) { if (!(root)) {
if (lmd.lsm) if (lmd.lsm)
obd_free_memmd(sbi->ll_dt_exp, &lmd.lsm); obd_free_memmd(sbi->ll_dt_exp, &lmd.lsm);
#ifdef CONFIG_FS_POSIX_ACL #ifdef CONFIG_FS_POSIX_ACL
@ -505,8 +505,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
lmd.posix_acl = NULL; lmd.posix_acl = NULL;
} }
#endif #endif
err = IS_ERR(root) ? PTR_ERR(root) : -EBADF; err = -EBADF;
root = NULL;
CERROR("lustre_lite: bad iget4 for root\n"); CERROR("lustre_lite: bad iget4 for root\n");
goto out_root; goto out_root;
} }
@ -1983,15 +1982,14 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
*inode = ll_iget(sb, cl_fid_build_ino(&md.body->fid1, *inode = ll_iget(sb, cl_fid_build_ino(&md.body->fid1,
sbi->ll_flags & LL_SBI_32BIT_API), sbi->ll_flags & LL_SBI_32BIT_API),
&md); &md);
if (IS_ERR_OR_NULL(*inode)) { if (!inode) {
#ifdef CONFIG_FS_POSIX_ACL #ifdef CONFIG_FS_POSIX_ACL
if (md.posix_acl) { if (md.posix_acl) {
posix_acl_release(md.posix_acl); posix_acl_release(md.posix_acl);
md.posix_acl = NULL; md.posix_acl = NULL;
} }
#endif #endif
rc = IS_ERR(*inode) ? PTR_ERR(*inode) : -ENOMEM; rc = -ENOMEM;
*inode = NULL;
CERROR("new_inode -fatal: rc %d\n", rc); CERROR("new_inode -fatal: rc %d\n", rc);
goto out; goto out;
} }

View File

@ -127,7 +127,7 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,
} }
if (rc != 0) { if (rc != 0) {
iget_failed(inode); iget_failed(inode);
inode = ERR_PTR(rc); inode = NULL;
} else } else
unlock_new_inode(inode); unlock_new_inode(inode);
} else if (!(inode->i_state & (I_FREEING | I_CLEAR))) } else if (!(inode->i_state & (I_FREEING | I_CLEAR)))