diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2011-06-13 14:27:45 +0200 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2014-02-17 16:44:57 +0100 |
commit | 4bc760488c1e9c65c9f6dea1ae8a7b94b9eaebe1 (patch) | |
tree | 3ce56e7e187fac5571d825a00df163572ed71f92 /drivers/block/drbd/drbd_main.c | |
parent | 803ea1348e412a1e35cfbb891f4514b74e7af460 (diff) | |
download | linux-4bc760488c1e9c65c9f6dea1ae8a7b94b9eaebe1.tar.gz linux-4bc760488c1e9c65c9f6dea1ae8a7b94b9eaebe1.tar.bz2 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.c | 10 |
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, |