提交 850a80cf 编写于 作者: L Lai Jiangshan 提交者: Ingo Molnar

ftrace: use seq_read

Impact: cleanup

VFS layer has tested the file mode, we do not need test it.
Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <srostedt@redhat.com>
LKML-Reference: <49BA2BAB.6010608@cn.fujitsu.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 fa9d13cf
...@@ -1120,16 +1120,6 @@ ftrace_notrace_open(struct inode *inode, struct file *file) ...@@ -1120,16 +1120,6 @@ ftrace_notrace_open(struct inode *inode, struct file *file)
return ftrace_regex_open(inode, file, 0); return ftrace_regex_open(inode, file, 0);
} }
static ssize_t
ftrace_regex_read(struct file *file, char __user *ubuf,
size_t cnt, loff_t *ppos)
{
if (file->f_mode & FMODE_READ)
return seq_read(file, ubuf, cnt, ppos);
else
return -EPERM;
}
static loff_t static loff_t
ftrace_regex_lseek(struct file *file, loff_t offset, int origin) ftrace_regex_lseek(struct file *file, loff_t offset, int origin)
{ {
...@@ -1882,7 +1872,7 @@ static const struct file_operations ftrace_failures_fops = { ...@@ -1882,7 +1872,7 @@ static const struct file_operations ftrace_failures_fops = {
static const struct file_operations ftrace_filter_fops = { static const struct file_operations ftrace_filter_fops = {
.open = ftrace_filter_open, .open = ftrace_filter_open,
.read = ftrace_regex_read, .read = seq_read,
.write = ftrace_filter_write, .write = ftrace_filter_write,
.llseek = ftrace_regex_lseek, .llseek = ftrace_regex_lseek,
.release = ftrace_filter_release, .release = ftrace_filter_release,
...@@ -1890,7 +1880,7 @@ static const struct file_operations ftrace_filter_fops = { ...@@ -1890,7 +1880,7 @@ static const struct file_operations ftrace_filter_fops = {
static const struct file_operations ftrace_notrace_fops = { static const struct file_operations ftrace_notrace_fops = {
.open = ftrace_notrace_open, .open = ftrace_notrace_open,
.read = ftrace_regex_read, .read = seq_read,
.write = ftrace_notrace_write, .write = ftrace_notrace_write,
.llseek = ftrace_regex_lseek, .llseek = ftrace_regex_lseek,
.release = ftrace_notrace_release, .release = ftrace_notrace_release,
...@@ -1992,16 +1982,6 @@ ftrace_graph_open(struct inode *inode, struct file *file) ...@@ -1992,16 +1982,6 @@ ftrace_graph_open(struct inode *inode, struct file *file)
return ret; return ret;
} }
static ssize_t
ftrace_graph_read(struct file *file, char __user *ubuf,
size_t cnt, loff_t *ppos)
{
if (file->f_mode & FMODE_READ)
return seq_read(file, ubuf, cnt, ppos);
else
return -EPERM;
}
static int static int
ftrace_set_func(unsigned long *array, int *idx, char *buffer) ftrace_set_func(unsigned long *array, int *idx, char *buffer)
{ {
...@@ -2132,7 +2112,7 @@ ftrace_graph_write(struct file *file, const char __user *ubuf, ...@@ -2132,7 +2112,7 @@ ftrace_graph_write(struct file *file, const char __user *ubuf,
static const struct file_operations ftrace_graph_fops = { static const struct file_operations ftrace_graph_fops = {
.open = ftrace_graph_open, .open = ftrace_graph_open,
.read = ftrace_graph_read, .read = seq_read,
.write = ftrace_graph_write, .write = ftrace_graph_write,
}; };
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册