All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] btrfs: add comment about BTRFS_FS_EXCL_OP
@ 2018-04-18  6:59 Anand Jain
  2018-04-18 14:54 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Anand Jain @ 2018-04-18  6:59 UTC (permalink / raw)
  To: linux-btrfs

Adds comments about BTRFS_FS_EXCL_OP to existing comments
about the device locks.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v1->v2: add more clarity to the comments added.

 fs/btrfs/volumes.c | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 3a3912a9dec9..6d7f10729713 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -202,6 +202,38 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,
  *   device_list_mutex
  *     chunk_mutex
  *   balance_mutex
+ *
+ * BTRFS_FS_EXCL_OP
+ * ----------------
+ * Maintains the exclusivity of the following device operations.
+ *
+ * - Balance (*)
+ * - Device add
+ * - Device remove
+ * - Device Replace (*)
+ * - Resize
+ *
+ * The device operations (as above) can be in one of the following states.
+ *
+ * - Running state
+ * - Paused state
+ * - Completed state
+ *
+ * Only device operations marked with (*) can go into the Paused state for the
+ * following reasons.
+ *
+ * - Ioctl (only Balance can be Paused through Ioctl)
+ * - FS re-mounted as read-only
+ * - FS un-mounted and mounted as read-only
+ * - System power-recycle and mounted as read-only
+ * - FS or device errors leading to read-only FS
+ *
+ * BTRFS_FS_EXCL_OP flag is set and cleared using atomic functions.
+ * During the course of Paused state, the BTRFS_FS_EXCL_OP remains set.
+ * A device operation in Paused or Running state can be canceled or resumed
+ * either by Ioctl (Balance only) or when re-mounted as read-write FS.
+ * BTRFS_FS_EXCL_OP flag is cleared when the device operation is canceled or
+ * completed.
  */
 
 DEFINE_MUTEX(uuid_mutex);
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] btrfs: add comment about BTRFS_FS_EXCL_OP
  2018-04-18  6:59 [PATCH v2] btrfs: add comment about BTRFS_FS_EXCL_OP Anand Jain
@ 2018-04-18 14:54 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2018-04-18 14:54 UTC (permalink / raw)
  To: Anand Jain; +Cc: linux-btrfs

On Wed, Apr 18, 2018 at 02:59:25PM +0800, Anand Jain wrote:
> Adds comments about BTRFS_FS_EXCL_OP to existing comments
> about the device locks.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Reviewed-by: David Sterba <dsterba@suse.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-18 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18  6:59 [PATCH v2] btrfs: add comment about BTRFS_FS_EXCL_OP Anand Jain
2018-04-18 14:54 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.