diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-02-21 15:38:08 +0100 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-10-14 16:47:59 +0200 |
commit | 1aba4d7fcfabe999e0c99683b394aa76d5c42842 (patch) | |
tree | f7d2cbff4aba926e8d7134bc68ed4904989b5b6b /drivers/block/drbd/drbd_main.c | |
parent | 2f5cdd0b2cf7a4099faa7e53ba0a29ddf0ddf950 (diff) | |
download | lwn-1aba4d7fcfabe999e0c99683b394aa76d5c42842.tar.gz lwn-1aba4d7fcfabe999e0c99683b394aa76d5c42842.zip |
drbd: Preparing the connector interface to operator on connections
Up to now it only operated on minor numbers. Now it can work also
on named connections.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_main.c')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index cbec5ff2cc74..4761426f9ad7 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -2196,6 +2196,21 @@ static void drbd_init_workqueue(struct drbd_work_queue* wq) INIT_LIST_HEAD(&wq->q); } +struct drbd_tconn *conn_by_name(const char *name) +{ + struct drbd_tconn *tconn; + + write_lock_irq(&global_state_lock); + list_for_each_entry(tconn, &drbd_tconns, all_tconn) { + if (!strcmp(tconn->name, name)) + goto found; + } + tconn = NULL; +found: + write_unlock_irq(&global_state_lock); + return tconn; +} + struct drbd_tconn *drbd_new_tconn(char *name) { struct drbd_tconn *tconn; |