瀏覽代碼

ceph: return proper bool type to caller instead of pointer

Change to return true/false only for bool type return code.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Chengguang Xu 7 年之前
父節點
當前提交
98cfda8104
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      fs/ceph/mds_client.c

+ 3 - 2
fs/ceph/mds_client.c

@@ -419,9 +419,10 @@ struct ceph_mds_session *__ceph_lookup_mds_session(struct ceph_mds_client *mdsc,
 
 
 static bool __have_session(struct ceph_mds_client *mdsc, int mds)
 static bool __have_session(struct ceph_mds_client *mdsc, int mds)
 {
 {
-	if (mds >= mdsc->max_sessions)
+	if (mds >= mdsc->max_sessions || !mdsc->sessions[mds])
 		return false;
 		return false;
-	return mdsc->sessions[mds];
+	else
+		return true;
 }
 }
 
 
 static int __verify_registered_session(struct ceph_mds_client *mdsc,
 static int __verify_registered_session(struct ceph_mds_client *mdsc,