aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r--fs/ext4/namei.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 5fdb862e71c4..94ee6f315dc1 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -144,7 +144,6 @@ struct dx_map_entry
144 u16 size; 144 u16 size;
145}; 145};
146 146
147#ifdef CONFIG_EXT4_INDEX
148static inline unsigned dx_get_block (struct dx_entry *entry); 147static inline unsigned dx_get_block (struct dx_entry *entry);
149static void dx_set_block (struct dx_entry *entry, unsigned value); 148static void dx_set_block (struct dx_entry *entry, unsigned value);
150static inline unsigned dx_get_hash (struct dx_entry *entry); 149static inline unsigned dx_get_hash (struct dx_entry *entry);
@@ -766,8 +765,6 @@ static void dx_insert_block(struct dx_frame *frame, u32 hash, u32 block)
766 dx_set_block(new, block); 765 dx_set_block(new, block);
767 dx_set_count(entries, count + 1); 766 dx_set_count(entries, count + 1);
768} 767}
769#endif
770
771 768
772static void ext4_update_dx_flag(struct inode *inode) 769static void ext4_update_dx_flag(struct inode *inode)
773{ 770{
@@ -869,7 +866,6 @@ static struct buffer_head * ext4_find_entry (struct dentry *dentry,
869 name = dentry->d_name.name; 866 name = dentry->d_name.name;
870 if (namelen > EXT4_NAME_LEN) 867 if (namelen > EXT4_NAME_LEN)
871 return NULL; 868 return NULL;
872#ifdef CONFIG_EXT4_INDEX
873 if (is_dx(dir)) { 869 if (is_dx(dir)) {
874 bh = ext4_dx_find_entry(dentry, res_dir, &err); 870 bh = ext4_dx_find_entry(dentry, res_dir, &err);
875 /* 871 /*
@@ -881,7 +877,6 @@ static struct buffer_head * ext4_find_entry (struct dentry *dentry,
881 return bh; 877 return bh;
882 dxtrace(printk("ext4_find_entry: dx failed, falling back\n")); 878 dxtrace(printk("ext4_find_entry: dx failed, falling back\n"));
883 } 879 }
884#endif
885 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb); 880 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb);
886 start = EXT4_I(dir)->i_dir_start_lookup; 881 start = EXT4_I(dir)->i_dir_start_lookup;
887 if (start >= nblocks) 882 if (start >= nblocks)
@@ -957,7 +952,6 @@ cleanup_and_exit:
957 return ret; 952 return ret;
958} 953}
959 954
960#ifdef CONFIG_EXT4_INDEX
961static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry, 955static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry,
962 struct ext4_dir_entry_2 **res_dir, int *err) 956 struct ext4_dir_entry_2 **res_dir, int *err)
963{ 957{
@@ -1025,7 +1019,6 @@ errout:
1025 dx_release (frames); 1019 dx_release (frames);
1026 return NULL; 1020 return NULL;
1027} 1021}
1028#endif
1029 1022
1030static struct dentry *ext4_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) 1023static struct dentry *ext4_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd)
1031{ 1024{
@@ -1121,7 +1114,6 @@ static inline void ext4_set_de_type(struct super_block *sb,
1121 de->file_type = ext4_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; 1114 de->file_type = ext4_type_by_mode[(mode & S_IFMT)>>S_SHIFT];
1122} 1115}
1123 1116
1124#ifdef CONFIG_EXT4_INDEX
1125/* 1117/*
1126 * Move count entries from end of map between two memory locations. 1118 * Move count entries from end of map between two memory locations.
1127 * Returns pointer to last entry moved. 1119 * Returns pointer to last entry moved.
@@ -1266,8 +1258,6 @@ errout:
1266 *error = err; 1258 *error = err;
1267 return NULL; 1259 return NULL;
1268} 1260}
1269#endif
1270
1271 1261
1272/* 1262/*
1273 * Add a new entry into a directory (leaf) block. If de is non-NULL, 1263 * Add a new entry into a directory (leaf) block. If de is non-NULL,
@@ -1364,7 +1354,6 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry,
1364 return 0; 1354 return 0;
1365} 1355}
1366 1356
1367#ifdef CONFIG_EXT4_INDEX
1368/* 1357/*
1369 * This converts a one block unindexed directory to a 3 block indexed 1358 * This converts a one block unindexed directory to a 3 block indexed
1370 * directory, and adds the dentry to the indexed directory. 1359 * directory, and adds the dentry to the indexed directory.
@@ -1443,7 +1432,6 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
1443 1432
1444 return add_dirent_to_buf(handle, dentry, inode, de, bh); 1433 return add_dirent_to_buf(handle, dentry, inode, de, bh);
1445} 1434}
1446#endif
1447 1435
1448/* 1436/*
1449 * ext4_add_entry() 1437 * ext4_add_entry()
@@ -1464,9 +1452,7 @@ static int ext4_add_entry (handle_t *handle, struct dentry *dentry,
1464 struct ext4_dir_entry_2 *de; 1452 struct ext4_dir_entry_2 *de;
1465 struct super_block * sb; 1453 struct super_block * sb;
1466 int retval; 1454 int retval;
1467#ifdef CONFIG_EXT4_INDEX
1468 int dx_fallback=0; 1455 int dx_fallback=0;
1469#endif
1470 unsigned blocksize; 1456 unsigned blocksize;
1471 u32 block, blocks; 1457 u32 block, blocks;
1472 1458
@@ -1474,7 +1460,6 @@ static int ext4_add_entry (handle_t *handle, struct dentry *dentry,
1474 blocksize = sb->s_blocksize; 1460 blocksize = sb->s_blocksize;
1475 if (!dentry->d_name.len) 1461 if (!dentry->d_name.len)
1476 return -EINVAL; 1462 return -EINVAL;
1477#ifdef CONFIG_EXT4_INDEX
1478 if (is_dx(dir)) { 1463 if (is_dx(dir)) {
1479 retval = ext4_dx_add_entry(handle, dentry, inode); 1464 retval = ext4_dx_add_entry(handle, dentry, inode);
1480 if (!retval || (retval != ERR_BAD_DX_DIR)) 1465 if (!retval || (retval != ERR_BAD_DX_DIR))
@@ -1483,7 +1468,6 @@ static int ext4_add_entry (handle_t *handle, struct dentry *dentry,
1483 dx_fallback++; 1468 dx_fallback++;
1484 ext4_mark_inode_dirty(handle, dir); 1469 ext4_mark_inode_dirty(handle, dir);
1485 } 1470 }
1486#endif
1487 blocks = dir->i_size >> sb->s_blocksize_bits; 1471 blocks = dir->i_size >> sb->s_blocksize_bits;
1488 for (block = 0, offset = 0; block < blocks; block++) { 1472 for (block = 0, offset = 0; block < blocks; block++) {
1489 bh = ext4_bread(handle, dir, block, 0, &retval); 1473 bh = ext4_bread(handle, dir, block, 0, &retval);
@@ -1493,11 +1477,9 @@ static int ext4_add_entry (handle_t *handle, struct dentry *dentry,
1493 if (retval != -ENOSPC) 1477 if (retval != -ENOSPC)
1494 return retval; 1478 return retval;
1495 1479
1496#ifdef CONFIG_EXT4_INDEX
1497 if (blocks == 1 && !dx_fallback && 1480 if (blocks == 1 && !dx_fallback &&
1498 EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_DIR_INDEX)) 1481 EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_DIR_INDEX))
1499 return make_indexed_dir(handle, dentry, inode, bh); 1482 return make_indexed_dir(handle, dentry, inode, bh);
1500#endif
1501 brelse(bh); 1483 brelse(bh);
1502 } 1484 }
1503 bh = ext4_append(handle, dir, &block, &retval); 1485 bh = ext4_append(handle, dir, &block, &retval);
@@ -1509,7 +1491,6 @@ static int ext4_add_entry (handle_t *handle, struct dentry *dentry,
1509 return add_dirent_to_buf(handle, dentry, inode, de, bh); 1491 return add_dirent_to_buf(handle, dentry, inode, de, bh);
1510} 1492}
1511 1493
1512#ifdef CONFIG_EXT4_INDEX
1513/* 1494/*
1514 * Returns 0 for success, or a negative error value 1495 * Returns 0 for success, or a negative error value
1515 */ 1496 */
@@ -1644,7 +1625,6 @@ cleanup:
1644 dx_release(frames); 1625 dx_release(frames);
1645 return err; 1626 return err;
1646} 1627}
1647#endif
1648 1628
1649/* 1629/*
1650 * ext4_delete_entry deletes a directory entry by merging it with the 1630 * ext4_delete_entry deletes a directory entry by merging it with the