ceph: remove unneeded test in try_flush_caps
authorJeff Layton <jlayton@kernel.org>
Fri, 5 Jul 2019 17:26:29 +0000 (13:26 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 16 Sep 2019 10:06:24 +0000 (12:06 +0200)
cap->session is always non-NULL, so we can just do a single test for
equality w/o testing explicitly for a NULL pointer.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/caps.c

index 6b8300d..bb91aba 100644 (file)
@@ -2114,7 +2114,7 @@ retry_locked:
                struct ceph_cap *cap = ci->i_auth_cap;
                int delayed;
 
-               if (!session || session != cap->session) {
+               if (session != cap->session) {
                        spin_unlock(&ci->i_ceph_lock);
                        if (session)
                                mutex_unlock(&session->s_mutex);