From: David Sterba <dsterba@suse.cz>
To: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: linux-btrfs@vger.kernel.org,
Goldwyn Rodrigues <rgoldwyn@suse.com>,
Nikolay Borisov <nborisov@suse.com>
Subject: Re: [PATCH 1/2] btrfs: enumerate the type of exclusive operation in progress
Date: Wed, 2 Sep 2020 15:42:59 +0200 [thread overview]
Message-ID: <20200902134259.GJ28318@twin.jikos.cz> (raw)
In-Reply-To: <20200825150233.30294-2-rgoldwyn@suse.de>
On Tue, Aug 25, 2020 at 10:02:32AM -0500, Goldwyn Rodrigues wrote:
> From: Goldwyn Rodrigues <rgoldwyn@suse.com>
>
> Instead of using a flag bit for exclusive operation, use an atomic_t
> variable to store if the exclusive operation is being performed.
> Introduce an API to start and finish an exclusive operation.
I think we don't need it to be atomic_t, the change must be atomic but
for that cmpxchg should be sufficient.
> +enum btrfs_exclusive_operation_t {
> + BTRFS_EXCLOP_NONE = 0,
> + BTRFS_EXCLOP_BALANCE,
> + BTRFS_EXCLOP_DEV_ADD,
> + BTRFS_EXCLOP_DEV_REPLACE,
> + BTRFS_EXCLOP_DEV_REMOVE,
> + BTRFS_EXCLOP_SWAP_ACTIVATE,
> + BTRFS_EXCLOP_RESIZE,
Yeah this is much better than the single bit.
next prev parent reply other threads:[~2020-09-02 15:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-25 15:02 [PATCH v3 0/2] btrfs: Enumerate and export exclusive operations Goldwyn Rodrigues
2020-08-25 15:02 ` [PATCH 1/2] btrfs: enumerate the type of exclusive operation in progress Goldwyn Rodrigues
2020-09-02 13:42 ` David Sterba [this message]
2020-08-25 15:02 ` [PATCH 2/2] btrfs: export currently executing exclusive operation via sysfs Goldwyn Rodrigues
2020-08-25 15:03 ` [PATCH 1/4] btrfs-progs: get_fsid_fd() for getting fsid using fd Goldwyn Rodrigues
2020-08-25 15:03 ` [PATCH 2/4] btrfs-progs: add sysfs file reading functions Goldwyn Rodrigues
2020-08-25 15:03 ` [PATCH 3/4] btrfs-progs: Check for exclusive operation before issuing ioctl Goldwyn Rodrigues
2020-08-25 15:03 ` [PATCH 4/4] btrfs-progs: Enqueue command if it can't be performed immediately Goldwyn Rodrigues
2020-09-02 14:11 ` David Sterba
2020-09-02 20:45 ` Goldwyn Rodrigues
2020-09-02 20:11 ` [PATCH v3 0/2] btrfs: Enumerate and export exclusive operations David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200902134259.GJ28318@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.com \
--cc=rgoldwyn@suse.com \
--cc=rgoldwyn@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox