diff options
author | Eric Sandeen <sandeen@redhat.com> | 2009-09-17 11:55:58 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-09-17 11:55:58 -0400 |
commit | 0a80e9867db154966b2a771042e10452ac110e1e (patch) | |
tree | 51f43830b3c0dd733b0d446399eb3ea2b6bc84ed /fs | |
parent | 5534fb5bb35a62a94e0bd1fa2421f7fb6e894f10 (diff) |
ext4: replace MAX_DEFRAG_SIZE with EXT_MAX_BLOCK
There's no reason to redefine the maximum allowable offset
in an extent-based file just for defrag;
EXT_MAX_BLOCK already does this.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext4/ext4.h | 1 | ||||
-rw-r--r-- | fs/ext4/ext4_extents.h | 1 | ||||
-rw-r--r-- | fs/ext4/move_extent.c | 12 |
3 files changed, 7 insertions, 7 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 84e7f1d00a83..e227eea23f05 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -476,7 +476,6 @@ struct move_extent { | |||
476 | __u64 len; /* block length to be moved */ | 476 | __u64 len; /* block length to be moved */ |
477 | __u64 moved_len; /* moved block length */ | 477 | __u64 moved_len; /* moved block length */ |
478 | }; | 478 | }; |
479 | #define MAX_DEFRAG_SIZE ((1UL<<31) - 1) | ||
480 | 479 | ||
481 | #define EXT4_EPOCH_BITS 2 | 480 | #define EXT4_EPOCH_BITS 2 |
482 | #define EXT4_EPOCH_MASK ((1 << EXT4_EPOCH_BITS) - 1) | 481 | #define EXT4_EPOCH_MASK ((1 << EXT4_EPOCH_BITS) - 1) |
diff --git a/fs/ext4/ext4_extents.h b/fs/ext4/ext4_extents.h index 9538633879d7..61652f1d15e6 100644 --- a/fs/ext4/ext4_extents.h +++ b/fs/ext4/ext4_extents.h | |||
@@ -137,6 +137,7 @@ typedef int (*ext_prepare_callback)(struct inode *, struct ext4_ext_path *, | |||
137 | #define EXT_BREAK 1 | 137 | #define EXT_BREAK 1 |
138 | #define EXT_REPEAT 2 | 138 | #define EXT_REPEAT 2 |
139 | 139 | ||
140 | /* Maximum logical block in a file; ext4_extent's ee_block is __le32 */ | ||
140 | #define EXT_MAX_BLOCK 0xffffffff | 141 | #define EXT_MAX_BLOCK 0xffffffff |
141 | 142 | ||
142 | /* | 143 | /* |
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index 1f027b1ec430..c07a2915e40b 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c | |||
@@ -1040,12 +1040,12 @@ mext_check_arguments(struct inode *orig_inode, | |||
1040 | return -EINVAL; | 1040 | return -EINVAL; |
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | if ((orig_start > MAX_DEFRAG_SIZE) || | 1043 | if ((orig_start > EXT_MAX_BLOCK) || |
1044 | (donor_start > MAX_DEFRAG_SIZE) || | 1044 | (donor_start > EXT_MAX_BLOCK) || |
1045 | (*len > MAX_DEFRAG_SIZE) || | 1045 | (*len > EXT_MAX_BLOCK) || |
1046 | (orig_start + *len > MAX_DEFRAG_SIZE)) { | 1046 | (orig_start + *len > EXT_MAX_BLOCK)) { |
1047 | ext4_debug("ext4 move extent: Can't handle over [%lu] blocks " | 1047 | ext4_debug("ext4 move extent: Can't handle over [%u] blocks " |
1048 | "[ino:orig %lu, donor %lu]\n", MAX_DEFRAG_SIZE, | 1048 | "[ino:orig %lu, donor %lu]\n", EXT_MAX_BLOCK, |
1049 | orig_inode->i_ino, donor_inode->i_ino); | 1049 | orig_inode->i_ino, donor_inode->i_ino); |
1050 | return -EINVAL; | 1050 | return -EINVAL; |
1051 | } | 1051 | } |