diff options
author | Theodore Ts'o <tytso@mit.edu> | 2010-07-27 11:54:40 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-07-27 11:54:40 -0400 |
commit | 60fd4da34d55a9cc0d857fc76dc12cf8cab4ed02 (patch) | |
tree | 72c6b3d9c7680070a751da56bd9068f71e7b106f /fs/ext4/namei.c | |
parent | 90c7201b97bb7ac5a4e2605abc0efb5fdfb957f0 (diff) |
ext4: Cleanup ext4_check_dir_entry so __func__ is now implicit
Also start passing the line number to ext4_check_dir since we're going
to need it in upcoming patch.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r-- | fs/ext4/namei.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 5a61f77e7d7c..ea8b59d96213 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -605,7 +605,7 @@ static int htree_dirblock_to_tree(struct file *dir_file, | |||
605 | dir->i_sb->s_blocksize - | 605 | dir->i_sb->s_blocksize - |
606 | EXT4_DIR_REC_LEN(0)); | 606 | EXT4_DIR_REC_LEN(0)); |
607 | for (; de < top; de = ext4_next_entry(de, dir->i_sb->s_blocksize)) { | 607 | for (; de < top; de = ext4_next_entry(de, dir->i_sb->s_blocksize)) { |
608 | if (!ext4_check_dir_entry("htree_dirblock_to_tree", dir, de, bh, | 608 | if (!ext4_check_dir_entry(dir, de, bh, |
609 | (block<<EXT4_BLOCK_SIZE_BITS(dir->i_sb)) | 609 | (block<<EXT4_BLOCK_SIZE_BITS(dir->i_sb)) |
610 | +((char *)de - bh->b_data))) { | 610 | +((char *)de - bh->b_data))) { |
611 | /* On error, skip the f_pos to the next block. */ | 611 | /* On error, skip the f_pos to the next block. */ |
@@ -844,8 +844,7 @@ static inline int search_dirblock(struct buffer_head *bh, | |||
844 | if ((char *) de + namelen <= dlimit && | 844 | if ((char *) de + namelen <= dlimit && |
845 | ext4_match (namelen, name, de)) { | 845 | ext4_match (namelen, name, de)) { |
846 | /* found a match - just to be sure, do a full check */ | 846 | /* found a match - just to be sure, do a full check */ |
847 | if (!ext4_check_dir_entry("ext4_find_entry", | 847 | if (!ext4_check_dir_entry(dir, de, bh, offset)) |
848 | dir, de, bh, offset)) | ||
849 | return -1; | 848 | return -1; |
850 | *res_dir = de; | 849 | *res_dir = de; |
851 | return 1; | 850 | return 1; |
@@ -1019,7 +1018,7 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir, const struct q | |||
1019 | int off = (block << EXT4_BLOCK_SIZE_BITS(sb)) | 1018 | int off = (block << EXT4_BLOCK_SIZE_BITS(sb)) |
1020 | + ((char *) de - bh->b_data); | 1019 | + ((char *) de - bh->b_data); |
1021 | 1020 | ||
1022 | if (!ext4_check_dir_entry(__func__, dir, de, bh, off)) { | 1021 | if (!ext4_check_dir_entry(dir, de, bh, off)) { |
1023 | brelse(bh); | 1022 | brelse(bh); |
1024 | *err = ERR_BAD_DX_DIR; | 1023 | *err = ERR_BAD_DX_DIR; |
1025 | goto errout; | 1024 | goto errout; |
@@ -1303,8 +1302,7 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry, | |||
1303 | de = (struct ext4_dir_entry_2 *)bh->b_data; | 1302 | de = (struct ext4_dir_entry_2 *)bh->b_data; |
1304 | top = bh->b_data + blocksize - reclen; | 1303 | top = bh->b_data + blocksize - reclen; |
1305 | while ((char *) de <= top) { | 1304 | while ((char *) de <= top) { |
1306 | if (!ext4_check_dir_entry("ext4_add_entry", dir, de, | 1305 | if (!ext4_check_dir_entry(dir, de, bh, offset)) |
1307 | bh, offset)) | ||
1308 | return -EIO; | 1306 | return -EIO; |
1309 | if (ext4_match(namelen, name, de)) | 1307 | if (ext4_match(namelen, name, de)) |
1310 | return -EEXIST; | 1308 | return -EEXIST; |
@@ -1671,7 +1669,7 @@ static int ext4_delete_entry(handle_t *handle, | |||
1671 | pde = NULL; | 1669 | pde = NULL; |
1672 | de = (struct ext4_dir_entry_2 *) bh->b_data; | 1670 | de = (struct ext4_dir_entry_2 *) bh->b_data; |
1673 | while (i < bh->b_size) { | 1671 | while (i < bh->b_size) { |
1674 | if (!ext4_check_dir_entry("ext4_delete_entry", dir, de, bh, i)) | 1672 | if (!ext4_check_dir_entry(dir, de, bh, i)) |
1675 | return -EIO; | 1673 | return -EIO; |
1676 | if (de == de_del) { | 1674 | if (de == de_del) { |
1677 | BUFFER_TRACE(bh, "get_write_access"); | 1675 | BUFFER_TRACE(bh, "get_write_access"); |
@@ -1954,7 +1952,7 @@ static int empty_dir(struct inode *inode) | |||
1954 | } | 1952 | } |
1955 | de = (struct ext4_dir_entry_2 *) bh->b_data; | 1953 | de = (struct ext4_dir_entry_2 *) bh->b_data; |
1956 | } | 1954 | } |
1957 | if (!ext4_check_dir_entry("empty_dir", inode, de, bh, offset)) { | 1955 | if (!ext4_check_dir_entry(inode, de, bh, offset)) { |
1958 | de = (struct ext4_dir_entry_2 *)(bh->b_data + | 1956 | de = (struct ext4_dir_entry_2 *)(bh->b_data + |
1959 | sb->s_blocksize); | 1957 | sb->s_blocksize); |
1960 | offset = (offset | (sb->s_blocksize - 1)) + 1; | 1958 | offset = (offset | (sb->s_blocksize - 1)) + 1; |