bdev/ftl: unlock g_ftl_bdev_lock before calls bdev_ftl_create
There is no need to hold g_ftl_bdev_lock when calling bdev_ftl_create. Besides, the functions (e.g. bdev_ftl_add_ctrlr) that called by bdev_ftl_create will lock g_ftl_bdev_lock again. Change-Id: I74751822364e16c58a3065dc78f8a4dce157e925 Signed-off-by: wuzhouhui <wuzhouhui@kingsoft.com> Reviewed-on: https://review.gerrithub.io/c/443066 Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
c778e3e54f
commit
a8fd4524d5
@ -833,10 +833,9 @@ bdev_ftl_init_bdev(struct ftl_bdev_init_opts *opts, ftl_bdev_init_fn cb, void *c
|
||||
/* Check already attached controllers first */
|
||||
LIST_FOREACH(ftl_ctrlr, &g_ftl_bdev_ctrlrs, list_entry) {
|
||||
if (!spdk_nvme_transport_id_compare(&ftl_ctrlr->trid, &opts->trid)) {
|
||||
rc = bdev_ftl_create(ftl_ctrlr->ctrlr, &ftl_ctrlr->trid, opts->name,
|
||||
&opts->range, opts->mode, &opts->uuid, cb, cb_arg);
|
||||
pthread_mutex_unlock(&g_ftl_bdev_lock);
|
||||
return rc;
|
||||
return bdev_ftl_create(ftl_ctrlr->ctrlr, &ftl_ctrlr->trid, opts->name,
|
||||
&opts->range, opts->mode, &opts->uuid, cb, cb_arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user