Re: [PATCH 1/4] btrfs: dev delete should remove sysfs entry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 26, 2014 at 05:30:23PM +0800, Anand Jain wrote:
> --- a/fs/btrfs/sysfs.c
> +++ b/fs/btrfs/sysfs.c
> @@ -572,6 +572,26 @@ static void init_feature_attrs(void)
>  	}
>  }
>  
> +int rm_device_membership(struct btrfs_fs_info *fs_info,
> +		struct btrfs_device *one_device)

The name is too generic for a non-static function, so it would be good
to add at least the btrfs_ prefix. Same applies to the change of
'add_device_membership' in the next patch.

As this is only a trivial change, consider this
Reviewed-by: David Sterba <dsterba@xxxxxxx>

> +{
> +	struct hd_struct *disk;
> +	struct kobject *disk_kobj;
> +
> +	if (!fs_info->device_dir_kobj)
> +		return -EINVAL;
> +
> +	if (one_device) {
> +		disk = one_device->bdev->bd_part;
> +		disk_kobj = &part_to_dev(disk)->kobj;
> +
> +		sysfs_remove_link(fs_info->device_dir_kobj,
> +						disk_kobj->name);
> +	}
> +
> +	return 0;
> +}
> +
>  static int add_device_membership(struct btrfs_fs_info *fs_info)
>  {
>  	int error = 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux