Skip to content

Commit f3cd2c5

Browse files
asjkdave
authored andcommitted
btrfs: sysfs, rename device_link add/remove functions
Since commit 668e48a ("btrfs: sysfs, add devid/dev_state kobject and device attributes"), the functions btrfs_sysfs_add_device_link() and btrfs_sysfs_rm_device_link() do more than just adding and removing the device link as its name indicated. Rename them to be more specific that's about the directory with the attirbutes Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 1f6087e commit f3cd2c5

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

fs/btrfs/dev-replace.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ static int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,
512512
atomic64_set(&dev_replace->num_uncorrectable_read_errors, 0);
513513
up_write(&dev_replace->rwsem);
514514

515-
ret = btrfs_sysfs_add_device_link(tgt_device->fs_devices, tgt_device);
515+
ret = btrfs_sysfs_add_devices_dir(tgt_device->fs_devices, tgt_device);
516516
if (ret)
517517
btrfs_err(fs_info, "kobj add dev failed %d", ret);
518518

@@ -743,7 +743,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
743743
mutex_unlock(&fs_info->fs_devices->device_list_mutex);
744744

745745
/* replace the sysfs entry */
746-
btrfs_sysfs_rm_device_link(fs_info->fs_devices, src_device);
746+
btrfs_sysfs_remove_devices_dir(fs_info->fs_devices, src_device);
747747
btrfs_sysfs_update_devid(tgt_device);
748748
btrfs_rm_dev_replace_free_srcdev(src_device);
749749

fs/btrfs/sysfs.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info)
960960
addrm_unknown_feature_attrs(fs_info, false);
961961
sysfs_remove_group(&fs_info->fs_devices->fsid_kobj, &btrfs_feature_attr_group);
962962
sysfs_remove_files(&fs_info->fs_devices->fsid_kobj, btrfs_attrs);
963-
btrfs_sysfs_rm_device_link(fs_info->fs_devices, NULL);
963+
btrfs_sysfs_remove_devices_dir(fs_info->fs_devices, NULL);
964964
}
965965

966966
static const char * const btrfs_feature_set_names[FEAT_MAX] = {
@@ -1149,7 +1149,7 @@ int btrfs_sysfs_add_space_info_type(struct btrfs_fs_info *fs_info,
11491149

11501150
/* when one_device is NULL, it removes all device links */
11511151

1152-
int btrfs_sysfs_rm_device_link(struct btrfs_fs_devices *fs_devices,
1152+
int btrfs_sysfs_remove_devices_dir(struct btrfs_fs_devices *fs_devices,
11531153
struct btrfs_device *one_device)
11541154
{
11551155
struct hd_struct *disk;
@@ -1269,7 +1269,7 @@ static struct kobj_type devid_ktype = {
12691269
.release = btrfs_release_devid_kobj,
12701270
};
12711271

1272-
int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
1272+
int btrfs_sysfs_add_devices_dir(struct btrfs_fs_devices *fs_devices,
12731273
struct btrfs_device *one_device)
12741274
{
12751275
int error = 0;
@@ -1395,13 +1395,13 @@ int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info)
13951395

13961396
btrfs_set_fs_info_ptr(fs_info);
13971397

1398-
error = btrfs_sysfs_add_device_link(fs_devs, NULL);
1398+
error = btrfs_sysfs_add_devices_dir(fs_devs, NULL);
13991399
if (error)
14001400
return error;
14011401

14021402
error = sysfs_create_files(fsid_kobj, btrfs_attrs);
14031403
if (error) {
1404-
btrfs_sysfs_rm_device_link(fs_devs, NULL);
1404+
btrfs_sysfs_remove_devices_dir(fs_devs, NULL);
14051405
return error;
14061406
}
14071407

fs/btrfs/sysfs.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ enum btrfs_feature_set {
1414

1515
char *btrfs_printable_features(enum btrfs_feature_set set, u64 flags);
1616
const char * const btrfs_feature_set_name(enum btrfs_feature_set set);
17-
int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
17+
int btrfs_sysfs_add_devices_dir(struct btrfs_fs_devices *fs_devices,
1818
struct btrfs_device *one_device);
19-
int btrfs_sysfs_rm_device_link(struct btrfs_fs_devices *fs_devices,
19+
int btrfs_sysfs_remove_devices_dir(struct btrfs_fs_devices *fs_devices,
2020
struct btrfs_device *one_device);
2121
int btrfs_sysfs_add_fsid(struct btrfs_fs_devices *fs_devs);
2222
void btrfs_sysfs_remove_fsid(struct btrfs_fs_devices *fs_devs);

fs/btrfs/volumes.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,7 @@ int btrfs_rm_device(struct btrfs_fs_info *fs_info, const char *device_path,
20542054
if (device->bdev) {
20552055
cur_devices->open_devices--;
20562056
/* remove sysfs entry */
2057-
btrfs_sysfs_rm_device_link(fs_devices, device);
2057+
btrfs_sysfs_remove_devices_dir(fs_devices, device);
20582058
}
20592059

20602060
num_devices = btrfs_super_num_devices(fs_info->super_copy) - 1;
@@ -2174,7 +2174,7 @@ void btrfs_destroy_dev_replace_tgtdev(struct btrfs_device *tgtdev)
21742174

21752175
mutex_lock(&fs_devices->device_list_mutex);
21762176

2177-
btrfs_sysfs_rm_device_link(fs_devices, tgtdev);
2177+
btrfs_sysfs_remove_devices_dir(fs_devices, tgtdev);
21782178

21792179
if (tgtdev->bdev)
21802180
fs_devices->open_devices--;
@@ -2522,7 +2522,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
25222522
orig_super_num_devices + 1);
25232523

25242524
/* add sysfs device entry */
2525-
btrfs_sysfs_add_device_link(fs_devices, device);
2525+
btrfs_sysfs_add_devices_dir(fs_devices, device);
25262526

25272527
/*
25282528
* we've got more storage, clear any full flags on the space
@@ -2590,7 +2590,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
25902590
return ret;
25912591

25922592
error_sysfs:
2593-
btrfs_sysfs_rm_device_link(fs_devices, device);
2593+
btrfs_sysfs_remove_devices_dir(fs_devices, device);
25942594
mutex_lock(&fs_info->fs_devices->device_list_mutex);
25952595
mutex_lock(&fs_info->chunk_mutex);
25962596
list_del_rcu(&device->dev_list);

0 commit comments

Comments
 (0)