Merge tag 'ceph-for-5.19-rc1' of https://github.com/ceph/ceph-client
[linux-2.6-microblaze.git] / drivers / block / rbd.c
index 2b21f71..ef9bc62 100644 (file)
@@ -756,24 +756,23 @@ static struct rbd_client *__rbd_get_client(struct rbd_client *rbdc)
  */
 static struct rbd_client *rbd_client_find(struct ceph_options *ceph_opts)
 {
-       struct rbd_client *client_node;
-       bool found = false;
+       struct rbd_client *rbdc = NULL, *iter;
 
        if (ceph_opts->flags & CEPH_OPT_NOSHARE)
                return NULL;
 
        spin_lock(&rbd_client_list_lock);
-       list_for_each_entry(client_node, &rbd_client_list, node) {
-               if (!ceph_compare_options(ceph_opts, client_node->client)) {
-                       __rbd_get_client(client_node);
+       list_for_each_entry(iter, &rbd_client_list, node) {
+               if (!ceph_compare_options(ceph_opts, iter->client)) {
+                       __rbd_get_client(iter);
 
-                       found = true;
+                       rbdc = iter;
                        break;
                }
        }
        spin_unlock(&rbd_client_list_lock);
 
-       return found ? client_node : NULL;
+       return rbdc;
 }
 
 /*