summaryrefslogtreecommitdiff
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2021-06-09 14:09:52 -0400
committerIlya Dryomov <idryomov@gmail.com>2021-06-29 00:15:52 +0200
commit7e65624d32b6e0429b1d3559e5585657f34f74a1 (patch)
tree65f0d6eb81fd2e14e9e1e7311dd82db4a04b0421 /fs/ceph/inode.c
parentdf2c0cb7f8e8c83e495260ad86df8c5da947f2a7 (diff)
ceph: allow ceph_put_mds_session to take NULL or ERR_PTR
...to simplify some error paths. Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Luis Henriques <lhenriques@suse.de> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index df0c8a724609..6f43542b3344 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1154,8 +1154,7 @@ static inline void update_dentry_lease(struct inode *dir, struct dentry *dentry,
__update_dentry_lease(dir, dentry, lease, session, from_time,
&old_lease_session);
spin_unlock(&dentry->d_lock);
- if (old_lease_session)
- ceph_put_mds_session(old_lease_session);
+ ceph_put_mds_session(old_lease_session);
}
/*
@@ -1200,8 +1199,7 @@ static void update_dentry_lease_careful(struct dentry *dentry,
from_time, &old_lease_session);
out_unlock:
spin_unlock(&dentry->d_lock);
- if (old_lease_session)
- ceph_put_mds_session(old_lease_session);
+ ceph_put_mds_session(old_lease_session);
}
/*