On Sat, Feb 13, 2016 at 10:01:33AM +0800, Anand Jain wrote: > move a section of btrfs_rm_device() code to check for min number of the > devices into the function __check_raid_min_devices()
But this also changes the semantics a bit. In context of device remove we check if there are going to be enough devices after removal, while the new helper __check_raid_min_devices should verify that a given number of devices is OK. In a pseudo code: __check_raid_min_devices(fs_info, num_devices) { /* check the device constraints */ } btrfs_rm_device() { num_devices = <read number of devices>; if (!__check_raid_min_devices(num_devices - 1)) goto error; } As there's only one user of the __check_raid_min_devices function, this would not break bisection etc, but I'm going to clean it up in followup patches. There are more changes, I'll send it to the mailing list when done. -- 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