diff options
author | SF Markus Elfring <elfring@users.sourceforge.net> | 2014-11-02 15:20:59 +0100 |
---|---|---|
committer | Ilya Dryomov <idryomov@redhat.com> | 2014-12-17 18:09:50 +0100 |
commit | e96a650a8174e20112b400e72e0b2429aa66de20 (patch) | |
tree | 44fa588afe9ee1b9504016e012c3dcffb184b87b /fs/ceph/mds_client.c | |
parent | ceph: introduce a new inode flag indicating if cached dentries are ordered (diff) | |
download | linux-e96a650a8174e20112b400e72e0b2429aa66de20.tar.xz linux-e96a650a8174e20112b400e72e0b2429aa66de20.zip |
ceph, rbd: delete unnecessary checks before two function calls
The functions ceph_put_snap_context() and iput() test whether their
argument is NULL and then return immediately. Thus the test around the
call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[idryomov@redhat.com: squashed rbd.c hunk, changelog]
Signed-off-by: Ilya Dryomov <idryomov@redhat.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r-- | fs/ceph/mds_client.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 5a47ed760e6d..fc74617069a3 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -524,8 +524,7 @@ void ceph_mdsc_release_request(struct kref *kref) } if (req->r_locked_dir) ceph_put_cap_refs(ceph_inode(req->r_locked_dir), CEPH_CAP_PIN); - if (req->r_target_inode) - iput(req->r_target_inode); + iput(req->r_target_inode); if (req->r_dentry) dput(req->r_dentry); if (req->r_old_dentry) @@ -1066,8 +1065,7 @@ out: session->s_cap_iterator = NULL; spin_unlock(&session->s_cap_lock); - if (last_inode) - iput(last_inode); + iput(last_inode); if (old_cap) ceph_put_cap(session->s_mdsc, old_cap); |