diff options
author | Eric Sandeen <sandeen@redhat.com> | 2007-10-17 02:30:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:43:01 -0400 |
commit | 059590f495f9c6e89cb018b9e612c3eec2336109 (patch) | |
tree | 89f86070d05fc3c153a0f6a506ac315ef87cba3a /fs/ext3 | |
parent | a9c62a18a291499d15a370d08771e781fbaf91e6 (diff) |
ext3: remove #ifdef CONFIG_EXT3_INDEX
CONFIG_EXT3_INDEX is not an exposed config option in the kernel, and it is
unconditionally defined in ext3_fs.h. tune2fs is already able to turn off
dir indexing, so at this point it's just cluttering up the code. Remove
it.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Cc: <linux-ext4@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/dir.c | 7 | ||||
-rw-r--r-- | fs/ext3/namei.c | 19 |
2 files changed, 0 insertions, 26 deletions
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c index fd4b6dd71150..c8e4ee3af1d0 100644 --- a/fs/ext3/dir.c +++ b/fs/ext3/dir.c | |||
@@ -47,9 +47,7 @@ const struct file_operations ext3_dir_operations = { | |||
47 | .compat_ioctl = ext3_compat_ioctl, | 47 | .compat_ioctl = ext3_compat_ioctl, |
48 | #endif | 48 | #endif |
49 | .fsync = ext3_sync_file, /* BKL held */ | 49 | .fsync = ext3_sync_file, /* BKL held */ |
50 | #ifdef CONFIG_EXT3_INDEX | ||
51 | .release = ext3_release_dir, | 50 | .release = ext3_release_dir, |
52 | #endif | ||
53 | }; | 51 | }; |
54 | 52 | ||
55 | 53 | ||
@@ -107,7 +105,6 @@ static int ext3_readdir(struct file * filp, | |||
107 | 105 | ||
108 | sb = inode->i_sb; | 106 | sb = inode->i_sb; |
109 | 107 | ||
110 | #ifdef CONFIG_EXT3_INDEX | ||
111 | if (EXT3_HAS_COMPAT_FEATURE(inode->i_sb, | 108 | if (EXT3_HAS_COMPAT_FEATURE(inode->i_sb, |
112 | EXT3_FEATURE_COMPAT_DIR_INDEX) && | 109 | EXT3_FEATURE_COMPAT_DIR_INDEX) && |
113 | ((EXT3_I(inode)->i_flags & EXT3_INDEX_FL) || | 110 | ((EXT3_I(inode)->i_flags & EXT3_INDEX_FL) || |
@@ -123,7 +120,6 @@ static int ext3_readdir(struct file * filp, | |||
123 | */ | 120 | */ |
124 | EXT3_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT3_INDEX_FL; | 121 | EXT3_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT3_INDEX_FL; |
125 | } | 122 | } |
126 | #endif | ||
127 | stored = 0; | 123 | stored = 0; |
128 | offset = filp->f_pos & (sb->s_blocksize - 1); | 124 | offset = filp->f_pos & (sb->s_blocksize - 1); |
129 | 125 | ||
@@ -232,7 +228,6 @@ out: | |||
232 | return ret; | 228 | return ret; |
233 | } | 229 | } |
234 | 230 | ||
235 | #ifdef CONFIG_EXT3_INDEX | ||
236 | /* | 231 | /* |
237 | * These functions convert from the major/minor hash to an f_pos | 232 | * These functions convert from the major/minor hash to an f_pos |
238 | * value. | 233 | * value. |
@@ -518,5 +513,3 @@ static int ext3_release_dir (struct inode * inode, struct file * filp) | |||
518 | 513 | ||
519 | return 0; | 514 | return 0; |
520 | } | 515 | } |
521 | |||
522 | #endif | ||
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c index c1fa1908dba0..ec8170adac53 100644 --- a/fs/ext3/namei.c +++ b/fs/ext3/namei.c | |||
@@ -144,7 +144,6 @@ struct dx_map_entry | |||
144 | u16 size; | 144 | u16 size; |
145 | }; | 145 | }; |
146 | 146 | ||
147 | #ifdef CONFIG_EXT3_INDEX | ||
148 | static inline unsigned dx_get_block (struct dx_entry *entry); | 147 | static inline unsigned dx_get_block (struct dx_entry *entry); |
149 | static void dx_set_block (struct dx_entry *entry, unsigned value); | 148 | static void dx_set_block (struct dx_entry *entry, unsigned value); |
150 | static inline unsigned dx_get_hash (struct dx_entry *entry); | 149 | static inline unsigned dx_get_hash (struct dx_entry *entry); |
@@ -768,8 +767,6 @@ static void dx_insert_block(struct dx_frame *frame, u32 hash, u32 block) | |||
768 | dx_set_block(new, block); | 767 | dx_set_block(new, block); |
769 | dx_set_count(entries, count + 1); | 768 | dx_set_count(entries, count + 1); |
770 | } | 769 | } |
771 | #endif | ||
772 | |||
773 | 770 | ||
774 | static void ext3_update_dx_flag(struct inode *inode) | 771 | static void ext3_update_dx_flag(struct inode *inode) |
775 | { | 772 | { |
@@ -871,7 +868,6 @@ static struct buffer_head * ext3_find_entry (struct dentry *dentry, | |||
871 | name = dentry->d_name.name; | 868 | name = dentry->d_name.name; |
872 | if (namelen > EXT3_NAME_LEN) | 869 | if (namelen > EXT3_NAME_LEN) |
873 | return NULL; | 870 | return NULL; |
874 | #ifdef CONFIG_EXT3_INDEX | ||
875 | if (is_dx(dir)) { | 871 | if (is_dx(dir)) { |
876 | bh = ext3_dx_find_entry(dentry, res_dir, &err); | 872 | bh = ext3_dx_find_entry(dentry, res_dir, &err); |
877 | /* | 873 | /* |
@@ -883,7 +879,6 @@ static struct buffer_head * ext3_find_entry (struct dentry *dentry, | |||
883 | return bh; | 879 | return bh; |
884 | dxtrace(printk("ext3_find_entry: dx failed, falling back\n")); | 880 | dxtrace(printk("ext3_find_entry: dx failed, falling back\n")); |
885 | } | 881 | } |
886 | #endif | ||
887 | nblocks = dir->i_size >> EXT3_BLOCK_SIZE_BITS(sb); | 882 | nblocks = dir->i_size >> EXT3_BLOCK_SIZE_BITS(sb); |
888 | start = EXT3_I(dir)->i_dir_start_lookup; | 883 | start = EXT3_I(dir)->i_dir_start_lookup; |
889 | if (start >= nblocks) | 884 | if (start >= nblocks) |
@@ -959,7 +954,6 @@ cleanup_and_exit: | |||
959 | return ret; | 954 | return ret; |
960 | } | 955 | } |
961 | 956 | ||
962 | #ifdef CONFIG_EXT3_INDEX | ||
963 | static struct buffer_head * ext3_dx_find_entry(struct dentry *dentry, | 957 | static struct buffer_head * ext3_dx_find_entry(struct dentry *dentry, |
964 | struct ext3_dir_entry_2 **res_dir, int *err) | 958 | struct ext3_dir_entry_2 **res_dir, int *err) |
965 | { | 959 | { |
@@ -1027,7 +1021,6 @@ errout: | |||
1027 | dx_release (frames); | 1021 | dx_release (frames); |
1028 | return NULL; | 1022 | return NULL; |
1029 | } | 1023 | } |
1030 | #endif | ||
1031 | 1024 | ||
1032 | static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) | 1025 | static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) |
1033 | { | 1026 | { |
@@ -1123,7 +1116,6 @@ static inline void ext3_set_de_type(struct super_block *sb, | |||
1123 | de->file_type = ext3_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; | 1116 | de->file_type = ext3_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; |
1124 | } | 1117 | } |
1125 | 1118 | ||
1126 | #ifdef CONFIG_EXT3_INDEX | ||
1127 | /* | 1119 | /* |
1128 | * Move count entries from end of map between two memory locations. | 1120 | * Move count entries from end of map between two memory locations. |
1129 | * Returns pointer to last entry moved. | 1121 | * Returns pointer to last entry moved. |
@@ -1268,7 +1260,6 @@ errout: | |||
1268 | *error = err; | 1260 | *error = err; |
1269 | return NULL; | 1261 | return NULL; |
1270 | } | 1262 | } |
1271 | #endif | ||
1272 | 1263 | ||
1273 | 1264 | ||
1274 | /* | 1265 | /* |
@@ -1366,7 +1357,6 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry, | |||
1366 | return 0; | 1357 | return 0; |
1367 | } | 1358 | } |
1368 | 1359 | ||
1369 | #ifdef CONFIG_EXT3_INDEX | ||
1370 | /* | 1360 | /* |
1371 | * This converts a one block unindexed directory to a 3 block indexed | 1361 | * This converts a one block unindexed directory to a 3 block indexed |
1372 | * directory, and adds the dentry to the indexed directory. | 1362 | * directory, and adds the dentry to the indexed directory. |
@@ -1445,7 +1435,6 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry, | |||
1445 | 1435 | ||
1446 | return add_dirent_to_buf(handle, dentry, inode, de, bh); | 1436 | return add_dirent_to_buf(handle, dentry, inode, de, bh); |
1447 | } | 1437 | } |
1448 | #endif | ||
1449 | 1438 | ||
1450 | /* | 1439 | /* |
1451 | * ext3_add_entry() | 1440 | * ext3_add_entry() |
@@ -1466,9 +1455,7 @@ static int ext3_add_entry (handle_t *handle, struct dentry *dentry, | |||
1466 | struct ext3_dir_entry_2 *de; | 1455 | struct ext3_dir_entry_2 *de; |
1467 | struct super_block * sb; | 1456 | struct super_block * sb; |
1468 | int retval; | 1457 | int retval; |
1469 | #ifdef CONFIG_EXT3_INDEX | ||
1470 | int dx_fallback=0; | 1458 | int dx_fallback=0; |
1471 | #endif | ||
1472 | unsigned blocksize; | 1459 | unsigned blocksize; |
1473 | u32 block, blocks; | 1460 | u32 block, blocks; |
1474 | 1461 | ||
@@ -1476,7 +1463,6 @@ static int ext3_add_entry (handle_t *handle, struct dentry *dentry, | |||
1476 | blocksize = sb->s_blocksize; | 1463 | blocksize = sb->s_blocksize; |
1477 | if (!dentry->d_name.len) | 1464 | if (!dentry->d_name.len) |
1478 | return -EINVAL; | 1465 | return -EINVAL; |
1479 | #ifdef CONFIG_EXT3_INDEX | ||
1480 | if (is_dx(dir)) { | 1466 | if (is_dx(dir)) { |
1481 | retval = ext3_dx_add_entry(handle, dentry, inode); | 1467 | retval = ext3_dx_add_entry(handle, dentry, inode); |
1482 | if (!retval || (retval != ERR_BAD_DX_DIR)) | 1468 | if (!retval || (retval != ERR_BAD_DX_DIR)) |
@@ -1485,7 +1471,6 @@ static int ext3_add_entry (handle_t *handle, struct dentry *dentry, | |||
1485 | dx_fallback++; | 1471 | dx_fallback++; |
1486 | ext3_mark_inode_dirty(handle, dir); | 1472 | ext3_mark_inode_dirty(handle, dir); |
1487 | } | 1473 | } |
1488 | #endif | ||
1489 | blocks = dir->i_size >> sb->s_blocksize_bits; | 1474 | blocks = dir->i_size >> sb->s_blocksize_bits; |
1490 | for (block = 0, offset = 0; block < blocks; block++) { | 1475 | for (block = 0, offset = 0; block < blocks; block++) { |
1491 | bh = ext3_bread(handle, dir, block, 0, &retval); | 1476 | bh = ext3_bread(handle, dir, block, 0, &retval); |
@@ -1495,11 +1480,9 @@ static int ext3_add_entry (handle_t *handle, struct dentry *dentry, | |||
1495 | if (retval != -ENOSPC) | 1480 | if (retval != -ENOSPC) |
1496 | return retval; | 1481 | return retval; |
1497 | 1482 | ||
1498 | #ifdef CONFIG_EXT3_INDEX | ||
1499 | if (blocks == 1 && !dx_fallback && | 1483 | if (blocks == 1 && !dx_fallback && |
1500 | EXT3_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_DIR_INDEX)) | 1484 | EXT3_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_DIR_INDEX)) |
1501 | return make_indexed_dir(handle, dentry, inode, bh); | 1485 | return make_indexed_dir(handle, dentry, inode, bh); |
1502 | #endif | ||
1503 | brelse(bh); | 1486 | brelse(bh); |
1504 | } | 1487 | } |
1505 | bh = ext3_append(handle, dir, &block, &retval); | 1488 | bh = ext3_append(handle, dir, &block, &retval); |
@@ -1511,7 +1494,6 @@ static int ext3_add_entry (handle_t *handle, struct dentry *dentry, | |||
1511 | return add_dirent_to_buf(handle, dentry, inode, de, bh); | 1494 | return add_dirent_to_buf(handle, dentry, inode, de, bh); |
1512 | } | 1495 | } |
1513 | 1496 | ||
1514 | #ifdef CONFIG_EXT3_INDEX | ||
1515 | /* | 1497 | /* |
1516 | * Returns 0 for success, or a negative error value | 1498 | * Returns 0 for success, or a negative error value |
1517 | */ | 1499 | */ |
@@ -1646,7 +1628,6 @@ cleanup: | |||
1646 | dx_release(frames); | 1628 | dx_release(frames); |
1647 | return err; | 1629 | return err; |
1648 | } | 1630 | } |
1649 | #endif | ||
1650 | 1631 | ||
1651 | /* | 1632 | /* |
1652 | * ext3_delete_entry deletes a directory entry by merging it with the | 1633 | * ext3_delete_entry deletes a directory entry by merging it with the |