mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 13:41:51 +00:00
block/rnbd-srv: rename one member in rnbd_srv_dev
It actually represents the name of rnbd_srv_dev. Acked-by: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev> Link: https://lore.kernel.org/r/20230524070026.2932-6-guoqing.jiang@linux.dev Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
ba2eed1cf8
commit
3ecdbf9151
@ -180,7 +180,7 @@ static void destroy_device(struct kref *kref)
|
||||
|
||||
WARN_ONCE(!list_empty(&dev->sess_dev_list),
|
||||
"Device %s is being destroyed but still in use!\n",
|
||||
dev->id);
|
||||
dev->name);
|
||||
|
||||
spin_lock(&dev_lock);
|
||||
list_del(&dev->list);
|
||||
@ -431,7 +431,7 @@ static struct rnbd_srv_dev *rnbd_srv_init_srv_dev(struct block_device *bdev)
|
||||
if (!dev)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
snprintf(dev->id, sizeof(dev->id), "%pg", bdev);
|
||||
snprintf(dev->name, sizeof(dev->name), "%pg", bdev);
|
||||
kref_init(&dev->kref);
|
||||
INIT_LIST_HEAD(&dev->sess_dev_list);
|
||||
mutex_init(&dev->lock);
|
||||
@ -446,7 +446,7 @@ rnbd_srv_find_or_add_srv_dev(struct rnbd_srv_dev *new_dev)
|
||||
|
||||
spin_lock(&dev_lock);
|
||||
list_for_each_entry(dev, &dev_list, list) {
|
||||
if (!strncmp(dev->id, new_dev->id, sizeof(dev->id))) {
|
||||
if (!strncmp(dev->name, new_dev->name, sizeof(dev->name))) {
|
||||
if (!kref_get_unless_zero(&dev->kref))
|
||||
/*
|
||||
* We lost the race, device is almost dead.
|
||||
@ -481,7 +481,7 @@ static int rnbd_srv_check_update_open_perm(struct rnbd_srv_dev *srv_dev,
|
||||
ret = 0;
|
||||
} else {
|
||||
pr_err("Mapping device '%s' for session %s with RW permissions failed. Device already opened as 'RW' by %d client(s), access mode %s.\n",
|
||||
srv_dev->id, srv_sess->sessname,
|
||||
srv_dev->name, srv_sess->sessname,
|
||||
srv_dev->open_write_cnt,
|
||||
rnbd_access_modes[access_mode].str);
|
||||
}
|
||||
@ -492,14 +492,14 @@ static int rnbd_srv_check_update_open_perm(struct rnbd_srv_dev *srv_dev,
|
||||
ret = 0;
|
||||
} else {
|
||||
pr_err("Mapping device '%s' for session %s with migration permissions failed. Device already opened as 'RW' by %d client(s), access mode %s.\n",
|
||||
srv_dev->id, srv_sess->sessname,
|
||||
srv_dev->name, srv_sess->sessname,
|
||||
srv_dev->open_write_cnt,
|
||||
rnbd_access_modes[access_mode].str);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
pr_err("Received mapping request for device '%s' on session %s with invalid access mode: %d\n",
|
||||
srv_dev->id, srv_sess->sessname, access_mode);
|
||||
srv_dev->name, srv_sess->sessname, access_mode);
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
@ -774,7 +774,7 @@ static int process_msg_open(struct rnbd_srv_session *srv_sess,
|
||||
list_add(&srv_sess_dev->dev_list, &srv_dev->sess_dev_list);
|
||||
mutex_unlock(&srv_dev->lock);
|
||||
|
||||
rnbd_srv_info(srv_sess_dev, "Opened device '%s'\n", srv_dev->id);
|
||||
rnbd_srv_info(srv_sess_dev, "Opened device '%s'\n", srv_dev->name);
|
||||
|
||||
kfree(full_path);
|
||||
|
||||
|
@ -35,7 +35,7 @@ struct rnbd_srv_dev {
|
||||
struct kobject dev_kobj;
|
||||
struct kobject *dev_sessions_kobj;
|
||||
struct kref kref;
|
||||
char id[NAME_MAX];
|
||||
char name[NAME_MAX];
|
||||
/* List of rnbd_srv_sess_dev structs */
|
||||
struct list_head sess_dev_list;
|
||||
struct mutex lock;
|
||||
|
Loading…
Reference in New Issue
Block a user