Add ability to deregister a or all devices. I have named this sub cmd as deregister, but I am open to your suggestions.
Further I am using /dev/btrfs-control and struct btrfs_ioctl_vol_args for now, just similar to other ioctls in super.c including btrfs dev scan, if rather it makes sense to use btrfs_ioctl_vol_args_v2 I shall. Oepn to suggestions. Kernel: Patch 1/3 is preparatory patch, provides helper to delete a device. Patch 2/3 adds ioctl to delete device from the device list. Patch 3/3 provides default feature to delete all fs_devices in the list. btrfs-progs: Patch 1/2 introduce 'btrfs dev deregister <device>' Patch 2/2 make the device optional and when not provided, deregisters all unmounted devices. v2: Accepted review from Nikolay, details are in the specific patch. Patch 1/2 is renamed from [PATCH 1/2] btrfs: refactor btrfs_free_stale_device() to get device list delete to [PATCH 1/2] btrfs: add function to device list delete v3: No change. Send to correct ML. v4: No change. But as the ML thread may be confusing, so resend. v5: Mainly adds feature to deregister all unmounted devices. Accepts review from David, for details ref change log. Anand Jain (3): btrfs: add function to device list delete btrfs: introduce feature to deregister a btrfs device btrfs: add feature to deregister all unmounted devices fs/btrfs/super.c | 9 ++++ fs/btrfs/volumes.c | 119 +++++++++++++++++++++++++++++++++++++++++++++ fs/btrfs/volumes.h | 3 ++ include/uapi/linux/btrfs.h | 9 +++- 4 files changed, 138 insertions(+), 2 deletions(-) Anand Jain (2): btrfs-progs: add 'btrfs device unregister' cli btrfs-progs: add feature to deregister all devices cmds-device.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ioctl.h | 8 +++++- 2 files changed, 89 insertions(+), 1 deletion(-) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html