Skip to content

Commit 5b84030

Browse files
committed
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 <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 50b5b60 commit 5b84030

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

fs/btrfs/ordered-data.h

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,31 @@ struct btrfs_ordered_sum {
3737
* rbtree, just before waking any waiters. It is used to indicate the
3838
* IO is done and any metadata is inserted into the tree.
3939
*/
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+
};
6065

6166
struct btrfs_ordered_extent {
6267
/* logical offset in the file */

0 commit comments

Comments
 (0)