aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorTao Ma <boyu.mt@taobao.com>2011-02-23 09:30:23 -0500
committerTao Ma <boyu.mt@taobao.com>2011-02-23 09:30:23 -0500
commitf1088d471f8d846e817eb4d673212d18d9820c61 (patch)
tree3b2108676d74c0341808b8c716fa3248a3861120 /fs/ocfs2
parentf32037d9bda37ca9a7a179cc1546033d374a8541 (diff)
ocfs2: Remove mlog(0) from fs/ocfs2/dir.c
This is the 2nd step to remove the debug info of NAMEI. Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/dir.c83
-rw-r--r--fs/ocfs2/ocfs2_trace.h116
2 files changed, 153 insertions, 46 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index 2fc6c3673bea..0740752ca31e 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -43,7 +43,6 @@
43#include <linux/quotaops.h> 43#include <linux/quotaops.h>
44#include <linux/sort.h> 44#include <linux/sort.h>
45 45
46#define MLOG_MASK_PREFIX ML_NAMEI
47#include <cluster/masklog.h> 46#include <cluster/masklog.h>
48 47
49#include "ocfs2.h" 48#include "ocfs2.h"
@@ -61,6 +60,7 @@
61#include "super.h" 60#include "super.h"
62#include "sysfile.h" 61#include "sysfile.h"
63#include "uptodate.h" 62#include "uptodate.h"
63#include "ocfs2_trace.h"
64 64
65#include "buffer_head_io.h" 65#include "buffer_head_io.h"
66 66
@@ -400,7 +400,7 @@ static int inline ocfs2_search_dirblock(struct buffer_head *bh,
400 } 400 }
401 401
402bail: 402bail:
403 mlog(0, "ret = %d\n", ret); 403 trace_ocfs2_search_dirblock(ret);
404 return ret; 404 return ret;
405} 405}
406 406
@@ -445,8 +445,7 @@ static int ocfs2_validate_dir_block(struct super_block *sb,
445 * We don't validate dirents here, that's handled 445 * We don't validate dirents here, that's handled
446 * in-place when the code walks them. 446 * in-place when the code walks them.
447 */ 447 */
448 mlog(0, "Validating dirblock %llu\n", 448 trace_ocfs2_validate_dir_block((unsigned long long)bh->b_blocknr);
449 (unsigned long long)bh->b_blocknr);
450 449
451 BUG_ON(!buffer_uptodate(bh)); 450 BUG_ON(!buffer_uptodate(bh));
452 451
@@ -784,7 +783,7 @@ cleanup_and_exit:
784 for (; ra_ptr < ra_max; ra_ptr++) 783 for (; ra_ptr < ra_max; ra_ptr++)
785 brelse(bh_use[ra_ptr]); 784 brelse(bh_use[ra_ptr]);
786 785
787 mlog(0, "ret = %p\n", ret); 786 trace_ocfs2_find_entry_el(ret);
788 return ret; 787 return ret;
789} 788}
790 789
@@ -946,11 +945,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen,
946 goto out; 945 goto out;
947 } 946 }
948 947
949 mlog(0, "Dir %llu: name: \"%.*s\", lookup of hash: %u.0x%x " 948 trace_ocfs2_dx_dir_search((unsigned long long)OCFS2_I(dir)->ip_blkno,
950 "returns: %llu\n", 949 namelen, name, hinfo->major_hash,
951 (unsigned long long)OCFS2_I(dir)->ip_blkno, 950 hinfo->minor_hash, (unsigned long long)phys);
952 namelen, name, hinfo->major_hash, hinfo->minor_hash,
953 (unsigned long long)phys);
954 951
955 ret = ocfs2_read_dx_leaf(dir, phys, &dx_leaf_bh); 952 ret = ocfs2_read_dx_leaf(dir, phys, &dx_leaf_bh);
956 if (ret) { 953 if (ret) {
@@ -960,9 +957,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen,
960 957
961 dx_leaf = (struct ocfs2_dx_leaf *) dx_leaf_bh->b_data; 958 dx_leaf = (struct ocfs2_dx_leaf *) dx_leaf_bh->b_data;
962 959
963 mlog(0, "leaf info: num_used: %d, count: %d\n", 960 trace_ocfs2_dx_dir_search_leaf_info(
964 le16_to_cpu(dx_leaf->dl_list.de_num_used), 961 le16_to_cpu(dx_leaf->dl_list.de_num_used),
965 le16_to_cpu(dx_leaf->dl_list.de_count)); 962 le16_to_cpu(dx_leaf->dl_list.de_count));
966 963
967 entry_list = &dx_leaf->dl_list; 964 entry_list = &dx_leaf->dl_list;
968 965
@@ -1162,8 +1159,6 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir,
1162 int i, status = -ENOENT; 1159 int i, status = -ENOENT;
1163 ocfs2_journal_access_func access = ocfs2_journal_access_db; 1160 ocfs2_journal_access_func access = ocfs2_journal_access_db;
1164 1161
1165 mlog(0, "(0x%p, 0x%p, 0x%p, 0x%p)\n", handle, dir, de_del, bh);
1166
1167 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) 1162 if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL)
1168 access = ocfs2_journal_access_di; 1163 access = ocfs2_journal_access_di;
1169 1164
@@ -1343,8 +1338,8 @@ static int ocfs2_delete_entry_dx(handle_t *handle, struct inode *dir,
1343 } 1338 }
1344 } 1339 }
1345 1340
1346 mlog(0, "Dir %llu: delete entry at index: %d\n", 1341 trace_ocfs2_delete_entry_dx((unsigned long long)OCFS2_I(dir)->ip_blkno,
1347 (unsigned long long)OCFS2_I(dir)->ip_blkno, index); 1342 index);
1348 1343
1349 ret = __ocfs2_delete_entry(handle, dir, lookup->dl_entry, 1344 ret = __ocfs2_delete_entry(handle, dir, lookup->dl_entry,
1350 leaf_bh, leaf_bh->b_data, leaf_bh->b_size); 1345 leaf_bh, leaf_bh->b_data, leaf_bh->b_size);
@@ -2022,8 +2017,7 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
2022 struct inode *inode = filp->f_path.dentry->d_inode; 2017 struct inode *inode = filp->f_path.dentry->d_inode;
2023 int lock_level = 0; 2018 int lock_level = 0;
2024 2019
2025 mlog(0, "dirino=%llu\n", 2020 trace_ocfs2_readdir((unsigned long long)OCFS2_I(inode)->ip_blkno);
2026 (unsigned long long)OCFS2_I(inode)->ip_blkno);
2027 2021
2028 error = ocfs2_inode_lock_atime(inode, filp->f_vfsmnt, &lock_level); 2022 error = ocfs2_inode_lock_atime(inode, filp->f_vfsmnt, &lock_level);
2029 if (lock_level && error >= 0) { 2023 if (lock_level && error >= 0) {
@@ -2064,8 +2058,8 @@ int ocfs2_find_files_on_disk(const char *name,
2064{ 2058{
2065 int status = -ENOENT; 2059 int status = -ENOENT;
2066 2060
2067 mlog(0, "name=%.*s, blkno=%p, inode=%llu\n", namelen, name, blkno, 2061 trace_ocfs2_find_files_on_disk(namelen, name, blkno,
2068 (unsigned long long)OCFS2_I(inode)->ip_blkno); 2062 (unsigned long long)OCFS2_I(inode)->ip_blkno);
2069 2063
2070 status = ocfs2_find_entry(name, namelen, inode, lookup); 2064 status = ocfs2_find_entry(name, namelen, inode, lookup);
2071 if (status) 2065 if (status)
@@ -2109,8 +2103,8 @@ int ocfs2_check_dir_for_entry(struct inode *dir,
2109 int ret; 2103 int ret;
2110 struct ocfs2_dir_lookup_result lookup = { NULL, }; 2104 struct ocfs2_dir_lookup_result lookup = { NULL, };
2111 2105
2112 mlog(0, "dir %llu, name '%.*s'\n", 2106 trace_ocfs2_check_dir_for_entry(
2113 (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name); 2107 (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name);
2114 2108
2115 ret = -EEXIST; 2109 ret = -EEXIST;
2116 if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0) 2110 if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0)
@@ -2402,9 +2396,9 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb,
2402 goto out; 2396 goto out;
2403 } 2397 }
2404 2398
2405 mlog(0, "Dir %llu, attach new index block: %llu\n", 2399 trace_ocfs2_dx_dir_attach_index(
2406 (unsigned long long)OCFS2_I(dir)->ip_blkno, 2400 (unsigned long long)OCFS2_I(dir)->ip_blkno,
2407 (unsigned long long)dr_blkno); 2401 (unsigned long long)dr_blkno);
2408 2402
2409 dx_root_bh = sb_getblk(osb->sb, dr_blkno); 2403 dx_root_bh = sb_getblk(osb->sb, dr_blkno);
2410 if (dx_root_bh == NULL) { 2404 if (dx_root_bh == NULL) {
@@ -2504,11 +2498,10 @@ static int ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb,
2504 dx_leaf->dl_list.de_count = 2498 dx_leaf->dl_list.de_count =
2505 cpu_to_le16(ocfs2_dx_entries_per_leaf(osb->sb)); 2499 cpu_to_le16(ocfs2_dx_entries_per_leaf(osb->sb));
2506 2500
2507 mlog(0, 2501 trace_ocfs2_dx_dir_format_cluster(
2508 "Dir %llu, format dx_leaf: %llu, entry count: %u\n", 2502 (unsigned long long)OCFS2_I(dir)->ip_blkno,
2509 (unsigned long long)OCFS2_I(dir)->ip_blkno, 2503 (unsigned long long)bh->b_blocknr,
2510 (unsigned long long)bh->b_blocknr, 2504 le16_to_cpu(dx_leaf->dl_list.de_count));
2511 le16_to_cpu(dx_leaf->dl_list.de_count));
2512 2505
2513 ocfs2_journal_dirty(handle, bh); 2506 ocfs2_journal_dirty(handle, bh);
2514 } 2507 }
@@ -2752,12 +2745,11 @@ static void ocfs2_dx_dir_index_root_block(struct inode *dir,
2752 2745
2753 ocfs2_dx_dir_name_hash(dir, de->name, de->name_len, &hinfo); 2746 ocfs2_dx_dir_name_hash(dir, de->name, de->name_len, &hinfo);
2754 2747
2755 mlog(0, 2748 trace_ocfs2_dx_dir_index_root_block(
2756 "dir: %llu, major: 0x%x minor: 0x%x, index: %u, name: %.*s\n", 2749 (unsigned long long)dir->i_ino,
2757 (unsigned long long)dir->i_ino, hinfo.major_hash, 2750 hinfo.major_hash, hinfo.minor_hash,
2758 hinfo.minor_hash, 2751 de->name_len, de->name,
2759 le16_to_cpu(dx_root->dr_entries.de_num_used), 2752 le16_to_cpu(dx_root->dr_entries.de_num_used));
2760 de->name_len, de->name);
2761 2753
2762 ocfs2_dx_entry_list_insert(&dx_root->dr_entries, &hinfo, 2754 ocfs2_dx_entry_list_insert(&dx_root->dr_entries, &hinfo,
2763 dirent_blk); 2755 dirent_blk);
@@ -3310,8 +3302,8 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
3310 down_write(&OCFS2_I(dir)->ip_alloc_sem); 3302 down_write(&OCFS2_I(dir)->ip_alloc_sem);
3311 drop_alloc_sem = 1; 3303 drop_alloc_sem = 1;
3312 dir_i_size = i_size_read(dir); 3304 dir_i_size = i_size_read(dir);
3313 mlog(0, "extending dir %llu (i_size = %lld)\n", 3305 trace_ocfs2_extend_dir((unsigned long long)OCFS2_I(dir)->ip_blkno,
3314 (unsigned long long)OCFS2_I(dir)->ip_blkno, dir_i_size); 3306 dir_i_size);
3315 3307
3316 /* dir->i_size is always block aligned. */ 3308 /* dir->i_size is always block aligned. */
3317 spin_lock(&OCFS2_I(dir)->ip_lock); 3309 spin_lock(&OCFS2_I(dir)->ip_lock);
@@ -3805,9 +3797,9 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir,
3805 struct ocfs2_dx_root_block *dx_root; 3797 struct ocfs2_dx_root_block *dx_root;
3806 struct ocfs2_dx_leaf *tmp_dx_leaf = NULL; 3798 struct ocfs2_dx_leaf *tmp_dx_leaf = NULL;
3807 3799
3808 mlog(0, "DX Dir: %llu, rebalance leaf leaf_blkno: %llu insert: %u\n", 3800 trace_ocfs2_dx_dir_rebalance((unsigned long long)OCFS2_I(dir)->ip_blkno,
3809 (unsigned long long)OCFS2_I(dir)->ip_blkno, 3801 (unsigned long long)leaf_blkno,
3810 (unsigned long long)leaf_blkno, insert_hash); 3802 insert_hash);
3811 3803
3812 ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh); 3804 ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh);
3813 3805
@@ -3887,8 +3879,7 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir,
3887 goto out_commit; 3879 goto out_commit;
3888 } 3880 }
3889 3881
3890 mlog(0, "Split leaf (%u) at %u, insert major hash is %u\n", 3882 trace_ocfs2_dx_dir_rebalance_split(leaf_cpos, split_hash, insert_hash);
3891 leaf_cpos, split_hash, insert_hash);
3892 3883
3893 /* 3884 /*
3894 * We have to carefully order operations here. There are items 3885 * We have to carefully order operations here. There are items
@@ -4345,8 +4336,8 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb,
4345 unsigned int blocks_wanted = 1; 4336 unsigned int blocks_wanted = 1;
4346 struct buffer_head *bh = NULL; 4337 struct buffer_head *bh = NULL;
4347 4338
4348 mlog(0, "getting ready to insert namelen %d into dir %llu\n", 4339 trace_ocfs2_prepare_dir_for_insert(
4349 namelen, (unsigned long long)OCFS2_I(dir)->ip_blkno); 4340 (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen);
4350 4341
4351 if (!namelen) { 4342 if (!namelen) {
4352 ret = -EINVAL; 4343 ret = -EINVAL;
diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2/ocfs2_trace.h
index 0f7165914401..25e057e9d14d 100644
--- a/fs/ocfs2/ocfs2_trace.h
+++ b/fs/ocfs2/ocfs2_trace.h
@@ -2013,6 +2013,122 @@ DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_acquire_dquot);
2013DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_mark_dquot_dirty); 2013DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_mark_dquot_dirty);
2014 2014
2015/* End of trace events for fs/ocfs2/quota_global.c. */ 2015/* End of trace events for fs/ocfs2/quota_global.c. */
2016
2017/* Trace events for fs/ocfs2/dir.c. */
2018DEFINE_OCFS2_INT_EVENT(ocfs2_search_dirblock);
2019
2020DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_dir_block);
2021
2022DEFINE_OCFS2_POINTER_EVENT(ocfs2_find_entry_el);
2023
2024TRACE_EVENT(ocfs2_dx_dir_search,
2025 TP_PROTO(unsigned long long ino, int namelen, const char *name,
2026 unsigned int major_hash, unsigned int minor_hash,
2027 unsigned long long blkno),
2028 TP_ARGS(ino, namelen, name, major_hash, minor_hash, blkno),
2029 TP_STRUCT__entry(
2030 __field(unsigned long long, ino)
2031 __field(int, namelen)
2032 __string(name, name)
2033 __field(unsigned int, major_hash)
2034 __field(unsigned int,minor_hash)
2035 __field(unsigned long long, blkno)
2036 ),
2037 TP_fast_assign(
2038 __entry->ino = ino;
2039 __entry->namelen = namelen;
2040 __assign_str(name, name);
2041 __entry->major_hash = major_hash;
2042 __entry->minor_hash = minor_hash;
2043 __entry->blkno = blkno;
2044 ),
2045 TP_printk("%llu %.*s %u %u %llu", __entry->ino,
2046 __entry->namelen, __get_str(name),
2047 __entry->major_hash, __entry->minor_hash, __entry->blkno)
2048);
2049
2050DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_dx_dir_search_leaf_info);
2051
2052DEFINE_OCFS2_ULL_INT_EVENT(ocfs2_delete_entry_dx);
2053
2054DEFINE_OCFS2_ULL_EVENT(ocfs2_readdir);
2055
2056TRACE_EVENT(ocfs2_find_files_on_disk,
2057 TP_PROTO(int namelen, const char *name, void *blkno,
2058 unsigned long long dir),
2059 TP_ARGS(namelen, name, blkno, dir),
2060 TP_STRUCT__entry(
2061 __field(int, namelen)
2062 __string(name, name)
2063 __field(void *, blkno)
2064 __field(unsigned long long, dir)
2065 ),
2066 TP_fast_assign(
2067 __entry->namelen = namelen;
2068 __assign_str(name, name);
2069 __entry->blkno = blkno;
2070 __entry->dir = dir;
2071 ),
2072 TP_printk("%.*s %p %llu", __entry->namelen, __get_str(name),
2073 __entry->blkno, __entry->dir)
2074);
2075
2076TRACE_EVENT(ocfs2_check_dir_for_entry,
2077 TP_PROTO(unsigned long long dir, int namelen, const char *name),
2078 TP_ARGS(dir, namelen, name),
2079 TP_STRUCT__entry(
2080 __field(unsigned long long, dir)
2081 __field(int, namelen)
2082 __string(name, name)
2083 ),
2084 TP_fast_assign(
2085 __entry->dir = dir;
2086 __entry->namelen = namelen;
2087 __assign_str(name, name);
2088 ),
2089 TP_printk("%llu %.*s", __entry->dir,
2090 __entry->namelen, __get_str(name))
2091);
2092
2093DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_dx_dir_attach_index);
2094
2095DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_dx_dir_format_cluster);
2096
2097TRACE_EVENT(ocfs2_dx_dir_index_root_block,
2098 TP_PROTO(unsigned long long dir,
2099 unsigned int major_hash, unsigned int minor_hash,
2100 int namelen, const char *name, unsigned int num_used),
2101 TP_ARGS(dir, major_hash, minor_hash, namelen, name, num_used),
2102 TP_STRUCT__entry(
2103 __field(unsigned long long, dir)
2104 __field(unsigned int, major_hash)
2105 __field(unsigned int, minor_hash)
2106 __field(int, namelen)
2107 __string(name, name)
2108 __field(unsigned int, num_used)
2109 ),
2110 TP_fast_assign(
2111 __entry->dir = dir;
2112 __entry->major_hash = major_hash;
2113 __entry->minor_hash = minor_hash;
2114 __entry->namelen = namelen;
2115 __assign_str(name, name);
2116 __entry->num_used = num_used;
2117 ),
2118 TP_printk("%llu %x %x %.*s %u", __entry->dir,
2119 __entry->major_hash, __entry->minor_hash,
2120 __entry->namelen, __get_str(name), __entry->num_used)
2121);
2122
2123DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_extend_dir);
2124
2125DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_dx_dir_rebalance);
2126
2127DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_dx_dir_rebalance_split);
2128
2129DEFINE_OCFS2_ULL_INT_EVENT(ocfs2_prepare_dir_for_insert);
2130
2131/* End of trace events for fs/ocfs2/dir.c. */
2016#endif /* _TRACE_OCFS2_H */ 2132#endif /* _TRACE_OCFS2_H */
2017 2133
2018/* This part must be outside protection */ 2134/* This part must be outside protection */