Commit 781f200c authored by Tao Ma's avatar Tao Ma

ocfs2: Remove masklog ML_EXPORT.

Remove mlog(0) from fs/ocfs2/export.c and the masklog EXPORT.
Signed-off-by: default avatarTao Ma <boyu.mt@taobao.com>
parent a5b8443b
...@@ -99,7 +99,6 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = { ...@@ -99,7 +99,6 @@ static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
define_mask(VOTE), define_mask(VOTE),
define_mask(CONN), define_mask(CONN),
define_mask(QUORUM), define_mask(QUORUM),
define_mask(EXPORT),
define_mask(BASTS), define_mask(BASTS),
define_mask(CLUSTER), define_mask(CLUSTER),
define_mask(ERROR), define_mask(ERROR),
......
...@@ -101,7 +101,6 @@ ...@@ -101,7 +101,6 @@
#define ML_VOTE 0x0000000001000000ULL /* ocfs2 node messaging */ #define ML_VOTE 0x0000000001000000ULL /* ocfs2 node messaging */
#define ML_CONN 0x0000000004000000ULL /* net connection management */ #define ML_CONN 0x0000000004000000ULL /* net connection management */
#define ML_QUORUM 0x0000000008000000ULL /* net connection quorum */ #define ML_QUORUM 0x0000000008000000ULL /* net connection quorum */
#define ML_EXPORT 0x0000000010000000ULL /* ocfs2 export operations */
#define ML_BASTS 0x0000000100000000ULL /* dlmglue asts and basts */ #define ML_BASTS 0x0000000100000000ULL /* dlmglue asts and basts */
#define ML_CLUSTER 0x0000000400000000ULL /* cluster stack */ #define ML_CLUSTER 0x0000000400000000ULL /* cluster stack */
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/types.h> #include <linux/types.h>
#define MLOG_MASK_PREFIX ML_EXPORT
#include <cluster/masklog.h> #include <cluster/masklog.h>
#include "ocfs2.h" #include "ocfs2.h"
...@@ -40,6 +39,7 @@ ...@@ -40,6 +39,7 @@
#include "buffer_head_io.h" #include "buffer_head_io.h"
#include "suballoc.h" #include "suballoc.h"
#include "ocfs2_trace.h"
struct ocfs2_inode_handle struct ocfs2_inode_handle
{ {
...@@ -56,10 +56,9 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -56,10 +56,9 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
int status, set; int status, set;
struct dentry *result; struct dentry *result;
mlog(0, "(0x%p, 0x%p)\n", sb, handle); trace_ocfs2_get_dentry_begin(sb, handle, (unsigned long long)blkno);
if (blkno == 0) { if (blkno == 0) {
mlog(0, "nfs wants inode with blkno: 0\n");
result = ERR_PTR(-ESTALE); result = ERR_PTR(-ESTALE);
goto bail; goto bail;
} }
...@@ -83,6 +82,7 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -83,6 +82,7 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
} }
status = ocfs2_test_inode_bit(osb, blkno, &set); status = ocfs2_test_inode_bit(osb, blkno, &set);
trace_ocfs2_get_dentry_test_bit(status, set);
if (status < 0) { if (status < 0) {
if (status == -EINVAL) { if (status == -EINVAL) {
/* /*
...@@ -90,18 +90,14 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -90,18 +90,14 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
* as an inode, we return -ESTALE to be * as an inode, we return -ESTALE to be
* nice * nice
*/ */
mlog(0, "test inode bit failed %d\n", status);
status = -ESTALE; status = -ESTALE;
} else { } else
mlog(ML_ERROR, "test inode bit failed %d\n", status); mlog(ML_ERROR, "test inode bit failed %d\n", status);
}
goto unlock_nfs_sync; goto unlock_nfs_sync;
} }
/* If the inode allocator bit is clear, this inode must be stale */ /* If the inode allocator bit is clear, this inode must be stale */
if (!set) { if (!set) {
mlog(0, "inode %llu suballoc bit is clear\n",
(unsigned long long)blkno);
status = -ESTALE; status = -ESTALE;
goto unlock_nfs_sync; goto unlock_nfs_sync;
} }
...@@ -114,8 +110,8 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -114,8 +110,8 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
check_err: check_err:
if (status < 0) { if (status < 0) {
if (status == -ESTALE) { if (status == -ESTALE) {
mlog(0, "stale inode ino: %llu generation: %u\n", trace_ocfs2_get_dentry_stale((unsigned long long)blkno,
(unsigned long long)blkno, handle->ih_generation); handle->ih_generation);
} }
result = ERR_PTR(status); result = ERR_PTR(status);
goto bail; goto bail;
...@@ -130,8 +126,9 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -130,8 +126,9 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
check_gen: check_gen:
if (handle->ih_generation != inode->i_generation) { if (handle->ih_generation != inode->i_generation) {
iput(inode); iput(inode);
mlog(0, "stale inode ino: %llu generation: %u\n", trace_ocfs2_get_dentry_generation((unsigned long long)blkno,
(unsigned long long)blkno, handle->ih_generation); handle->ih_generation,
inode->i_generation);
result = ERR_PTR(-ESTALE); result = ERR_PTR(-ESTALE);
goto bail; goto bail;
} }
...@@ -141,7 +138,7 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, ...@@ -141,7 +138,7 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb,
mlog_errno(PTR_ERR(result)); mlog_errno(PTR_ERR(result));
bail: bail:
mlog(0, "result = %p\n", result); trace_ocfs2_get_dentry_end(result);
return result; return result;
} }
...@@ -152,11 +149,8 @@ static struct dentry *ocfs2_get_parent(struct dentry *child) ...@@ -152,11 +149,8 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
struct dentry *parent; struct dentry *parent;
struct inode *dir = child->d_inode; struct inode *dir = child->d_inode;
mlog(0, "(0x%p, '%.*s')\n", child, trace_ocfs2_get_parent(child, child->d_name.len, child->d_name.name,
child->d_name.len, child->d_name.name); (unsigned long long)OCFS2_I(dir)->ip_blkno);
mlog(0, "find parent of directory %llu\n",
(unsigned long long)OCFS2_I(dir)->ip_blkno);
status = ocfs2_inode_lock(dir, NULL, 0); status = ocfs2_inode_lock(dir, NULL, 0);
if (status < 0) { if (status < 0) {
...@@ -178,7 +172,7 @@ static struct dentry *ocfs2_get_parent(struct dentry *child) ...@@ -178,7 +172,7 @@ static struct dentry *ocfs2_get_parent(struct dentry *child)
ocfs2_inode_unlock(dir, 0); ocfs2_inode_unlock(dir, 0);
bail: bail:
mlog(0, "parent %p\n", parent); trace_ocfs2_get_parent_end(parent);
return parent; return parent;
} }
...@@ -193,9 +187,9 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len, ...@@ -193,9 +187,9 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
u32 generation; u32 generation;
__le32 *fh = (__force __le32 *) fh_in; __le32 *fh = (__force __le32 *) fh_in;
mlog(0, "(0x%p, '%.*s', 0x%p, %d, %d)\n", dentry, trace_ocfs2_encode_fh_begin(dentry, dentry->d_name.len,
dentry->d_name.len, dentry->d_name.name, dentry->d_name.name,
fh, len, connectable); fh, len, connectable);
if (connectable && (len < 6)) { if (connectable && (len < 6)) {
*max_len = 6; *max_len = 6;
...@@ -210,8 +204,7 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len, ...@@ -210,8 +204,7 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
blkno = OCFS2_I(inode)->ip_blkno; blkno = OCFS2_I(inode)->ip_blkno;
generation = inode->i_generation; generation = inode->i_generation;
mlog(0, "Encoding fh: blkno: %llu, generation: %u\n", trace_ocfs2_encode_fh_self((unsigned long long)blkno, generation);
(unsigned long long)blkno, generation);
len = 3; len = 3;
fh[0] = cpu_to_le32((u32)(blkno >> 32)); fh[0] = cpu_to_le32((u32)(blkno >> 32));
...@@ -236,14 +229,14 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len, ...@@ -236,14 +229,14 @@ static int ocfs2_encode_fh(struct dentry *dentry, u32 *fh_in, int *max_len,
len = 6; len = 6;
type = 2; type = 2;
mlog(0, "Encoding parent: blkno: %llu, generation: %u\n", trace_ocfs2_encode_fh_parent((unsigned long long)blkno,
(unsigned long long)blkno, generation); generation);
} }
*max_len = len; *max_len = len;
bail: bail:
mlog(0, "type = %d\n", type); trace_ocfs2_encode_fh_type(type);
return type; return type;
} }
......
...@@ -2461,8 +2461,88 @@ TRACE_EVENT(ocfs2_dentry_attach_lock_found, ...@@ -2461,8 +2461,88 @@ TRACE_EVENT(ocfs2_dentry_attach_lock_found,
), ),
TP_printk("%s %llu %llu", __get_str(name), __entry->parent, __entry->ino) TP_printk("%s %llu %llu", __get_str(name), __entry->parent, __entry->ino)
); );
/* End of trace events for fs/ocfs2/dcache.c. */ /* End of trace events for fs/ocfs2/dcache.c. */
/* Trace events for fs/ocfs2/export.c. */
TRACE_EVENT(ocfs2_get_dentry_begin,
TP_PROTO(void *sb, void *handle, unsigned long long blkno),
TP_ARGS(sb, handle, blkno),
TP_STRUCT__entry(
__field(void *, sb)
__field(void *, handle)
__field(unsigned long long, blkno)
),
TP_fast_assign(
__entry->sb = sb;
__entry->handle = handle;
__entry->blkno = blkno;
),
TP_printk("%p %p %llu", __entry->sb, __entry->handle, __entry->blkno)
);
DEFINE_OCFS2_INT_INT_EVENT(ocfs2_get_dentry_test_bit);
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_get_dentry_stale);
DEFINE_OCFS2_ULL_UINT_UINT_EVENT(ocfs2_get_dentry_generation);
DEFINE_OCFS2_POINTER_EVENT(ocfs2_get_dentry_end);
TRACE_EVENT(ocfs2_get_parent,
TP_PROTO(void *child, int len, const char *name,
unsigned long long ino),
TP_ARGS(child, len, name, ino),
TP_STRUCT__entry(
__field(void *, child)
__field(int, len)
__string(name, name)
__field(unsigned long long, ino)
),
TP_fast_assign(
__entry->child = child;
__entry->len = len;
__assign_str(name, name);
__entry->ino = ino;
),
TP_printk("%p %.*s %llu", __entry->child, __entry->len,
__get_str(name), __entry->ino)
);
DEFINE_OCFS2_POINTER_EVENT(ocfs2_get_parent_end);
TRACE_EVENT(ocfs2_encode_fh_begin,
TP_PROTO(void *dentry, int name_len, const char *name,
void *fh, int len, int connectable),
TP_ARGS(dentry, name_len, name, fh, len, connectable),
TP_STRUCT__entry(
__field(void *, dentry)
__field(int, name_len)
__string(name, name)
__field(void *, fh)
__field(int, len)
__field(int, connectable)
),
TP_fast_assign(
__entry->dentry = dentry;
__entry->name_len = name_len;
__assign_str(name, name);
__entry->fh = fh;
__entry->len = len;
__entry->connectable = connectable;
),
TP_printk("%p %.*s %p %d %d", __entry->dentry, __entry->name_len,
__get_str(name), __entry->fh, __entry->len,
__entry->connectable)
);
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_encode_fh_self);
DEFINE_OCFS2_ULL_UINT_EVENT(ocfs2_encode_fh_parent);
DEFINE_OCFS2_INT_EVENT(ocfs2_encode_fh_type);
/* End of trace events for fs/ocfs2/export.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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment