diff options
-rw-r--r-- | fs/ext4/extents_status.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/ext4/extents_status.h b/fs/ext4/extents_status.h index cf83e77b16cb..f190dfe969da 100644 --- a/fs/ext4/extents_status.h +++ b/fs/ext4/extents_status.h | |||
@@ -20,10 +20,13 @@ | |||
20 | #define es_debug(fmt, ...) no_printk(fmt, ##__VA_ARGS__) | 20 | #define es_debug(fmt, ...) no_printk(fmt, ##__VA_ARGS__) |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #define EXTENT_STATUS_WRITTEN 0x80000000 /* written extent */ | 23 | /* |
24 | #define EXTENT_STATUS_UNWRITTEN 0x40000000 /* unwritten extent */ | 24 | * These flags live in the high bits of extent_status.es_pblk |
25 | #define EXTENT_STATUS_DELAYED 0x20000000 /* delayed extent */ | 25 | */ |
26 | #define EXTENT_STATUS_HOLE 0x10000000 /* hole */ | 26 | #define EXTENT_STATUS_WRITTEN (1ULL << 63) |
27 | #define EXTENT_STATUS_UNWRITTEN (1ULL << 62) | ||
28 | #define EXTENT_STATUS_DELAYED (1ULL << 61) | ||
29 | #define EXTENT_STATUS_HOLE (1ULL << 60) | ||
27 | 30 | ||
28 | #define EXTENT_STATUS_FLAGS (EXTENT_STATUS_WRITTEN | \ | 31 | #define EXTENT_STATUS_FLAGS (EXTENT_STATUS_WRITTEN | \ |
29 | EXTENT_STATUS_UNWRITTEN | \ | 32 | EXTENT_STATUS_UNWRITTEN | \ |
@@ -58,22 +61,22 @@ extern int ext4_es_lookup_extent(struct inode *inode, ext4_lblk_t lblk, | |||
58 | 61 | ||
59 | static inline int ext4_es_is_written(struct extent_status *es) | 62 | static inline int ext4_es_is_written(struct extent_status *es) |
60 | { | 63 | { |
61 | return (es->es_pblk & EXTENT_STATUS_WRITTEN); | 64 | return (es->es_pblk & EXTENT_STATUS_WRITTEN) != 0; |
62 | } | 65 | } |
63 | 66 | ||
64 | static inline int ext4_es_is_unwritten(struct extent_status *es) | 67 | static inline int ext4_es_is_unwritten(struct extent_status *es) |
65 | { | 68 | { |
66 | return (es->es_pblk & EXTENT_STATUS_UNWRITTEN); | 69 | return (es->es_pblk & EXTENT_STATUS_UNWRITTEN) != 0; |
67 | } | 70 | } |
68 | 71 | ||
69 | static inline int ext4_es_is_delayed(struct extent_status *es) | 72 | static inline int ext4_es_is_delayed(struct extent_status *es) |
70 | { | 73 | { |
71 | return (es->es_pblk & EXTENT_STATUS_DELAYED); | 74 | return (es->es_pblk & EXTENT_STATUS_DELAYED) != 0; |
72 | } | 75 | } |
73 | 76 | ||
74 | static inline int ext4_es_is_hole(struct extent_status *es) | 77 | static inline int ext4_es_is_hole(struct extent_status *es) |
75 | { | 78 | { |
76 | return (es->es_pblk & EXTENT_STATUS_HOLE); | 79 | return (es->es_pblk & EXTENT_STATUS_HOLE) != 0; |
77 | } | 80 | } |
78 | 81 | ||
79 | static inline ext4_fsblk_t ext4_es_status(struct extent_status *es) | 82 | static inline ext4_fsblk_t ext4_es_status(struct extent_status *es) |