aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/oprofile
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-07-19 08:10:36 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-09-03 22:52:48 -0400
commit6af4ea0ba708172be8caf1ba5047b2b8a9d2fea3 (patch)
treeb52fe5f7e6a811184f2379bc6bab3d4b6d2e6520 /drivers/oprofile
parentecde28237e10de3750a97579f42bc2ec65b8a0e1 (diff)
oprofilefs_create_...() do not need superblock argument
same story as with oprofilefs_mkdir() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/oprofile')
-rw-r--r--drivers/oprofile/oprofile_files.c20
-rw-r--r--drivers/oprofile/oprofile_perf.c12
-rw-r--r--drivers/oprofile/oprofile_stats.c18
-rw-r--r--drivers/oprofile/oprofilefs.c27
4 files changed, 38 insertions, 39 deletions
diff --git a/drivers/oprofile/oprofile_files.c b/drivers/oprofile/oprofile_files.c
index 07462a9af615..ee2cfce358b9 100644
--- a/drivers/oprofile/oprofile_files.c
+++ b/drivers/oprofile/oprofile_files.c
@@ -183,17 +183,17 @@ void oprofile_create_files(struct dentry *root)
183 oprofile_buffer_watershed = BUFFER_WATERSHED_DEFAULT; 183 oprofile_buffer_watershed = BUFFER_WATERSHED_DEFAULT;
184 oprofile_time_slice = msecs_to_jiffies(TIME_SLICE_DEFAULT); 184 oprofile_time_slice = msecs_to_jiffies(TIME_SLICE_DEFAULT);
185 185
186 oprofilefs_create_file(root->d_sb, root, "enable", &enable_fops); 186 oprofilefs_create_file(root, "enable", &enable_fops);
187 oprofilefs_create_file_perm(root->d_sb, root, "dump", &dump_fops, 0666); 187 oprofilefs_create_file_perm(root, "dump", &dump_fops, 0666);
188 oprofilefs_create_file(root->d_sb, root, "buffer", &event_buffer_fops); 188 oprofilefs_create_file(root, "buffer", &event_buffer_fops);
189 oprofilefs_create_ulong(root->d_sb, root, "buffer_size", &oprofile_buffer_size); 189 oprofilefs_create_ulong(root, "buffer_size", &oprofile_buffer_size);
190 oprofilefs_create_ulong(root->d_sb, root, "buffer_watershed", &oprofile_buffer_watershed); 190 oprofilefs_create_ulong(root, "buffer_watershed", &oprofile_buffer_watershed);
191 oprofilefs_create_ulong(root->d_sb, root, "cpu_buffer_size", &oprofile_cpu_buffer_size); 191 oprofilefs_create_ulong(root, "cpu_buffer_size", &oprofile_cpu_buffer_size);
192 oprofilefs_create_file(root->d_sb, root, "cpu_type", &cpu_type_fops); 192 oprofilefs_create_file(root, "cpu_type", &cpu_type_fops);
193 oprofilefs_create_file(root->d_sb, root, "backtrace_depth", &depth_fops); 193 oprofilefs_create_file(root, "backtrace_depth", &depth_fops);
194 oprofilefs_create_file(root->d_sb, root, "pointer_size", &pointer_size_fops); 194 oprofilefs_create_file(root, "pointer_size", &pointer_size_fops);
195#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX 195#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
196 oprofilefs_create_file(root->d_sb, root, "time_slice", &timeout_fops); 196 oprofilefs_create_file(root, "time_slice", &timeout_fops);
197#endif 197#endif
198 oprofile_create_stats_files(root); 198 oprofile_create_stats_files(root);
199 if (oprofile_ops.create_files) 199 if (oprofile_ops.create_files)
diff --git a/drivers/oprofile/oprofile_perf.c b/drivers/oprofile/oprofile_perf.c
index 923a245774fa..d5b2732b1b81 100644
--- a/drivers/oprofile/oprofile_perf.c
+++ b/drivers/oprofile/oprofile_perf.c
@@ -148,12 +148,12 @@ static int oprofile_perf_create_files(struct dentry *root)
148 148
149 snprintf(buf, sizeof buf, "%d", i); 149 snprintf(buf, sizeof buf, "%d", i);
150 dir = oprofilefs_mkdir(root, buf); 150 dir = oprofilefs_mkdir(root, buf);
151 oprofilefs_create_ulong(root->d_sb, dir, "enabled", &counter_config[i].enabled); 151 oprofilefs_create_ulong(dir, "enabled", &counter_config[i].enabled);
152 oprofilefs_create_ulong(root->d_sb, dir, "event", &counter_config[i].event); 152 oprofilefs_create_ulong(dir, "event", &counter_config[i].event);
153 oprofilefs_create_ulong(root->d_sb, dir, "count", &counter_config[i].count); 153 oprofilefs_create_ulong(dir, "count", &counter_config[i].count);
154 oprofilefs_create_ulong(root->d_sb, dir, "unit_mask", &counter_config[i].unit_mask); 154 oprofilefs_create_ulong(dir, "unit_mask", &counter_config[i].unit_mask);
155 oprofilefs_create_ulong(root->d_sb, dir, "kernel", &counter_config[i].kernel); 155 oprofilefs_create_ulong(dir, "kernel", &counter_config[i].kernel);
156 oprofilefs_create_ulong(root->d_sb, dir, "user", &counter_config[i].user); 156 oprofilefs_create_ulong(dir, "user", &counter_config[i].user);
157 } 157 }
158 158
159 return 0; 159 return 0;
diff --git a/drivers/oprofile/oprofile_stats.c b/drivers/oprofile/oprofile_stats.c
index 8cf2fa9710a4..59659cea4582 100644
--- a/drivers/oprofile/oprofile_stats.c
+++ b/drivers/oprofile/oprofile_stats.c
@@ -59,26 +59,26 @@ void oprofile_create_stats_files(struct dentry *root)
59 * but we can't simply lock them, and they are 59 * but we can't simply lock them, and they are
60 * informational only. 60 * informational only.
61 */ 61 */
62 oprofilefs_create_ro_ulong(root->d_sb, cpudir, "sample_received", 62 oprofilefs_create_ro_ulong(cpudir, "sample_received",
63 &cpu_buf->sample_received); 63 &cpu_buf->sample_received);
64 oprofilefs_create_ro_ulong(root->d_sb, cpudir, "sample_lost_overflow", 64 oprofilefs_create_ro_ulong(cpudir, "sample_lost_overflow",
65 &cpu_buf->sample_lost_overflow); 65 &cpu_buf->sample_lost_overflow);
66 oprofilefs_create_ro_ulong(root->d_sb, cpudir, "backtrace_aborted", 66 oprofilefs_create_ro_ulong(cpudir, "backtrace_aborted",
67 &cpu_buf->backtrace_aborted); 67 &cpu_buf->backtrace_aborted);
68 oprofilefs_create_ro_ulong(root->d_sb, cpudir, "sample_invalid_eip", 68 oprofilefs_create_ro_ulong(cpudir, "sample_invalid_eip",
69 &cpu_buf->sample_invalid_eip); 69 &cpu_buf->sample_invalid_eip);
70 } 70 }
71 71
72 oprofilefs_create_ro_atomic(root->d_sb, dir, "sample_lost_no_mm", 72 oprofilefs_create_ro_atomic(dir, "sample_lost_no_mm",
73 &oprofile_stats.sample_lost_no_mm); 73 &oprofile_stats.sample_lost_no_mm);
74 oprofilefs_create_ro_atomic(root->d_sb, dir, "sample_lost_no_mapping", 74 oprofilefs_create_ro_atomic(dir, "sample_lost_no_mapping",
75 &oprofile_stats.sample_lost_no_mapping); 75 &oprofile_stats.sample_lost_no_mapping);
76 oprofilefs_create_ro_atomic(root->d_sb, dir, "event_lost_overflow", 76 oprofilefs_create_ro_atomic(dir, "event_lost_overflow",
77 &oprofile_stats.event_lost_overflow); 77 &oprofile_stats.event_lost_overflow);
78 oprofilefs_create_ro_atomic(root->d_sb, dir, "bt_lost_no_mapping", 78 oprofilefs_create_ro_atomic(dir, "bt_lost_no_mapping",
79 &oprofile_stats.bt_lost_no_mapping); 79 &oprofile_stats.bt_lost_no_mapping);
80#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX 80#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
81 oprofilefs_create_ro_atomic(root->d_sb, dir, "multiplex_counter", 81 oprofilefs_create_ro_atomic(dir, "multiplex_counter",
82 &oprofile_stats.multiplex_counter); 82 &oprofile_stats.multiplex_counter);
83#endif 83#endif
84} 84}
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c
index 6a345724637f..3f493459378f 100644
--- a/drivers/oprofile/oprofilefs.c
+++ b/drivers/oprofile/oprofilefs.c
@@ -132,9 +132,8 @@ static const struct file_operations ulong_ro_fops = {
132}; 132};
133 133
134 134
135static int __oprofilefs_create_file(struct super_block *sb, 135static int __oprofilefs_create_file(struct dentry *root, char const *name,
136 struct dentry *root, char const *name, const struct file_operations *fops, 136 const struct file_operations *fops, int perm, void *priv)
137 int perm, void *priv)
138{ 137{
139 struct dentry *dentry; 138 struct dentry *dentry;
140 struct inode *inode; 139 struct inode *inode;
@@ -145,7 +144,7 @@ static int __oprofilefs_create_file(struct super_block *sb,
145 mutex_unlock(&root->d_inode->i_mutex); 144 mutex_unlock(&root->d_inode->i_mutex);
146 return -ENOMEM; 145 return -ENOMEM;
147 } 146 }
148 inode = oprofilefs_get_inode(sb, S_IFREG | perm); 147 inode = oprofilefs_get_inode(root->d_sb, S_IFREG | perm);
149 if (!inode) { 148 if (!inode) {
150 dput(dentry); 149 dput(dentry);
151 mutex_unlock(&root->d_inode->i_mutex); 150 mutex_unlock(&root->d_inode->i_mutex);
@@ -159,18 +158,18 @@ static int __oprofilefs_create_file(struct super_block *sb,
159} 158}
160 159
161 160
162int oprofilefs_create_ulong(struct super_block *sb, struct dentry *root, 161int oprofilefs_create_ulong(struct dentry *root,
163 char const *name, unsigned long *val) 162 char const *name, unsigned long *val)
164{ 163{
165 return __oprofilefs_create_file(sb, root, name, 164 return __oprofilefs_create_file(root, name,
166 &ulong_fops, 0644, val); 165 &ulong_fops, 0644, val);
167} 166}
168 167
169 168
170int oprofilefs_create_ro_ulong(struct super_block *sb, struct dentry *root, 169int oprofilefs_create_ro_ulong(struct dentry *root,
171 char const *name, unsigned long *val) 170 char const *name, unsigned long *val)
172{ 171{
173 return __oprofilefs_create_file(sb, root, name, 172 return __oprofilefs_create_file(root, name,
174 &ulong_ro_fops, 0444, val); 173 &ulong_ro_fops, 0444, val);
175} 174}
176 175
@@ -189,25 +188,25 @@ static const struct file_operations atomic_ro_fops = {
189}; 188};
190 189
191 190
192int oprofilefs_create_ro_atomic(struct super_block *sb, struct dentry *root, 191int oprofilefs_create_ro_atomic(struct dentry *root,
193 char const *name, atomic_t *val) 192 char const *name, atomic_t *val)
194{ 193{
195 return __oprofilefs_create_file(sb, root, name, 194 return __oprofilefs_create_file(root, name,
196 &atomic_ro_fops, 0444, val); 195 &atomic_ro_fops, 0444, val);
197} 196}
198 197
199 198
200int oprofilefs_create_file(struct super_block *sb, struct dentry *root, 199int oprofilefs_create_file(struct dentry *root,
201 char const *name, const struct file_operations *fops) 200 char const *name, const struct file_operations *fops)
202{ 201{
203 return __oprofilefs_create_file(sb, root, name, fops, 0644, NULL); 202 return __oprofilefs_create_file(root, name, fops, 0644, NULL);
204} 203}
205 204
206 205
207int oprofilefs_create_file_perm(struct super_block *sb, struct dentry *root, 206int oprofilefs_create_file_perm(struct dentry *root,
208 char const *name, const struct file_operations *fops, int perm) 207 char const *name, const struct file_operations *fops, int perm)
209{ 208{
210 return __oprofilefs_create_file(sb, root, name, fops, perm, NULL); 209 return __oprofilefs_create_file(root, name, fops, perm, NULL);
211} 210}
212 211
213 212