Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
70ded201
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
70ded201
编写于
8月 21, 2013
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS: Add tracepoints for debugging NFS rename and sillyrename issues
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
1ca42382
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
146 addition
and
0 deletion
+146
-0
fs/nfs/dir.c
fs/nfs/dir.c
+3
-0
fs/nfs/nfstrace.h
fs/nfs/nfstrace.h
+138
-0
fs/nfs/unlink.c
fs/nfs/unlink.c
+5
-0
未找到文件。
fs/nfs/dir.c
浏览文件 @
70ded201
...
...
@@ -1909,6 +1909,7 @@ int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
new_dentry
->
d_parent
->
d_name
.
name
,
new_dentry
->
d_name
.
name
,
d_count
(
new_dentry
));
trace_nfs_rename_enter
(
old_dir
,
old_dentry
,
new_dir
,
new_dentry
);
/*
* For non-directories, check whether the target is busy and if so,
* make a copy of the dentry and then do a silly-rename. If the
...
...
@@ -1955,6 +1956,8 @@ int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
out:
if
(
rehash
)
d_rehash
(
rehash
);
trace_nfs_rename_exit
(
old_dir
,
old_dentry
,
new_dir
,
new_dentry
,
error
);
if
(
!
error
)
{
if
(
new_inode
!=
NULL
)
nfs_drop_nlink
(
new_inode
);
...
...
fs/nfs/nfstrace.h
浏览文件 @
70ded201
...
...
@@ -512,6 +512,144 @@ DEFINE_NFS_DIRECTORY_EVENT_DONE(nfs_unlink_exit);
DEFINE_NFS_DIRECTORY_EVENT
(
nfs_symlink_enter
);
DEFINE_NFS_DIRECTORY_EVENT_DONE
(
nfs_symlink_exit
);
DECLARE_EVENT_CLASS
(
nfs_rename_event
,
TP_PROTO
(
const
struct
inode
*
old_dir
,
const
struct
dentry
*
old_dentry
,
const
struct
inode
*
new_dir
,
const
struct
dentry
*
new_dentry
),
TP_ARGS
(
old_dir
,
old_dentry
,
new_dir
,
new_dentry
),
TP_STRUCT__entry
(
__field
(
dev_t
,
dev
)
__field
(
u64
,
old_dir
)
__field
(
u64
,
new_dir
)
__string
(
old_name
,
old_dentry
->
d_name
.
name
)
__string
(
new_name
,
new_dentry
->
d_name
.
name
)
),
TP_fast_assign
(
__entry
->
dev
=
old_dir
->
i_sb
->
s_dev
;
__entry
->
old_dir
=
NFS_FILEID
(
old_dir
);
__entry
->
new_dir
=
NFS_FILEID
(
new_dir
);
__assign_str
(
old_name
,
old_dentry
->
d_name
.
name
);
__assign_str
(
new_name
,
new_dentry
->
d_name
.
name
);
),
TP_printk
(
"old_name=%02x:%02x:%llu/%s new_name=%02x:%02x:%llu/%s"
,
MAJOR
(
__entry
->
dev
),
MINOR
(
__entry
->
dev
),
(
unsigned
long
long
)
__entry
->
old_dir
,
__get_str
(
old_name
),
MAJOR
(
__entry
->
dev
),
MINOR
(
__entry
->
dev
),
(
unsigned
long
long
)
__entry
->
new_dir
,
__get_str
(
new_name
)
)
);
#define DEFINE_NFS_RENAME_EVENT(name) \
DEFINE_EVENT(nfs_rename_event, name, \
TP_PROTO( \
const struct inode *old_dir, \
const struct dentry *old_dentry, \
const struct inode *new_dir, \
const struct dentry *new_dentry \
), \
TP_ARGS(old_dir, old_dentry, new_dir, new_dentry))
DECLARE_EVENT_CLASS
(
nfs_rename_event_done
,
TP_PROTO
(
const
struct
inode
*
old_dir
,
const
struct
dentry
*
old_dentry
,
const
struct
inode
*
new_dir
,
const
struct
dentry
*
new_dentry
,
int
error
),
TP_ARGS
(
old_dir
,
old_dentry
,
new_dir
,
new_dentry
,
error
),
TP_STRUCT__entry
(
__field
(
dev_t
,
dev
)
__field
(
int
,
error
)
__field
(
u64
,
old_dir
)
__string
(
old_name
,
old_dentry
->
d_name
.
name
)
__field
(
u64
,
new_dir
)
__string
(
new_name
,
new_dentry
->
d_name
.
name
)
),
TP_fast_assign
(
__entry
->
dev
=
old_dir
->
i_sb
->
s_dev
;
__entry
->
old_dir
=
NFS_FILEID
(
old_dir
);
__entry
->
new_dir
=
NFS_FILEID
(
new_dir
);
__entry
->
error
=
error
;
__assign_str
(
old_name
,
old_dentry
->
d_name
.
name
);
__assign_str
(
new_name
,
new_dentry
->
d_name
.
name
);
),
TP_printk
(
"error=%d old_name=%02x:%02x:%llu/%s "
"new_name=%02x:%02x:%llu/%s"
,
__entry
->
error
,
MAJOR
(
__entry
->
dev
),
MINOR
(
__entry
->
dev
),
(
unsigned
long
long
)
__entry
->
old_dir
,
__get_str
(
old_name
),
MAJOR
(
__entry
->
dev
),
MINOR
(
__entry
->
dev
),
(
unsigned
long
long
)
__entry
->
new_dir
,
__get_str
(
new_name
)
)
);
#define DEFINE_NFS_RENAME_EVENT_DONE(name) \
DEFINE_EVENT(nfs_rename_event_done, name, \
TP_PROTO( \
const struct inode *old_dir, \
const struct dentry *old_dentry, \
const struct inode *new_dir, \
const struct dentry *new_dentry, \
int error \
), \
TP_ARGS(old_dir, old_dentry, new_dir, \
new_dentry, error))
DEFINE_NFS_RENAME_EVENT
(
nfs_rename_enter
);
DEFINE_NFS_RENAME_EVENT_DONE
(
nfs_rename_exit
);
DEFINE_NFS_RENAME_EVENT_DONE
(
nfs_sillyrename_rename
);
TRACE_EVENT
(
nfs_sillyrename_unlink
,
TP_PROTO
(
const
struct
nfs_unlinkdata
*
data
,
int
error
),
TP_ARGS
(
data
,
error
),
TP_STRUCT__entry
(
__field
(
dev_t
,
dev
)
__field
(
int
,
error
)
__field
(
u64
,
dir
)
__dynamic_array
(
char
,
name
,
data
->
args
.
name
.
len
+
1
)
),
TP_fast_assign
(
struct
inode
*
dir
=
data
->
dir
;
size_t
len
=
data
->
args
.
name
.
len
;
__entry
->
dev
=
dir
->
i_sb
->
s_dev
;
__entry
->
dir
=
NFS_FILEID
(
dir
);
__entry
->
error
=
error
;
memcpy
(
__get_dynamic_array
(
name
),
data
->
args
.
name
.
name
,
len
);
((
char
*
)
__get_dynamic_array
(
name
))[
len
]
=
0
;
),
TP_printk
(
"error=%d name=%02x:%02x:%llu/%s"
,
__entry
->
error
,
MAJOR
(
__entry
->
dev
),
MINOR
(
__entry
->
dev
),
(
unsigned
long
long
)
__entry
->
dir
,
__get_str
(
name
)
)
);
#endif
/* _TRACE_NFS_H */
#undef TRACE_INCLUDE_PATH
...
...
fs/nfs/unlink.c
浏览文件 @
70ded201
...
...
@@ -20,6 +20,8 @@
#include "iostat.h"
#include "delegation.h"
#include "nfstrace.h"
/**
* nfs_free_unlinkdata - release data from a sillydelete operation.
* @data: pointer to unlink structure.
...
...
@@ -77,6 +79,7 @@ static void nfs_async_unlink_done(struct rpc_task *task, void *calldata)
struct
nfs_unlinkdata
*
data
=
calldata
;
struct
inode
*
dir
=
data
->
dir
;
trace_nfs_sillyrename_unlink
(
data
,
task
->
tk_status
);
if
(
!
NFS_PROTO
(
dir
)
->
unlink_done
(
task
,
dir
))
rpc_restart_call_prepare
(
task
);
}
...
...
@@ -336,6 +339,8 @@ static void nfs_async_rename_done(struct rpc_task *task, void *calldata)
struct
inode
*
new_dir
=
data
->
new_dir
;
struct
dentry
*
old_dentry
=
data
->
old_dentry
;
trace_nfs_sillyrename_rename
(
old_dir
,
old_dentry
,
new_dir
,
data
->
new_dentry
,
task
->
tk_status
);
if
(
!
NFS_PROTO
(
old_dir
)
->
rename_done
(
task
,
old_dir
,
new_dir
))
{
rpc_restart_call_prepare
(
task
);
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录