mirror of https://gitee.com/openkylin/linux.git
block/rnbd: Kill rnbd_clt_destroy_default_group
No need to have it since we can call sysfs_remove_group in the rnbd_clt_destroy_sysfs_files. Then rnbd_clt_destroy_sysfs_files is paired with it's counterpart rnbd_clt_create_sysfs_files. Signed-off-by: Guoqing Jiang <guoqing.jiang@ionos.com> Reviewed-by: Danil Kipnis <danil.kipnis@ionos.com> Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com> Signed-off-by: Jack Wang <jinpu.wang@ionos.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Link: https://lore.kernel.org/r/20210419073722.15351-7-gi-oh.kim@ionos.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
d0a70ab10b
commit
8e43c90a26
|
@ -639,13 +639,9 @@ int rnbd_clt_create_sysfs_files(void)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rnbd_clt_destroy_default_group(void)
|
|
||||||
{
|
|
||||||
sysfs_remove_group(&rnbd_dev->kobj, &default_attr_group);
|
|
||||||
}
|
|
||||||
|
|
||||||
void rnbd_clt_destroy_sysfs_files(void)
|
void rnbd_clt_destroy_sysfs_files(void)
|
||||||
{
|
{
|
||||||
|
sysfs_remove_group(&rnbd_dev->kobj, &default_attr_group);
|
||||||
kobject_del(rnbd_devs_kobj);
|
kobject_del(rnbd_devs_kobj);
|
||||||
kobject_put(rnbd_devs_kobj);
|
kobject_put(rnbd_devs_kobj);
|
||||||
device_destroy(rnbd_dev_class, MKDEV(0, 0));
|
device_destroy(rnbd_dev_class, MKDEV(0, 0));
|
||||||
|
|
|
@ -1675,7 +1675,6 @@ static void rnbd_destroy_sessions(void)
|
||||||
struct rnbd_clt_dev *dev, *tn;
|
struct rnbd_clt_dev *dev, *tn;
|
||||||
|
|
||||||
/* Firstly forbid access through sysfs interface */
|
/* Firstly forbid access through sysfs interface */
|
||||||
rnbd_clt_destroy_default_group();
|
|
||||||
rnbd_clt_destroy_sysfs_files();
|
rnbd_clt_destroy_sysfs_files();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -159,7 +159,6 @@ int rnbd_clt_resize_disk(struct rnbd_clt_dev *dev, size_t newsize);
|
||||||
int rnbd_clt_create_sysfs_files(void);
|
int rnbd_clt_create_sysfs_files(void);
|
||||||
|
|
||||||
void rnbd_clt_destroy_sysfs_files(void);
|
void rnbd_clt_destroy_sysfs_files(void);
|
||||||
void rnbd_clt_destroy_default_group(void);
|
|
||||||
|
|
||||||
void rnbd_clt_remove_dev_symlink(struct rnbd_clt_dev *dev);
|
void rnbd_clt_remove_dev_symlink(struct rnbd_clt_dev *dev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue