提交 f1088d47 编写于 作者: T Tao Ma

ocfs2: Remove mlog(0) from fs/ocfs2/dir.c

This is the 2nd step to remove the debug info of NAMEI.
Signed-off-by: NTao Ma <boyu.mt@taobao.com>
上级 f32037d9
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include <linux/quotaops.h> #include <linux/quotaops.h>
#include <linux/sort.h> #include <linux/sort.h>
#define MLOG_MASK_PREFIX ML_NAMEI
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -61,6 +60,7 @@ ...@@ -61,6 +60,7 @@
#include "super.h" #include "super.h"
#include "sysfile.h" #include "sysfile.h"
#include "uptodate.h" #include "uptodate.h"
#include "ocfs2_trace.h"
#include "buffer_head_io.h" #include "buffer_head_io.h"
...@@ -400,7 +400,7 @@ static int inline ocfs2_search_dirblock(struct buffer_head *bh, ...@@ -400,7 +400,7 @@ static int inline ocfs2_search_dirblock(struct buffer_head *bh,
} }
bail: bail:
mlog(0, "ret = %d\n", ret); trace_ocfs2_search_dirblock(ret);
return ret; return ret;
} }
...@@ -445,8 +445,7 @@ static int ocfs2_validate_dir_block(struct super_block *sb, ...@@ -445,8 +445,7 @@ static int ocfs2_validate_dir_block(struct super_block *sb,
* We don't validate dirents here, that's handled * We don't validate dirents here, that's handled
* in-place when the code walks them. * in-place when the code walks them.
*/ */
mlog(0, "Validating dirblock %llu\n", trace_ocfs2_validate_dir_block((unsigned long long)bh->b_blocknr);
(unsigned long long)bh->b_blocknr);
BUG_ON(!buffer_uptodate(bh)); BUG_ON(!buffer_uptodate(bh));
...@@ -784,7 +783,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, ...@@ -784,7 +783,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen,
for (; ra_ptr < ra_max; ra_ptr++) for (; ra_ptr < ra_max; ra_ptr++)
brelse(bh_use[ra_ptr]); brelse(bh_use[ra_ptr]);
mlog(0, "ret = %p\n", ret); trace_ocfs2_find_entry_el(ret);
return ret; return ret;
} }
...@@ -946,11 +945,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen, ...@@ -946,11 +945,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen,
goto out; goto out;
} }
mlog(0, "Dir %llu: name: \"%.*s\", lookup of hash: %u.0x%x " trace_ocfs2_dx_dir_search((unsigned long long)OCFS2_I(dir)->ip_blkno,
"returns: %llu\n", namelen, name, hinfo->major_hash,
(unsigned long long)OCFS2_I(dir)->ip_blkno, hinfo->minor_hash, (unsigned long long)phys);
namelen, name, hinfo->major_hash, hinfo->minor_hash,
(unsigned long long)phys);
ret = ocfs2_read_dx_leaf(dir, phys, &dx_leaf_bh); ret = ocfs2_read_dx_leaf(dir, phys, &dx_leaf_bh);
if (ret) { if (ret) {
...@@ -960,9 +957,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen, ...@@ -960,9 +957,9 @@ static int ocfs2_dx_dir_search(const char *name, int namelen,
dx_leaf = (struct ocfs2_dx_leaf *) dx_leaf_bh->b_data; dx_leaf = (struct ocfs2_dx_leaf *) dx_leaf_bh->b_data;
mlog(0, "leaf info: num_used: %d, count: %d\n", trace_ocfs2_dx_dir_search_leaf_info(
le16_to_cpu(dx_leaf->dl_list.de_num_used), le16_to_cpu(dx_leaf->dl_list.de_num_used),
le16_to_cpu(dx_leaf->dl_list.de_count)); le16_to_cpu(dx_leaf->dl_list.de_count));
entry_list = &dx_leaf->dl_list; entry_list = &dx_leaf->dl_list;
...@@ -1162,8 +1159,6 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir, ...@@ -1162,8 +1159,6 @@ static int __ocfs2_delete_entry(handle_t *handle, struct inode *dir,
int i, status = -ENOENT; int i, status = -ENOENT;
ocfs2_journal_access_func access = ocfs2_journal_access_db; ocfs2_journal_access_func access = ocfs2_journal_access_db;
mlog(0, "(0x%p, 0x%p, 0x%p, 0x%p)\n", handle, dir, de_del, bh);
if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL) if (OCFS2_I(dir)->ip_dyn_features & OCFS2_INLINE_DATA_FL)
access = ocfs2_journal_access_di; access = ocfs2_journal_access_di;
...@@ -1343,8 +1338,8 @@ static int ocfs2_delete_entry_dx(handle_t *handle, struct inode *dir, ...@@ -1343,8 +1338,8 @@ static int ocfs2_delete_entry_dx(handle_t *handle, struct inode *dir,
} }
} }
mlog(0, "Dir %llu: delete entry at index: %d\n", trace_ocfs2_delete_entry_dx((unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)OCFS2_I(dir)->ip_blkno, index); index);
ret = __ocfs2_delete_entry(handle, dir, lookup->dl_entry, ret = __ocfs2_delete_entry(handle, dir, lookup->dl_entry,
leaf_bh, leaf_bh->b_data, leaf_bh->b_size); 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,8 +2017,7 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir)
struct inode *inode = filp->f_path.dentry->d_inode; struct inode *inode = filp->f_path.dentry->d_inode;
int lock_level = 0; int lock_level = 0;
mlog(0, "dirino=%llu\n", trace_ocfs2_readdir((unsigned long long)OCFS2_I(inode)->ip_blkno);
(unsigned long long)OCFS2_I(inode)->ip_blkno);
error = ocfs2_inode_lock_atime(inode, filp->f_vfsmnt, &lock_level); error = ocfs2_inode_lock_atime(inode, filp->f_vfsmnt, &lock_level);
if (lock_level && error >= 0) { if (lock_level && error >= 0) {
...@@ -2064,8 +2058,8 @@ int ocfs2_find_files_on_disk(const char *name, ...@@ -2064,8 +2058,8 @@ int ocfs2_find_files_on_disk(const char *name,
{ {
int status = -ENOENT; int status = -ENOENT;
mlog(0, "name=%.*s, blkno=%p, inode=%llu\n", namelen, name, blkno, trace_ocfs2_find_files_on_disk(namelen, name, blkno,
(unsigned long long)OCFS2_I(inode)->ip_blkno); (unsigned long long)OCFS2_I(inode)->ip_blkno);
status = ocfs2_find_entry(name, namelen, inode, lookup); status = ocfs2_find_entry(name, namelen, inode, lookup);
if (status) if (status)
...@@ -2109,8 +2103,8 @@ int ocfs2_check_dir_for_entry(struct inode *dir, ...@@ -2109,8 +2103,8 @@ int ocfs2_check_dir_for_entry(struct inode *dir,
int ret; int ret;
struct ocfs2_dir_lookup_result lookup = { NULL, }; struct ocfs2_dir_lookup_result lookup = { NULL, };
mlog(0, "dir %llu, name '%.*s'\n", trace_ocfs2_check_dir_for_entry(
(unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name); (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen, name);
ret = -EEXIST; ret = -EEXIST;
if (ocfs2_find_entry(name, namelen, dir, &lookup) == 0) 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,9 +2396,9 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb,
goto out; goto out;
} }
mlog(0, "Dir %llu, attach new index block: %llu\n", trace_ocfs2_dx_dir_attach_index(
(unsigned long long)OCFS2_I(dir)->ip_blkno, (unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)dr_blkno); (unsigned long long)dr_blkno);
dx_root_bh = sb_getblk(osb->sb, dr_blkno); dx_root_bh = sb_getblk(osb->sb, dr_blkno);
if (dx_root_bh == NULL) { if (dx_root_bh == NULL) {
...@@ -2504,11 +2498,10 @@ static int ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb, ...@@ -2504,11 +2498,10 @@ static int ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb,
dx_leaf->dl_list.de_count = dx_leaf->dl_list.de_count =
cpu_to_le16(ocfs2_dx_entries_per_leaf(osb->sb)); cpu_to_le16(ocfs2_dx_entries_per_leaf(osb->sb));
mlog(0, trace_ocfs2_dx_dir_format_cluster(
"Dir %llu, format dx_leaf: %llu, entry count: %u\n", (unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)OCFS2_I(dir)->ip_blkno, (unsigned long long)bh->b_blocknr,
(unsigned long long)bh->b_blocknr, le16_to_cpu(dx_leaf->dl_list.de_count));
le16_to_cpu(dx_leaf->dl_list.de_count));
ocfs2_journal_dirty(handle, bh); ocfs2_journal_dirty(handle, bh);
} }
...@@ -2752,12 +2745,11 @@ static void ocfs2_dx_dir_index_root_block(struct inode *dir, ...@@ -2752,12 +2745,11 @@ static void ocfs2_dx_dir_index_root_block(struct inode *dir,
ocfs2_dx_dir_name_hash(dir, de->name, de->name_len, &hinfo); ocfs2_dx_dir_name_hash(dir, de->name, de->name_len, &hinfo);
mlog(0, trace_ocfs2_dx_dir_index_root_block(
"dir: %llu, major: 0x%x minor: 0x%x, index: %u, name: %.*s\n", (unsigned long long)dir->i_ino,
(unsigned long long)dir->i_ino, hinfo.major_hash, hinfo.major_hash, hinfo.minor_hash,
hinfo.minor_hash, de->name_len, de->name,
le16_to_cpu(dx_root->dr_entries.de_num_used), le16_to_cpu(dx_root->dr_entries.de_num_used));
de->name_len, de->name);
ocfs2_dx_entry_list_insert(&dx_root->dr_entries, &hinfo, ocfs2_dx_entry_list_insert(&dx_root->dr_entries, &hinfo,
dirent_blk); dirent_blk);
...@@ -3310,8 +3302,8 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb, ...@@ -3310,8 +3302,8 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
down_write(&OCFS2_I(dir)->ip_alloc_sem); down_write(&OCFS2_I(dir)->ip_alloc_sem);
drop_alloc_sem = 1; drop_alloc_sem = 1;
dir_i_size = i_size_read(dir); dir_i_size = i_size_read(dir);
mlog(0, "extending dir %llu (i_size = %lld)\n", trace_ocfs2_extend_dir((unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)OCFS2_I(dir)->ip_blkno, dir_i_size); dir_i_size);
/* dir->i_size is always block aligned. */ /* dir->i_size is always block aligned. */
spin_lock(&OCFS2_I(dir)->ip_lock); 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,9 +3797,9 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir,
struct ocfs2_dx_root_block *dx_root; struct ocfs2_dx_root_block *dx_root;
struct ocfs2_dx_leaf *tmp_dx_leaf = NULL; struct ocfs2_dx_leaf *tmp_dx_leaf = NULL;
mlog(0, "DX Dir: %llu, rebalance leaf leaf_blkno: %llu insert: %u\n", trace_ocfs2_dx_dir_rebalance((unsigned long long)OCFS2_I(dir)->ip_blkno,
(unsigned long long)OCFS2_I(dir)->ip_blkno, (unsigned long long)leaf_blkno,
(unsigned long long)leaf_blkno, insert_hash); insert_hash);
ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh); ocfs2_init_dx_root_extent_tree(&et, INODE_CACHE(dir), dx_root_bh);
...@@ -3887,8 +3879,7 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir, ...@@ -3887,8 +3879,7 @@ static int ocfs2_dx_dir_rebalance(struct ocfs2_super *osb, struct inode *dir,
goto out_commit; goto out_commit;
} }
mlog(0, "Split leaf (%u) at %u, insert major hash is %u\n", trace_ocfs2_dx_dir_rebalance_split(leaf_cpos, split_hash, insert_hash);
leaf_cpos, split_hash, insert_hash);
/* /*
* We have to carefully order operations here. There are items * 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,8 +4336,8 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb,
unsigned int blocks_wanted = 1; unsigned int blocks_wanted = 1;
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
mlog(0, "getting ready to insert namelen %d into dir %llu\n", trace_ocfs2_prepare_dir_for_insert(
namelen, (unsigned long long)OCFS2_I(dir)->ip_blkno); (unsigned long long)OCFS2_I(dir)->ip_blkno, namelen);
if (!namelen) { if (!namelen) {
ret = -EINVAL; ret = -EINVAL;
......
...@@ -2013,6 +2013,122 @@ DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_acquire_dquot); ...@@ -2013,6 +2013,122 @@ DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_acquire_dquot);
DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_mark_dquot_dirty); DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_mark_dquot_dirty);
/* End of trace events for fs/ocfs2/quota_global.c. */ /* End of trace events for fs/ocfs2/quota_global.c. */
/* Trace events for fs/ocfs2/dir.c. */
DEFINE_OCFS2_INT_EVENT(ocfs2_search_dirblock);
DEFINE_OCFS2_ULL_EVENT(ocfs2_validate_dir_block);
DEFINE_OCFS2_POINTER_EVENT(ocfs2_find_entry_el);
TRACE_EVENT(ocfs2_dx_dir_search,
TP_PROTO(unsigned long long ino, int namelen, const char *name,
unsigned int major_hash, unsigned int minor_hash,
unsigned long long blkno),
TP_ARGS(ino, namelen, name, major_hash, minor_hash, blkno),
TP_STRUCT__entry(
__field(unsigned long long, ino)
__field(int, namelen)
__string(name, name)
__field(unsigned int, major_hash)
__field(unsigned int,minor_hash)
__field(unsigned long long, blkno)
),
TP_fast_assign(
__entry->ino = ino;
__entry->namelen = namelen;
__assign_str(name, name);
__entry->major_hash = major_hash;
__entry->minor_hash = minor_hash;
__entry->blkno = blkno;
),
TP_printk("%llu %.*s %u %u %llu", __entry->ino,
__entry->namelen, __get_str(name),
__entry->major_hash, __entry->minor_hash, __entry->blkno)
);
DEFINE_OCFS2_UINT_UINT_EVENT(ocfs2_dx_dir_search_leaf_info);
DEFINE_OCFS2_ULL_INT_EVENT(ocfs2_delete_entry_dx);
DEFINE_OCFS2_ULL_EVENT(ocfs2_readdir);
TRACE_EVENT(ocfs2_find_files_on_disk,
TP_PROTO(int namelen, const char *name, void *blkno,
unsigned long long dir),
TP_ARGS(namelen, name, blkno, dir),
TP_STRUCT__entry(
__field(int, namelen)
__string(name, name)
__field(void *, blkno)
__field(unsigned long long, dir)
),
TP_fast_assign(
__entry->namelen = namelen;
__assign_str(name, name);
__entry->blkno = blkno;
__entry->dir = dir;
),
TP_printk("%.*s %p %llu", __entry->namelen, __get_str(name),
__entry->blkno, __entry->dir)
);
TRACE_EVENT(ocfs2_check_dir_for_entry,
TP_PROTO(unsigned long long dir, int namelen, const char *name),
TP_ARGS(dir, namelen, name),
TP_STRUCT__entry(
__field(unsigned long long, dir)
__field(int, namelen)
__string(name, name)
),
TP_fast_assign(
__entry->dir = dir;
__entry->namelen = namelen;
__assign_str(name, name);
),
TP_printk("%llu %.*s", __entry->dir,
__entry->namelen, __get_str(name))
);
DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_dx_dir_attach_index);
DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_dx_dir_format_cluster);
TRACE_EVENT(ocfs2_dx_dir_index_root_block,
TP_PROTO(unsigned long long dir,
unsigned int major_hash, unsigned int minor_hash,
int namelen, const char *name, unsigned int num_used),
TP_ARGS(dir, major_hash, minor_hash, namelen, name, num_used),
TP_STRUCT__entry(
__field(unsigned long long, dir)
__field(unsigned int, major_hash)
__field(unsigned int, minor_hash)
__field(int, namelen)
__string(name, name)
__field(unsigned int, num_used)
),
TP_fast_assign(
__entry->dir = dir;
__entry->major_hash = major_hash;
__entry->minor_hash = minor_hash;
__entry->namelen = namelen;
__assign_str(name, name);
__entry->num_used = num_used;
),
TP_printk("%llu %x %x %.*s %u", __entry->dir,
__entry->major_hash, __entry->minor_hash,
__entry->namelen, __get_str(name), __entry->num_used)
);
DEFINE_OCFS2_ULL_ULL_EVENT(ocfs2_extend_dir);
DEFINE_OCFS2_ULL_ULL_UINT_EVENT(ocfs2_dx_dir_rebalance);
DEFINE_OCFS2_UINT_UINT_UINT_EVENT(ocfs2_dx_dir_rebalance_split);
DEFINE_OCFS2_ULL_INT_EVENT(ocfs2_prepare_dir_for_insert);
/* End of trace events for fs/ocfs2/dir.c. */
#endif /* _TRACE_OCFS2_H */ #endif /* _TRACE_OCFS2_H */
/* This part must be outside protection */ /* This part must be outside protection */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册