Commit b444786f authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Frederic Weisbecker

tracing: Use generic_file_llseek for debugfs

The default for llseek will change to no_llseek,
so the tracing debugfs files need to add explicit
.llseek assignments. Since we're dealing with regular
files from a VFS perspective, use generic_file_llseek.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: John Kacur <jkacur@redhat.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <1278538820-1392-10-git-send-email-arnd@arndb.de>
Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
parent eb7beb5c
...@@ -2338,6 +2338,7 @@ static const struct file_operations show_traces_fops = { ...@@ -2338,6 +2338,7 @@ static const struct file_operations show_traces_fops = {
.open = show_traces_open, .open = show_traces_open,
.read = seq_read, .read = seq_read,
.release = seq_release, .release = seq_release,
.llseek = seq_lseek,
}; };
/* /*
...@@ -2431,6 +2432,7 @@ static const struct file_operations tracing_cpumask_fops = { ...@@ -2431,6 +2432,7 @@ static const struct file_operations tracing_cpumask_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = tracing_cpumask_read, .read = tracing_cpumask_read,
.write = tracing_cpumask_write, .write = tracing_cpumask_write,
.llseek = generic_file_llseek,
}; };
static int tracing_trace_options_show(struct seq_file *m, void *v) static int tracing_trace_options_show(struct seq_file *m, void *v)
...@@ -2597,6 +2599,7 @@ tracing_readme_read(struct file *filp, char __user *ubuf, ...@@ -2597,6 +2599,7 @@ tracing_readme_read(struct file *filp, char __user *ubuf,
static const struct file_operations tracing_readme_fops = { static const struct file_operations tracing_readme_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = tracing_readme_read, .read = tracing_readme_read,
.llseek = generic_file_llseek,
}; };
static ssize_t static ssize_t
...@@ -2647,6 +2650,7 @@ tracing_saved_cmdlines_read(struct file *file, char __user *ubuf, ...@@ -2647,6 +2650,7 @@ tracing_saved_cmdlines_read(struct file *file, char __user *ubuf,
static const struct file_operations tracing_saved_cmdlines_fops = { static const struct file_operations tracing_saved_cmdlines_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = tracing_saved_cmdlines_read, .read = tracing_saved_cmdlines_read,
.llseek = generic_file_llseek,
}; };
static ssize_t static ssize_t
...@@ -2976,6 +2980,7 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp) ...@@ -2976,6 +2980,7 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp)
if (iter->trace->pipe_open) if (iter->trace->pipe_open)
iter->trace->pipe_open(iter); iter->trace->pipe_open(iter);
nonseekable_open(inode, filp);
out: out:
mutex_unlock(&trace_types_lock); mutex_unlock(&trace_types_lock);
return ret; return ret;
...@@ -3534,18 +3539,21 @@ static const struct file_operations tracing_max_lat_fops = { ...@@ -3534,18 +3539,21 @@ static const struct file_operations tracing_max_lat_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = tracing_max_lat_read, .read = tracing_max_lat_read,
.write = tracing_max_lat_write, .write = tracing_max_lat_write,
.llseek = generic_file_llseek,
}; };
static const struct file_operations tracing_ctrl_fops = { static const struct file_operations tracing_ctrl_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = tracing_ctrl_read, .read = tracing_ctrl_read,
.write = tracing_ctrl_write, .write = tracing_ctrl_write,
.llseek = generic_file_llseek,
}; };
static const struct file_operations set_tracer_fops = { static const struct file_operations set_tracer_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = tracing_set_trace_read, .read = tracing_set_trace_read,
.write = tracing_set_trace_write, .write = tracing_set_trace_write,
.llseek = generic_file_llseek,
}; };
static const struct file_operations tracing_pipe_fops = { static const struct file_operations tracing_pipe_fops = {
...@@ -3554,17 +3562,20 @@ static const struct file_operations tracing_pipe_fops = { ...@@ -3554,17 +3562,20 @@ static const struct file_operations tracing_pipe_fops = {
.read = tracing_read_pipe, .read = tracing_read_pipe,
.splice_read = tracing_splice_read_pipe, .splice_read = tracing_splice_read_pipe,
.release = tracing_release_pipe, .release = tracing_release_pipe,
.llseek = no_llseek,
}; };
static const struct file_operations tracing_entries_fops = { static const struct file_operations tracing_entries_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = tracing_entries_read, .read = tracing_entries_read,
.write = tracing_entries_write, .write = tracing_entries_write,
.llseek = generic_file_llseek,
}; };
static const struct file_operations tracing_mark_fops = { static const struct file_operations tracing_mark_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.write = tracing_mark_write, .write = tracing_mark_write,
.llseek = generic_file_llseek,
}; };
static const struct file_operations trace_clock_fops = { static const struct file_operations trace_clock_fops = {
...@@ -3870,6 +3881,7 @@ tracing_stats_read(struct file *filp, char __user *ubuf, ...@@ -3870,6 +3881,7 @@ tracing_stats_read(struct file *filp, char __user *ubuf,
static const struct file_operations tracing_stats_fops = { static const struct file_operations tracing_stats_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = tracing_stats_read, .read = tracing_stats_read,
.llseek = generic_file_llseek,
}; };
#ifdef CONFIG_DYNAMIC_FTRACE #ifdef CONFIG_DYNAMIC_FTRACE
...@@ -3906,6 +3918,7 @@ tracing_read_dyn_info(struct file *filp, char __user *ubuf, ...@@ -3906,6 +3918,7 @@ tracing_read_dyn_info(struct file *filp, char __user *ubuf,
static const struct file_operations tracing_dyn_info_fops = { static const struct file_operations tracing_dyn_info_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = tracing_read_dyn_info, .read = tracing_read_dyn_info,
.llseek = generic_file_llseek,
}; };
#endif #endif
...@@ -4059,6 +4072,7 @@ static const struct file_operations trace_options_fops = { ...@@ -4059,6 +4072,7 @@ static const struct file_operations trace_options_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = trace_options_read, .read = trace_options_read,
.write = trace_options_write, .write = trace_options_write,
.llseek = generic_file_llseek,
}; };
static ssize_t static ssize_t
...@@ -4110,6 +4124,7 @@ static const struct file_operations trace_options_core_fops = { ...@@ -4110,6 +4124,7 @@ static const struct file_operations trace_options_core_fops = {
.open = tracing_open_generic, .open = tracing_open_generic,
.read = trace_options_core_read, .read = trace_options_core_read,
.write = trace_options_core_write, .write = trace_options_core_write,
.llseek = generic_file_llseek,
}; };
struct dentry *trace_create_file(const char *name, struct dentry *trace_create_file(const char *name,
......
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