diff options
author | Eric Sandeen <sandeen@redhat.com> | 2010-02-15 14:19:27 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-02-15 14:19:27 -0500 |
commit | 12062dddda450976b129dcb1bacd91acaf4d8030 (patch) | |
tree | e64590b1147639cd3629f8a977b269410cd6bd13 /fs/ext4/namei.c | |
parent | f710b4b96ba292dfed2153afc47e9063b0abfd89 (diff) |
ext4: move __func__ into a macro for ext4_warning, ext4_error
Just a pet peeve of mine; we had a mishash of calls with either __func__
or "function_name" and the latter tends to get out of sync.
I think it's easier to just hide the __func__ in a macro, and it'll
be consistent from then on.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r-- | fs/ext4/namei.c | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 17a17e10dd60..bd2dc0b71c8c 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -383,8 +383,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir, | |||
383 | if (root->info.hash_version != DX_HASH_TEA && | 383 | if (root->info.hash_version != DX_HASH_TEA && |
384 | root->info.hash_version != DX_HASH_HALF_MD4 && | 384 | root->info.hash_version != DX_HASH_HALF_MD4 && |
385 | root->info.hash_version != DX_HASH_LEGACY) { | 385 | root->info.hash_version != DX_HASH_LEGACY) { |
386 | ext4_warning(dir->i_sb, __func__, | 386 | ext4_warning(dir->i_sb, "Unrecognised inode hash code %d", |
387 | "Unrecognised inode hash code %d", | ||
388 | root->info.hash_version); | 387 | root->info.hash_version); |
389 | brelse(bh); | 388 | brelse(bh); |
390 | *err = ERR_BAD_DX_DIR; | 389 | *err = ERR_BAD_DX_DIR; |
@@ -399,8 +398,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir, | |||
399 | hash = hinfo->hash; | 398 | hash = hinfo->hash; |
400 | 399 | ||
401 | if (root->info.unused_flags & 1) { | 400 | if (root->info.unused_flags & 1) { |
402 | ext4_warning(dir->i_sb, __func__, | 401 | ext4_warning(dir->i_sb, "Unimplemented inode hash flags: %#06x", |
403 | "Unimplemented inode hash flags: %#06x", | ||
404 | root->info.unused_flags); | 402 | root->info.unused_flags); |
405 | brelse(bh); | 403 | brelse(bh); |
406 | *err = ERR_BAD_DX_DIR; | 404 | *err = ERR_BAD_DX_DIR; |
@@ -408,8 +406,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir, | |||
408 | } | 406 | } |
409 | 407 | ||
410 | if ((indirect = root->info.indirect_levels) > 1) { | 408 | if ((indirect = root->info.indirect_levels) > 1) { |
411 | ext4_warning(dir->i_sb, __func__, | 409 | ext4_warning(dir->i_sb, "Unimplemented inode hash depth: %#06x", |
412 | "Unimplemented inode hash depth: %#06x", | ||
413 | root->info.indirect_levels); | 410 | root->info.indirect_levels); |
414 | brelse(bh); | 411 | brelse(bh); |
415 | *err = ERR_BAD_DX_DIR; | 412 | *err = ERR_BAD_DX_DIR; |
@@ -421,8 +418,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir, | |||
421 | 418 | ||
422 | if (dx_get_limit(entries) != dx_root_limit(dir, | 419 | if (dx_get_limit(entries) != dx_root_limit(dir, |
423 | root->info.info_length)) { | 420 | root->info.info_length)) { |
424 | ext4_warning(dir->i_sb, __func__, | 421 | ext4_warning(dir->i_sb, "dx entry: limit != root limit"); |
425 | "dx entry: limit != root limit"); | ||
426 | brelse(bh); | 422 | brelse(bh); |
427 | *err = ERR_BAD_DX_DIR; | 423 | *err = ERR_BAD_DX_DIR; |
428 | goto fail; | 424 | goto fail; |
@@ -433,7 +429,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir, | |||
433 | { | 429 | { |
434 | count = dx_get_count(entries); | 430 | count = dx_get_count(entries); |
435 | if (!count || count > dx_get_limit(entries)) { | 431 | if (!count || count > dx_get_limit(entries)) { |
436 | ext4_warning(dir->i_sb, __func__, | 432 | ext4_warning(dir->i_sb, |
437 | "dx entry: no count or count > limit"); | 433 | "dx entry: no count or count > limit"); |
438 | brelse(bh); | 434 | brelse(bh); |
439 | *err = ERR_BAD_DX_DIR; | 435 | *err = ERR_BAD_DX_DIR; |
@@ -478,7 +474,7 @@ dx_probe(const struct qstr *d_name, struct inode *dir, | |||
478 | goto fail2; | 474 | goto fail2; |
479 | at = entries = ((struct dx_node *) bh->b_data)->entries; | 475 | at = entries = ((struct dx_node *) bh->b_data)->entries; |
480 | if (dx_get_limit(entries) != dx_node_limit (dir)) { | 476 | if (dx_get_limit(entries) != dx_node_limit (dir)) { |
481 | ext4_warning(dir->i_sb, __func__, | 477 | ext4_warning(dir->i_sb, |
482 | "dx entry: limit != node limit"); | 478 | "dx entry: limit != node limit"); |
483 | brelse(bh); | 479 | brelse(bh); |
484 | *err = ERR_BAD_DX_DIR; | 480 | *err = ERR_BAD_DX_DIR; |
@@ -494,7 +490,7 @@ fail2: | |||
494 | } | 490 | } |
495 | fail: | 491 | fail: |
496 | if (*err == ERR_BAD_DX_DIR) | 492 | if (*err == ERR_BAD_DX_DIR) |
497 | ext4_warning(dir->i_sb, __func__, | 493 | ext4_warning(dir->i_sb, |
498 | "Corrupt dir inode %ld, running e2fsck is " | 494 | "Corrupt dir inode %ld, running e2fsck is " |
499 | "recommended.", dir->i_ino); | 495 | "recommended.", dir->i_ino); |
500 | return NULL; | 496 | return NULL; |
@@ -947,9 +943,8 @@ restart: | |||
947 | wait_on_buffer(bh); | 943 | wait_on_buffer(bh); |
948 | if (!buffer_uptodate(bh)) { | 944 | if (!buffer_uptodate(bh)) { |
949 | /* read error, skip block & hope for the best */ | 945 | /* read error, skip block & hope for the best */ |
950 | ext4_error(sb, __func__, "reading directory #%lu " | 946 | ext4_error(sb, "reading directory #%lu offset %lu", |
951 | "offset %lu", dir->i_ino, | 947 | dir->i_ino, (unsigned long)block); |
952 | (unsigned long)block); | ||
953 | brelse(bh); | 948 | brelse(bh); |
954 | goto next; | 949 | goto next; |
955 | } | 950 | } |
@@ -1041,7 +1036,7 @@ static struct buffer_head * ext4_dx_find_entry(struct inode *dir, const struct q | |||
1041 | retval = ext4_htree_next_block(dir, hash, frame, | 1036 | retval = ext4_htree_next_block(dir, hash, frame, |
1042 | frames, NULL); | 1037 | frames, NULL); |
1043 | if (retval < 0) { | 1038 | if (retval < 0) { |
1044 | ext4_warning(sb, __func__, | 1039 | ext4_warning(sb, |
1045 | "error reading index page in directory #%lu", | 1040 | "error reading index page in directory #%lu", |
1046 | dir->i_ino); | 1041 | dir->i_ino); |
1047 | *err = retval; | 1042 | *err = retval; |
@@ -1071,14 +1066,13 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, stru | |||
1071 | __u32 ino = le32_to_cpu(de->inode); | 1066 | __u32 ino = le32_to_cpu(de->inode); |
1072 | brelse(bh); | 1067 | brelse(bh); |
1073 | if (!ext4_valid_inum(dir->i_sb, ino)) { | 1068 | if (!ext4_valid_inum(dir->i_sb, ino)) { |
1074 | ext4_error(dir->i_sb, "ext4_lookup", | 1069 | ext4_error(dir->i_sb, "bad inode number: %u", ino); |
1075 | "bad inode number: %u", ino); | ||
1076 | return ERR_PTR(-EIO); | 1070 | return ERR_PTR(-EIO); |
1077 | } | 1071 | } |
1078 | inode = ext4_iget(dir->i_sb, ino); | 1072 | inode = ext4_iget(dir->i_sb, ino); |
1079 | if (unlikely(IS_ERR(inode))) { | 1073 | if (unlikely(IS_ERR(inode))) { |
1080 | if (PTR_ERR(inode) == -ESTALE) { | 1074 | if (PTR_ERR(inode) == -ESTALE) { |
1081 | ext4_error(dir->i_sb, __func__, | 1075 | ext4_error(dir->i_sb, |
1082 | "deleted inode referenced: %u", | 1076 | "deleted inode referenced: %u", |
1083 | ino); | 1077 | ino); |
1084 | return ERR_PTR(-EIO); | 1078 | return ERR_PTR(-EIO); |
@@ -1110,7 +1104,7 @@ struct dentry *ext4_get_parent(struct dentry *child) | |||
1110 | brelse(bh); | 1104 | brelse(bh); |
1111 | 1105 | ||
1112 | if (!ext4_valid_inum(child->d_inode->i_sb, ino)) { | 1106 | if (!ext4_valid_inum(child->d_inode->i_sb, ino)) { |
1113 | ext4_error(child->d_inode->i_sb, "ext4_get_parent", | 1107 | ext4_error(child->d_inode->i_sb, |
1114 | "bad inode number: %u", ino); | 1108 | "bad inode number: %u", ino); |
1115 | return ERR_PTR(-EIO); | 1109 | return ERR_PTR(-EIO); |
1116 | } | 1110 | } |
@@ -1410,7 +1404,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry, | |||
1410 | de = (struct ext4_dir_entry_2 *)((char *)fde + | 1404 | de = (struct ext4_dir_entry_2 *)((char *)fde + |
1411 | ext4_rec_len_from_disk(fde->rec_len, blocksize)); | 1405 | ext4_rec_len_from_disk(fde->rec_len, blocksize)); |
1412 | if ((char *) de >= (((char *) root) + blocksize)) { | 1406 | if ((char *) de >= (((char *) root) + blocksize)) { |
1413 | ext4_error(dir->i_sb, __func__, | 1407 | ext4_error(dir->i_sb, |
1414 | "invalid rec_len for '..' in inode %lu", | 1408 | "invalid rec_len for '..' in inode %lu", |
1415 | dir->i_ino); | 1409 | dir->i_ino); |
1416 | brelse(bh); | 1410 | brelse(bh); |
@@ -1575,8 +1569,7 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry, | |||
1575 | 1569 | ||
1576 | if (levels && (dx_get_count(frames->entries) == | 1570 | if (levels && (dx_get_count(frames->entries) == |
1577 | dx_get_limit(frames->entries))) { | 1571 | dx_get_limit(frames->entries))) { |
1578 | ext4_warning(sb, __func__, | 1572 | ext4_warning(sb, "Directory index full!"); |
1579 | "Directory index full!"); | ||
1580 | err = -ENOSPC; | 1573 | err = -ENOSPC; |
1581 | goto cleanup; | 1574 | goto cleanup; |
1582 | } | 1575 | } |
@@ -1916,11 +1909,11 @@ static int empty_dir(struct inode *inode) | |||
1916 | if (inode->i_size < EXT4_DIR_REC_LEN(1) + EXT4_DIR_REC_LEN(2) || | 1909 | if (inode->i_size < EXT4_DIR_REC_LEN(1) + EXT4_DIR_REC_LEN(2) || |
1917 | !(bh = ext4_bread(NULL, inode, 0, 0, &err))) { | 1910 | !(bh = ext4_bread(NULL, inode, 0, 0, &err))) { |
1918 | if (err) | 1911 | if (err) |
1919 | ext4_error(inode->i_sb, __func__, | 1912 | ext4_error(inode->i_sb, |
1920 | "error %d reading directory #%lu offset 0", | 1913 | "error %d reading directory #%lu offset 0", |
1921 | err, inode->i_ino); | 1914 | err, inode->i_ino); |
1922 | else | 1915 | else |
1923 | ext4_warning(inode->i_sb, __func__, | 1916 | ext4_warning(inode->i_sb, |
1924 | "bad directory (dir #%lu) - no data block", | 1917 | "bad directory (dir #%lu) - no data block", |
1925 | inode->i_ino); | 1918 | inode->i_ino); |
1926 | return 1; | 1919 | return 1; |
@@ -1931,7 +1924,7 @@ static int empty_dir(struct inode *inode) | |||
1931 | !le32_to_cpu(de1->inode) || | 1924 | !le32_to_cpu(de1->inode) || |
1932 | strcmp(".", de->name) || | 1925 | strcmp(".", de->name) || |
1933 | strcmp("..", de1->name)) { | 1926 | strcmp("..", de1->name)) { |
1934 | ext4_warning(inode->i_sb, "empty_dir", | 1927 | ext4_warning(inode->i_sb, |
1935 | "bad directory (dir #%lu) - no `.' or `..'", | 1928 | "bad directory (dir #%lu) - no `.' or `..'", |
1936 | inode->i_ino); | 1929 | inode->i_ino); |
1937 | brelse(bh); | 1930 | brelse(bh); |
@@ -1949,7 +1942,7 @@ static int empty_dir(struct inode *inode) | |||
1949 | offset >> EXT4_BLOCK_SIZE_BITS(sb), 0, &err); | 1942 | offset >> EXT4_BLOCK_SIZE_BITS(sb), 0, &err); |
1950 | if (!bh) { | 1943 | if (!bh) { |
1951 | if (err) | 1944 | if (err) |
1952 | ext4_error(sb, __func__, | 1945 | ext4_error(sb, |
1953 | "error %d reading directory" | 1946 | "error %d reading directory" |
1954 | " #%lu offset %u", | 1947 | " #%lu offset %u", |
1955 | err, inode->i_ino, offset); | 1948 | err, inode->i_ino, offset); |
@@ -2163,7 +2156,7 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry) | |||
2163 | if (retval) | 2156 | if (retval) |
2164 | goto end_rmdir; | 2157 | goto end_rmdir; |
2165 | if (!EXT4_DIR_LINK_EMPTY(inode)) | 2158 | if (!EXT4_DIR_LINK_EMPTY(inode)) |
2166 | ext4_warning(inode->i_sb, "ext4_rmdir", | 2159 | ext4_warning(inode->i_sb, |
2167 | "empty directory has too many links (%d)", | 2160 | "empty directory has too many links (%d)", |
2168 | inode->i_nlink); | 2161 | inode->i_nlink); |
2169 | inode->i_version++; | 2162 | inode->i_version++; |
@@ -2215,7 +2208,7 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry) | |||
2215 | goto end_unlink; | 2208 | goto end_unlink; |
2216 | 2209 | ||
2217 | if (!inode->i_nlink) { | 2210 | if (!inode->i_nlink) { |
2218 | ext4_warning(inode->i_sb, "ext4_unlink", | 2211 | ext4_warning(inode->i_sb, |
2219 | "Deleting nonexistent file (%lu), %d", | 2212 | "Deleting nonexistent file (%lu), %d", |
2220 | inode->i_ino, inode->i_nlink); | 2213 | inode->i_ino, inode->i_nlink); |
2221 | inode->i_nlink = 1; | 2214 | inode->i_nlink = 1; |
@@ -2462,7 +2455,7 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
2462 | } | 2455 | } |
2463 | } | 2456 | } |
2464 | if (retval) { | 2457 | if (retval) { |
2465 | ext4_warning(old_dir->i_sb, "ext4_rename", | 2458 | ext4_warning(old_dir->i_sb, |
2466 | "Deleting old file (%lu), %d, error=%d", | 2459 | "Deleting old file (%lu), %d, error=%d", |
2467 | old_dir->i_ino, old_dir->i_nlink, retval); | 2460 | old_dir->i_ino, old_dir->i_nlink, retval); |
2468 | } | 2461 | } |