Commit 15a798f7 authored by Kefeng Wang's avatar Kefeng Wang Committed by Andreas Gruenbacher

gfs2: Use IS_ERR_OR_NULL

Use IS_ERR_OR_NULL where appropriate.

(Several more places converted by Andreas.)
Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent 2a27b755
...@@ -750,7 +750,7 @@ static struct gfs2_dirent *gfs2_dirent_split_alloc(struct inode *inode, ...@@ -750,7 +750,7 @@ static struct gfs2_dirent *gfs2_dirent_split_alloc(struct inode *inode,
struct gfs2_dirent *dent; struct gfs2_dirent *dent;
dent = gfs2_dirent_scan(inode, bh->b_data, bh->b_size, dent = gfs2_dirent_scan(inode, bh->b_data, bh->b_size,
gfs2_dirent_find_offset, name, ptr); gfs2_dirent_find_offset, name, ptr);
if (!dent || IS_ERR(dent)) if (IS_ERR_OR_NULL(dent))
return dent; return dent;
return do_init_dirent(inode, dent, name, bh, return do_init_dirent(inode, dent, name, bh,
(unsigned)(ptr - (void *)dent)); (unsigned)(ptr - (void *)dent));
...@@ -854,7 +854,7 @@ static struct gfs2_dirent *gfs2_dirent_search(struct inode *inode, ...@@ -854,7 +854,7 @@ static struct gfs2_dirent *gfs2_dirent_search(struct inode *inode,
return ERR_PTR(error); return ERR_PTR(error);
dent = gfs2_dirent_scan(inode, bh->b_data, bh->b_size, scan, name, NULL); dent = gfs2_dirent_scan(inode, bh->b_data, bh->b_size, scan, name, NULL);
got_dent: got_dent:
if (unlikely(dent == NULL || IS_ERR(dent))) { if (IS_ERR_OR_NULL(dent)) {
brelse(bh); brelse(bh);
bh = NULL; bh = NULL;
} }
......
...@@ -681,7 +681,7 @@ static void delete_work_func(struct work_struct *work) ...@@ -681,7 +681,7 @@ static void delete_work_func(struct work_struct *work)
goto out; goto out;
inode = gfs2_lookup_by_inum(sdp, no_addr, NULL, GFS2_BLKST_UNLINKED); inode = gfs2_lookup_by_inum(sdp, no_addr, NULL, GFS2_BLKST_UNLINKED);
if (inode && !IS_ERR(inode)) { if (!IS_ERR_OR_NULL(inode)) {
d_prune_aliases(inode); d_prune_aliases(inode);
iput(inode); iput(inode);
} }
......
...@@ -793,7 +793,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, ...@@ -793,7 +793,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
fail_gunlock: fail_gunlock:
gfs2_dir_no_add(&da); gfs2_dir_no_add(&da);
gfs2_glock_dq_uninit(ghs); gfs2_glock_dq_uninit(ghs);
if (inode && !IS_ERR(inode)) { if (!IS_ERR_OR_NULL(inode)) {
clear_nlink(inode); clear_nlink(inode);
if (!free_vfs_inode) if (!free_vfs_inode)
mark_inode_dirty(inode); mark_inode_dirty(inode);
......
...@@ -576,7 +576,7 @@ static int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh) ...@@ -576,7 +576,7 @@ static int gfs2_jindex_hold(struct gfs2_sbd *sdp, struct gfs2_holder *ji_gh)
INIT_WORK(&jd->jd_work, gfs2_recover_func); INIT_WORK(&jd->jd_work, gfs2_recover_func);
jd->jd_inode = gfs2_lookupi(sdp->sd_jindex, &name, 1); jd->jd_inode = gfs2_lookupi(sdp->sd_jindex, &name, 1);
if (!jd->jd_inode || IS_ERR(jd->jd_inode)) { if (IS_ERR_OR_NULL(jd->jd_inode)) {
if (!jd->jd_inode) if (!jd->jd_inode)
error = -ENOENT; error = -ENOENT;
else else
......
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