Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

btrfs: switch BTRFS_ORDERED_* to enums

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>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: David Sterba <dsterba@suse.com>

+25 -20
+25 -20
fs/btrfs/ordered-data.h
··· 37 37 * rbtree, just before waking any waiters. It is used to indicate the 38 38 * IO is done and any metadata is inserted into the tree. 39 39 */ 40 - #define BTRFS_ORDERED_IO_DONE 0 /* set when all the pages are written */ 41 - 42 - #define BTRFS_ORDERED_COMPLETE 1 /* set when removed from the tree */ 43 - 44 - #define BTRFS_ORDERED_NOCOW 2 /* set when we want to write in place */ 45 - 46 - #define BTRFS_ORDERED_COMPRESSED 3 /* writing a zlib compressed extent */ 47 - 48 - #define BTRFS_ORDERED_PREALLOC 4 /* set when writing to preallocated extent */ 49 - 50 - #define BTRFS_ORDERED_DIRECT 5 /* set when we're doing DIO with this extent */ 51 - 52 - #define BTRFS_ORDERED_IOERR 6 /* We had an io error when writing this out */ 53 - 54 - #define BTRFS_ORDERED_UPDATED_ISIZE 7 /* indicates whether this ordered extent 55 - * has done its due diligence in updating 56 - * the isize. */ 57 - #define BTRFS_ORDERED_TRUNCATED 8 /* Set when we have to truncate an extent */ 58 - 59 - #define BTRFS_ORDERED_REGULAR 10 /* Regular IO for COW */ 40 + enum { 41 + /* set when all the pages are written */ 42 + BTRFS_ORDERED_IO_DONE, 43 + /* set when removed from the tree */ 44 + BTRFS_ORDERED_COMPLETE, 45 + /* set when we want to write in place */ 46 + BTRFS_ORDERED_NOCOW, 47 + /* writing a zlib compressed extent */ 48 + BTRFS_ORDERED_COMPRESSED, 49 + /* set when writing to preallocated extent */ 50 + BTRFS_ORDERED_PREALLOC, 51 + /* set when we're doing DIO with this extent */ 52 + BTRFS_ORDERED_DIRECT, 53 + /* We had an io error when writing this out */ 54 + BTRFS_ORDERED_IOERR, 55 + /* 56 + * indicates whether this ordered extent has done its due diligence in 57 + * updating the isize 58 + */ 59 + BTRFS_ORDERED_UPDATED_ISIZE, 60 + /* Set when we have to truncate an extent */ 61 + BTRFS_ORDERED_TRUNCATED, 62 + /* Regular IO for COW */ 63 + BTRFS_ORDERED_REGULAR, 64 + }; 60 65 61 66 struct btrfs_ordered_extent { 62 67 /* logical offset in the file */