scst_vdisk: Convert several comments into lockdep_assert_held() statements

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9387 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2021-05-15 02:33:31 +00:00
parent e7a705fcd8
commit 1b7fe6422c

View File

@@ -714,13 +714,14 @@ out:
return res;
}
/* scst_vdisk_mutex supposed to be held */
static struct scst_vdisk_dev *vdev_find(const char *name)
{
struct scst_vdisk_dev *res, *vv;
TRACE_ENTRY();
lockdep_assert_held(&scst_vdisk_mutex);
res = NULL;
list_for_each_entry(vv, &vdev_list, vdev_list_entry) {
if (strcmp(vv->name, name) == 0) {
@@ -6832,7 +6833,6 @@ static void vdev_inq_changed_fn(struct work_struct *work)
return;
}
/* scst_vdisk_mutex supposed to be held */
static int vdev_create_node(struct scst_dev_type *devt,
const char *name, int nodeid, struct scst_vdisk_dev **res_virt_dev)
{
@@ -6840,6 +6840,8 @@ static int vdev_create_node(struct scst_dev_type *devt,
struct scst_vdisk_dev *virt_dev, *vv;
uint64_t dev_id_num;
lockdep_assert_held(&scst_vdisk_mutex);
res = -EEXIST;
if (vdev_find(name))
goto out;
@@ -7239,7 +7241,6 @@ out:
return res;
}
/* scst_vdisk_mutex supposed to be held */
static int vdev_fileio_add_device(const char *device_name, char *params)
{
int res = 0;
@@ -7247,6 +7248,8 @@ static int vdev_fileio_add_device(const char *device_name, char *params)
TRACE_ENTRY();
lockdep_assert_held(&scst_vdisk_mutex);
res = vdev_create(&vdisk_file_devtype, device_name, &virt_dev);
if (res != 0)
goto out;
@@ -7302,7 +7305,6 @@ out_destroy:
goto out;
}
/* scst_vdisk_mutex supposed to be held */
static int vdev_blockio_add_device(const char *device_name, char *params)
{
int res = 0;
@@ -7310,6 +7312,8 @@ static int vdev_blockio_add_device(const char *device_name, char *params)
TRACE_ENTRY();
lockdep_assert_held(&scst_vdisk_mutex);
res = vdev_create(&vdisk_blk_devtype, device_name, &virt_dev);
if (res != 0)
goto out;
@@ -7366,7 +7370,6 @@ out_destroy:
goto out;
}
/* scst_vdisk_mutex supposed to be held */
static int vdev_nullio_add_device(const char *device_name, char *params)
{
int res = 0;
@@ -7374,6 +7377,8 @@ static int vdev_nullio_add_device(const char *device_name, char *params)
TRACE_ENTRY();
lockdep_assert_held(&scst_vdisk_mutex);
res = vdev_create(&vdisk_null_devtype, device_name, &virt_dev);
if (res != 0)
goto out;
@@ -7490,11 +7495,12 @@ static void vdev_on_free(struct scst_device *dev, void *arg)
cancel_work_sync(&virt_dev->vdev_inq_changed_work);
}
/* scst_vdisk_mutex supposed to be held */
static void vdev_del_device(struct scst_vdisk_dev *virt_dev)
{
TRACE_ENTRY();
lockdep_assert_held(&scst_vdisk_mutex);
scst_unregister_virtual_device(virt_dev->virt_id, vdev_on_free,
virt_dev);
@@ -7537,7 +7543,6 @@ out:
return res;
}
/* scst_vdisk_mutex supposed to be held */
static ssize_t __vcdrom_add_device(const char *device_name, char *params)
{
int res = 0;
@@ -7545,6 +7550,8 @@ static ssize_t __vcdrom_add_device(const char *device_name, char *params)
TRACE_ENTRY();
lockdep_assert_held(&scst_vdisk_mutex);
res = vdev_create(&vcdrom_devtype, device_name, &virt_dev);
if (res != 0)
goto out;