diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2009-03-13 05:47:23 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-13 06:35:31 -0400 |
commit | 850a80cfaa5aec3e626eb3736eff890a80e4fa77 (patch) | |
tree | 777195c11a34eee8a63a5d2ccc3cf0ccd2855491 /kernel/trace | |
parent | fa9d13cf135efbd454453a53b6299976bea245a9 (diff) |
ftrace: use seq_read
Impact: cleanup
VFS layer has tested the file mode, we do not need test it.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <srostedt@redhat.com>
LKML-Reference: <49BA2BAB.6010608@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/ftrace.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 08f4a624e31f..bf78a4c75c67 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1120,16 +1120,6 @@ ftrace_notrace_open(struct inode *inode, struct file *file) | |||
1120 | return ftrace_regex_open(inode, file, 0); | 1120 | return ftrace_regex_open(inode, file, 0); |
1121 | } | 1121 | } |
1122 | 1122 | ||
1123 | static ssize_t | ||
1124 | ftrace_regex_read(struct file *file, char __user *ubuf, | ||
1125 | size_t cnt, loff_t *ppos) | ||
1126 | { | ||
1127 | if (file->f_mode & FMODE_READ) | ||
1128 | return seq_read(file, ubuf, cnt, ppos); | ||
1129 | else | ||
1130 | return -EPERM; | ||
1131 | } | ||
1132 | |||
1133 | static loff_t | 1123 | static loff_t |
1134 | ftrace_regex_lseek(struct file *file, loff_t offset, int origin) | 1124 | ftrace_regex_lseek(struct file *file, loff_t offset, int origin) |
1135 | { | 1125 | { |
@@ -1882,7 +1872,7 @@ static const struct file_operations ftrace_failures_fops = { | |||
1882 | 1872 | ||
1883 | static const struct file_operations ftrace_filter_fops = { | 1873 | static const struct file_operations ftrace_filter_fops = { |
1884 | .open = ftrace_filter_open, | 1874 | .open = ftrace_filter_open, |
1885 | .read = ftrace_regex_read, | 1875 | .read = seq_read, |
1886 | .write = ftrace_filter_write, | 1876 | .write = ftrace_filter_write, |
1887 | .llseek = ftrace_regex_lseek, | 1877 | .llseek = ftrace_regex_lseek, |
1888 | .release = ftrace_filter_release, | 1878 | .release = ftrace_filter_release, |
@@ -1890,7 +1880,7 @@ static const struct file_operations ftrace_filter_fops = { | |||
1890 | 1880 | ||
1891 | static const struct file_operations ftrace_notrace_fops = { | 1881 | static const struct file_operations ftrace_notrace_fops = { |
1892 | .open = ftrace_notrace_open, | 1882 | .open = ftrace_notrace_open, |
1893 | .read = ftrace_regex_read, | 1883 | .read = seq_read, |
1894 | .write = ftrace_notrace_write, | 1884 | .write = ftrace_notrace_write, |
1895 | .llseek = ftrace_regex_lseek, | 1885 | .llseek = ftrace_regex_lseek, |
1896 | .release = ftrace_notrace_release, | 1886 | .release = ftrace_notrace_release, |
@@ -1992,16 +1982,6 @@ ftrace_graph_open(struct inode *inode, struct file *file) | |||
1992 | return ret; | 1982 | return ret; |
1993 | } | 1983 | } |
1994 | 1984 | ||
1995 | static ssize_t | ||
1996 | ftrace_graph_read(struct file *file, char __user *ubuf, | ||
1997 | size_t cnt, loff_t *ppos) | ||
1998 | { | ||
1999 | if (file->f_mode & FMODE_READ) | ||
2000 | return seq_read(file, ubuf, cnt, ppos); | ||
2001 | else | ||
2002 | return -EPERM; | ||
2003 | } | ||
2004 | |||
2005 | static int | 1985 | static int |
2006 | ftrace_set_func(unsigned long *array, int *idx, char *buffer) | 1986 | ftrace_set_func(unsigned long *array, int *idx, char *buffer) |
2007 | { | 1987 | { |
@@ -2132,7 +2112,7 @@ ftrace_graph_write(struct file *file, const char __user *ubuf, | |||
2132 | 2112 | ||
2133 | static const struct file_operations ftrace_graph_fops = { | 2113 | static const struct file_operations ftrace_graph_fops = { |
2134 | .open = ftrace_graph_open, | 2114 | .open = ftrace_graph_open, |
2135 | .read = ftrace_graph_read, | 2115 | .read = seq_read, |
2136 | .write = ftrace_graph_write, | 2116 | .write = ftrace_graph_write, |
2137 | }; | 2117 | }; |
2138 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | 2118 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |