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.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 387ad98350c3..978b57f8630d 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -254,12 +254,12 @@ static inline unsigned dx_node_limit (struct inode *dir)
254 * Debug 254 * Debug
255 */ 255 */
256#ifdef DX_DEBUG 256#ifdef DX_DEBUG
257static void dx_show_index (char * label, struct dx_entry *entries) 257static void dx_show_index(char * label, struct dx_entry *entries)
258{ 258{
259 int i, n = dx_get_count (entries); 259 int i, n = dx_get_count (entries);
260 printk("%s index ", label); 260 printk(KERN_DEBUG "%s index ", label);
261 for (i = 0; i < n; i++) { 261 for (i = 0; i < n; i++) {
262 printk("%x->%lu ", i? dx_get_hash(entries + i) : 262 printk("%x->%lu ", i ? dx_get_hash(entries + i) :
263 0, (unsigned long)dx_get_block(entries + i)); 263 0, (unsigned long)dx_get_block(entries + i));
264 } 264 }
265 printk("\n"); 265 printk("\n");
@@ -328,8 +328,9 @@ struct stats dx_show_entries(struct dx_hash_info *hinfo, struct inode *dir,
328 brelse (bh); 328 brelse (bh);
329 } 329 }
330 if (bcount) 330 if (bcount)
331 printk("%snames %u, fullness %u (%u%%)\n", levels?"":" ", 331 printk(KERN_DEBUG "%snames %u, fullness %u (%u%%)\n",
332 names, space/bcount,(space/bcount)*100/blocksize); 332 levels ? "" : " ", names, space/bcount,
333 (space/bcount)*100/blocksize);
333 return (struct stats) { names, space, bcount}; 334 return (struct stats) { names, space, bcount};
334} 335}
335#endif /* DX_DEBUG */ 336#endif /* DX_DEBUG */
@@ -635,8 +636,8 @@ int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
635 int ret, err; 636 int ret, err;
636 __u32 hashval; 637 __u32 hashval;
637 638
638 dxtrace(printk("In htree_fill_tree, start hash: %x:%x\n", start_hash, 639 dxtrace(printk(KERN_DEBUG "In htree_fill_tree, start hash: %x:%x\n",
639 start_minor_hash)); 640 start_hash, start_minor_hash));
640 dir = dir_file->f_path.dentry->d_inode; 641 dir = dir_file->f_path.dentry->d_inode;
641 if (!(EXT4_I(dir)->i_flags & EXT4_INDEX_FL)) { 642 if (!(EXT4_I(dir)->i_flags & EXT4_INDEX_FL)) {
642 hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version; 643 hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version;
@@ -694,8 +695,8 @@ int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash,
694 break; 695 break;
695 } 696 }
696 dx_release(frames); 697 dx_release(frames);
697 dxtrace(printk("Fill tree: returned %d entries, next hash: %x\n", 698 dxtrace(printk(KERN_DEBUG "Fill tree: returned %d entries, "
698 count, *next_hash)); 699 "next hash: %x\n", count, *next_hash));
699 return count; 700 return count;
700errout: 701errout:
701 dx_release(frames); 702 dx_release(frames);
@@ -882,7 +883,8 @@ static struct buffer_head * ext4_find_entry (struct dentry *dentry,
882 */ 883 */
883 if (bh || (err != ERR_BAD_DX_DIR)) 884 if (bh || (err != ERR_BAD_DX_DIR))
884 return bh; 885 return bh;
885 dxtrace(printk("ext4_find_entry: dx failed, falling back\n")); 886 dxtrace(printk(KERN_DEBUG "ext4_find_entry: dx failed, "
887 "falling back\n"));
886 } 888 }
887 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb); 889 nblocks = dir->i_size >> EXT4_BLOCK_SIZE_BITS(sb);
888 start = EXT4_I(dir)->i_dir_start_lookup; 890 start = EXT4_I(dir)->i_dir_start_lookup;
@@ -1025,7 +1027,7 @@ static struct buffer_head * ext4_dx_find_entry(struct dentry *dentry,
1025 1027
1026 *err = -ENOENT; 1028 *err = -ENOENT;
1027errout: 1029errout:
1028 dxtrace(printk("%s not found\n", name)); 1030 dxtrace(printk(KERN_DEBUG "%s not found\n", name));
1029 dx_release (frames); 1031 dx_release (frames);
1030 return NULL; 1032 return NULL;
1031} 1033}
@@ -1377,7 +1379,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
1377 struct fake_dirent *fde; 1379 struct fake_dirent *fde;
1378 1380
1379 blocksize = dir->i_sb->s_blocksize; 1381 blocksize = dir->i_sb->s_blocksize;
1380 dxtrace(printk("Creating index\n")); 1382 dxtrace(printk(KERN_DEBUG "Creating index\n"));
1381 retval = ext4_journal_get_write_access(handle, bh); 1383 retval = ext4_journal_get_write_access(handle, bh);
1382 if (retval) { 1384 if (retval) {
1383 ext4_std_error(dir->i_sb, retval); 1385 ext4_std_error(dir->i_sb, retval);
@@ -1527,7 +1529,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
1527 } 1529 }
1528 1530
1529 /* Block full, should compress but for now just split */ 1531 /* Block full, should compress but for now just split */
1530 dxtrace(printk("using %u of %u node entries\n", 1532 dxtrace(printk(KERN_DEBUG "using %u of %u node entries\n",
1531 dx_get_count(entries), dx_get_limit(entries))); 1533 dx_get_count(entries), dx_get_limit(entries)));
1532 /* Need to split index? */ 1534 /* Need to split index? */
1533 if (dx_get_count(entries) == dx_get_limit(entries)) { 1535 if (dx_get_count(entries) == dx_get_limit(entries)) {
@@ -1559,7 +1561,8 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
1559 if (levels) { 1561 if (levels) {
1560 unsigned icount1 = icount/2, icount2 = icount - icount1; 1562 unsigned icount1 = icount/2, icount2 = icount - icount1;
1561 unsigned hash2 = dx_get_hash(entries + icount1); 1563 unsigned hash2 = dx_get_hash(entries + icount1);
1562 dxtrace(printk("Split index %i/%i\n", icount1, icount2)); 1564 dxtrace(printk(KERN_DEBUG "Split index %i/%i\n",
1565 icount1, icount2));
1563 1566
1564 BUFFER_TRACE(frame->bh, "get_write_access"); /* index root */ 1567 BUFFER_TRACE(frame->bh, "get_write_access"); /* index root */
1565 err = ext4_journal_get_write_access(handle, 1568 err = ext4_journal_get_write_access(handle,
@@ -1588,7 +1591,8 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
1588 goto journal_error; 1591 goto journal_error;
1589 brelse (bh2); 1592 brelse (bh2);
1590 } else { 1593 } else {
1591 dxtrace(printk("Creating second level index...\n")); 1594 dxtrace(printk(KERN_DEBUG
1595 "Creating second level index...\n"));
1592 memcpy((char *) entries2, (char *) entries, 1596 memcpy((char *) entries2, (char *) entries,
1593 icount * sizeof(struct dx_entry)); 1597 icount * sizeof(struct dx_entry));
1594 dx_set_limit(entries2, dx_node_limit(dir)); 1598 dx_set_limit(entries2, dx_node_limit(dir));