From: Omar Sandoval <osandov@osandov.com>
To: David Sterba <dsterba@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 8/9] btrfs: switch BTRFS_ORDERED_* to enums
Date: Tue, 27 Nov 2018 16:37:46 -0800 [thread overview]
Message-ID: <20181128003746.GP846@vader> (raw)
In-Reply-To: <15902ae1f53ef52d36fb4371fa2ec3428ca7158a.1543348078.git.dsterba@suse.com>
On Tue, Nov 27, 2018 at 08:53:57PM +0100, David Sterba wrote:
> We can use simple enum for values that are not part of on-disk format:
> ordered extent flags.
Reviewed-by: Omar Sandoval <osandov@fb.com>
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
> fs/btrfs/ordered-data.h | 45 +++++++++++++++++++++++------------------
> 1 file changed, 25 insertions(+), 20 deletions(-)
>
> diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h
> index b10e6765d88f..fb9a161f0215 100644
> --- a/fs/btrfs/ordered-data.h
> +++ b/fs/btrfs/ordered-data.h
> @@ -37,26 +37,31 @@ struct btrfs_ordered_sum {
> * rbtree, just before waking any waiters. It is used to indicate the
> * IO is done and any metadata is inserted into the tree.
> */
> -#define BTRFS_ORDERED_IO_DONE 0 /* set when all the pages are written */
> -
> -#define BTRFS_ORDERED_COMPLETE 1 /* set when removed from the tree */
> -
> -#define BTRFS_ORDERED_NOCOW 2 /* set when we want to write in place */
> -
> -#define BTRFS_ORDERED_COMPRESSED 3 /* writing a zlib compressed extent */
> -
> -#define BTRFS_ORDERED_PREALLOC 4 /* set when writing to preallocated extent */
> -
> -#define BTRFS_ORDERED_DIRECT 5 /* set when we're doing DIO with this extent */
> -
> -#define BTRFS_ORDERED_IOERR 6 /* We had an io error when writing this out */
> -
> -#define BTRFS_ORDERED_UPDATED_ISIZE 7 /* indicates whether this ordered extent
> - * has done its due diligence in updating
> - * the isize. */
> -#define BTRFS_ORDERED_TRUNCATED 8 /* Set when we have to truncate an extent */
> -
> -#define BTRFS_ORDERED_REGULAR 10 /* Regular IO for COW */
> +enum {
> + /* set when all the pages are written */
> + BTRFS_ORDERED_IO_DONE,
> + /* set when removed from the tree */
> + BTRFS_ORDERED_COMPLETE,
> + /* set when we want to write in place */
> + BTRFS_ORDERED_NOCOW,
> + /* writing a zlib compressed extent */
> + BTRFS_ORDERED_COMPRESSED,
> + /* set when writing to preallocated extent */
> + BTRFS_ORDERED_PREALLOC,
> + /* set when we're doing DIO with this extent */
> + BTRFS_ORDERED_DIRECT,
> + /* We had an io error when writing this out */
> + BTRFS_ORDERED_IOERR,
> + /*
> + * indicates whether this ordered extent has done its due diligence in
> + * updating the isize
> + */
> + BTRFS_ORDERED_UPDATED_ISIZE,
> + /* Set when we have to truncate an extent */
> + BTRFS_ORDERED_TRUNCATED,
> + /* Regular IO for COW */
> + BTRFS_ORDERED_REGULAR,
> +};
>
> struct btrfs_ordered_extent {
> /* logical offset in the file */
> --
> 2.19.1
>
next prev parent reply other threads:[~2018-11-28 0:37 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-27 19:53 [PATCH 0/9] Switch defines to enums David Sterba
2018-11-27 19:53 ` [PATCH 1/9] btrfs: switch BTRFS_FS_STATE_* " David Sterba
2018-11-28 0:24 ` Omar Sandoval
2018-11-28 15:22 ` David Sterba
2018-11-28 1:18 ` Qu Wenruo
2018-11-28 12:49 ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 2/9] btrfs: switch BTRFS_BLOCK_RSV_* " David Sterba
2018-11-28 0:25 ` Omar Sandoval
2018-11-28 1:19 ` Qu Wenruo
2018-11-28 12:50 ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 3/9] btrfs: switch BTRFS_FS_* " David Sterba
2018-11-28 0:28 ` Omar Sandoval
2018-11-28 1:21 ` Qu Wenruo
2018-11-27 19:53 ` [PATCH 4/9] btrfs: switch BTRFS_ROOT_* " David Sterba
2018-11-28 0:30 ` Omar Sandoval
2018-11-28 1:22 ` Qu Wenruo
2018-11-28 13:17 ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 5/9] btrfs: swtich EXTENT_BUFFER_* " David Sterba
2018-11-28 0:31 ` Omar Sandoval
2018-11-28 1:24 ` Qu Wenruo
2018-11-28 13:19 ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 6/9] btrfs: switch EXTENT_FLAG_* " David Sterba
2018-11-28 0:32 ` Omar Sandoval
2018-11-28 1:25 ` Qu Wenruo
2018-11-28 13:26 ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 7/9] btrfs: switch BTRFS_*_LOCK " David Sterba
2018-11-28 0:37 ` Omar Sandoval
2018-11-28 13:22 ` David Sterba
2018-11-28 1:26 ` Qu Wenruo
2018-11-27 19:53 ` [PATCH 8/9] btrfs: switch BTRFS_ORDERED_* " David Sterba
2018-11-28 0:37 ` Omar Sandoval [this message]
2018-11-28 1:32 ` Qu Wenruo
2018-11-28 13:28 ` Johannes Thumshirn
2018-11-27 19:53 ` [PATCH 9/9] btrfs: drop extra enum initialization where using defaults David Sterba
2018-11-28 0:38 ` Omar Sandoval
2018-11-28 1:35 ` Qu Wenruo
2018-11-28 13:29 ` Johannes Thumshirn
2018-11-28 1:33 ` [PATCH 0/9] Switch defines to enums Qu Wenruo
2018-11-28 13:25 ` David Sterba
2018-11-28 13:50 ` Qu Wenruo
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=20181128003746.GP846@vader \
--to=osandov@osandov.com \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).