summaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_main.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher2011-06-13 14:27:45 +0200
committerPhilipp Reisner2014-02-17 16:44:57 +0100
commit4bc760488c1e9c65c9f6dea1ae8a7b94b9eaebe1 (patch)
tree3ce56e7e187fac5571d825a00df163572ed71f92 /drivers/block/drbd/drbd_main.c
parentdrbd: Add struct drbd_resource->devices (diff)
downloadkernel-qcow2-linux-4bc760488c1e9c65c9f6dea1ae8a7b94b9eaebe1.tar.gz
kernel-qcow2-linux-4bc760488c1e9c65c9f6dea1ae8a7b94b9eaebe1.tar.xz
kernel-qcow2-linux-4bc760488c1e9c65c9f6dea1ae8a7b94b9eaebe1.zip
drbd: Replace conn_get_by_name() with drbd_find_resource()
So far, connections and resources always come in pairs, but in the future with multiple connections per resource, the names will stick with the resources. Signed-off-by: Andreas Gruenbacher <agruen@linbit.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_main.c')
-rw-r--r--drivers/block/drbd/drbd_main.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 92479bdc3e78..2be5355dede2 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2405,9 +2405,8 @@ static void drbd_init_workqueue(struct drbd_work_queue* wq)
init_waitqueue_head(&wq->q_wait);
}
-struct drbd_connection *conn_get_by_name(const char *name)
+struct drbd_resource *drbd_find_resource(const char *name)
{
- struct drbd_connection *connection;
struct drbd_resource *resource;
if (!name || !name[0])
@@ -2416,15 +2415,14 @@ struct drbd_connection *conn_get_by_name(const char *name)
rcu_read_lock();
for_each_resource_rcu(resource, &drbd_resources) {
if (!strcmp(resource->name, name)) {
- connection = first_connection(resource);
- kref_get(&connection->kref);
+ kref_get(&resource->kref);
goto found;
}
}
- connection = NULL;
+ resource = NULL;
found:
rcu_read_unlock();
- return connection;
+ return resource;
}
struct drbd_connection *conn_get_by_addrs(void *my_addr, int my_addr_len,