aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4_extents.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/ext4_extents.h')
-rw-r--r--fs/ext4/ext4_extents.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/ext4/ext4_extents.h b/fs/ext4/ext4_extents.h
index 5074fe23f19e..a867f5ca9991 100644
--- a/fs/ext4/ext4_extents.h
+++ b/fs/ext4/ext4_extents.h
@@ -137,21 +137,21 @@ struct ext4_ext_path {
137 * EXT_INIT_MAX_LEN is the maximum number of blocks we can have in an 137 * EXT_INIT_MAX_LEN is the maximum number of blocks we can have in an
138 * initialized extent. This is 2^15 and not (2^16 - 1), since we use the 138 * initialized extent. This is 2^15 and not (2^16 - 1), since we use the
139 * MSB of ee_len field in the extent datastructure to signify if this 139 * MSB of ee_len field in the extent datastructure to signify if this
140 * particular extent is an initialized extent or an uninitialized (i.e. 140 * particular extent is an initialized extent or an unwritten (i.e.
141 * preallocated). 141 * preallocated).
142 * EXT_UNINIT_MAX_LEN is the maximum number of blocks we can have in an 142 * EXT_UNWRITTEN_MAX_LEN is the maximum number of blocks we can have in an
143 * uninitialized extent. 143 * unwritten extent.
144 * If ee_len is <= 0x8000, it is an initialized extent. Otherwise, it is an 144 * If ee_len is <= 0x8000, it is an initialized extent. Otherwise, it is an
145 * uninitialized one. In other words, if MSB of ee_len is set, it is an 145 * unwritten one. In other words, if MSB of ee_len is set, it is an
146 * uninitialized extent with only one special scenario when ee_len = 0x8000. 146 * unwritten extent with only one special scenario when ee_len = 0x8000.
147 * In this case we can not have an uninitialized extent of zero length and 147 * In this case we can not have an unwritten extent of zero length and
148 * thus we make it as a special case of initialized extent with 0x8000 length. 148 * thus we make it as a special case of initialized extent with 0x8000 length.
149 * This way we get better extent-to-group alignment for initialized extents. 149 * This way we get better extent-to-group alignment for initialized extents.
150 * Hence, the maximum number of blocks we can have in an *initialized* 150 * Hence, the maximum number of blocks we can have in an *initialized*
151 * extent is 2^15 (32768) and in an *uninitialized* extent is 2^15-1 (32767). 151 * extent is 2^15 (32768) and in an *unwritten* extent is 2^15-1 (32767).
152 */ 152 */
153#define EXT_INIT_MAX_LEN (1UL << 15) 153#define EXT_INIT_MAX_LEN (1UL << 15)
154#define EXT_UNINIT_MAX_LEN (EXT_INIT_MAX_LEN - 1) 154#define EXT_UNWRITTEN_MAX_LEN (EXT_INIT_MAX_LEN - 1)
155 155
156 156
157#define EXT_FIRST_EXTENT(__hdr__) \ 157#define EXT_FIRST_EXTENT(__hdr__) \
@@ -187,14 +187,14 @@ static inline unsigned short ext_depth(struct inode *inode)
187 return le16_to_cpu(ext_inode_hdr(inode)->eh_depth); 187 return le16_to_cpu(ext_inode_hdr(inode)->eh_depth);
188} 188}
189 189
190static inline void ext4_ext_mark_uninitialized(struct ext4_extent *ext) 190static inline void ext4_ext_mark_unwritten(struct ext4_extent *ext)
191{ 191{
192 /* We can not have an uninitialized extent of zero length! */ 192 /* We can not have an unwritten extent of zero length! */
193 BUG_ON((le16_to_cpu(ext->ee_len) & ~EXT_INIT_MAX_LEN) == 0); 193 BUG_ON((le16_to_cpu(ext->ee_len) & ~EXT_INIT_MAX_LEN) == 0);
194 ext->ee_len |= cpu_to_le16(EXT_INIT_MAX_LEN); 194 ext->ee_len |= cpu_to_le16(EXT_INIT_MAX_LEN);
195} 195}
196 196
197static inline int ext4_ext_is_uninitialized(struct ext4_extent *ext) 197static inline int ext4_ext_is_unwritten(struct ext4_extent *ext)
198{ 198{
199 /* Extent with ee_len of 0x8000 is treated as an initialized extent */ 199 /* Extent with ee_len of 0x8000 is treated as an initialized extent */
200 return (le16_to_cpu(ext->ee_len) > EXT_INIT_MAX_LEN); 200 return (le16_to_cpu(ext->ee_len) > EXT_INIT_MAX_LEN);