On Wed, Mar 29, 2017 at 06:01:37PM +0800, Anand Jain wrote: > > > On 03/28/2017 08:44 PM, David Sterba wrote: > > There are several operations, usually started from ioctls, that cannot > > run concurrently. The status is tracked in > > mutually_exclusive_operation_running as an atomic_t. We can easily track > > the status as one of the per-filesystem flag bits with same > > synchronization guarantees. > > > > The conversion replaces: > > > > * atomic_xchg(..., 1) -> test_and_set_bit(FLAG, ...) > > * atomic_set(..., 0) -> clear_bit(FLAG, ...) > > > Makes sense. > > Reviewed-by: Anand Jain <anand.j...@oracle.com> > > However in the long term do you think its better to have > BTRFS_FS_EXCL_OP flag in the struct btrfs_fs_devices > rather than in struct btrfs_fs_info ? because we don't have > fs_info until device is mounted and in the long term we could > have a feature where volume can be maintained just after the > device scan without device being mounted.
I can't think of an example where it would be useful to move it out of fs_info, so I'd need to know more details about the usecase. But the flag makes sense only after the filesystem is mounted and all devices are known, so what you suggest would be probably tracked by other flag if necessary. -- 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