blob: 39a619c222faf12ca399562113a0f082f4ef65fd [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * file.c - part of debugfs, a tiny little debug file system
3 *
4 * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
5 * Copyright (C) 2004 IBM Inc.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version
9 * 2 as published by the Free Software Foundation.
10 *
11 * debugfs is for people to use instead of /proc or /sys.
Robert P. J. Day883ce422008-04-25 08:52:51 -040012 * See Documentation/DocBook/filesystems for more details.
Linus Torvalds1da177e2005-04-16 15:20:36 -070013 *
14 */
15
Linus Torvalds1da177e2005-04-16 15:20:36 -070016#include <linux/module.h>
17#include <linux/fs.h>
18#include <linux/pagemap.h>
Peter Oberparleiter66f54962007-02-13 12:13:54 +010019#include <linux/namei.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <linux/debugfs.h>
21
22static ssize_t default_read_file(struct file *file, char __user *buf,
23 size_t count, loff_t *ppos)
24{
25 return 0;
26}
27
28static ssize_t default_write_file(struct file *file, const char __user *buf,
29 size_t count, loff_t *ppos)
30{
31 return count;
32}
33
34static int default_open(struct inode *inode, struct file *file)
35{
Theodore Ts'o8e18e292006-09-27 01:50:46 -070036 if (inode->i_private)
37 file->private_data = inode->i_private;
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
39 return 0;
40}
41
Arjan van de Ven4b6f5d22006-03-28 01:56:42 -080042const struct file_operations debugfs_file_operations = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070043 .read = default_read_file,
44 .write = default_write_file,
45 .open = default_open,
46};
47
Peter Oberparleiter66f54962007-02-13 12:13:54 +010048static void *debugfs_follow_link(struct dentry *dentry, struct nameidata *nd)
49{
50 nd_set_link(nd, dentry->d_inode->i_private);
51 return NULL;
52}
53
54const struct inode_operations debugfs_link_operations = {
55 .readlink = generic_readlink,
56 .follow_link = debugfs_follow_link,
57};
58
Christoph Hellwig8b88b092008-02-08 04:20:26 -080059static int debugfs_u8_set(void *data, u64 val)
Arnd Bergmannacaefc22005-05-18 14:40:59 +020060{
61 *(u8 *)data = val;
Christoph Hellwig8b88b092008-02-08 04:20:26 -080062 return 0;
Arnd Bergmannacaefc22005-05-18 14:40:59 +020063}
Christoph Hellwig8b88b092008-02-08 04:20:26 -080064static int debugfs_u8_get(void *data, u64 *val)
Arnd Bergmannacaefc22005-05-18 14:40:59 +020065{
Christoph Hellwig8b88b092008-02-08 04:20:26 -080066 *val = *(u8 *)data;
67 return 0;
Arnd Bergmannacaefc22005-05-18 14:40:59 +020068}
69DEFINE_SIMPLE_ATTRIBUTE(fops_u8, debugfs_u8_get, debugfs_u8_set, "%llu\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
71/**
Randy Dunlap6468b3a2006-07-20 08:16:42 -070072 * debugfs_create_u8 - create a debugfs file that is used to read and write an unsigned 8-bit value
Linus Torvalds1da177e2005-04-16 15:20:36 -070073 * @name: a pointer to a string containing the name of the file to create.
74 * @mode: the permission that the file should have
75 * @parent: a pointer to the parent dentry for this file. This should be a
Randy Dunlap6468b3a2006-07-20 08:16:42 -070076 * directory dentry if set. If this parameter is %NULL, then the
Linus Torvalds1da177e2005-04-16 15:20:36 -070077 * file will be created in the root of the debugfs filesystem.
78 * @value: a pointer to the variable that the file should read to and write
79 * from.
80 *
81 * This function creates a file in debugfs with the given name that
82 * contains the value of the variable @value. If the @mode variable is so
83 * set, it can be read from, and written to.
84 *
85 * This function will return a pointer to a dentry if it succeeds. This
86 * pointer must be passed to the debugfs_remove() function when the file is
87 * to be removed (no automatic cleanup happens if your module is unloaded,
Randy Dunlap6468b3a2006-07-20 08:16:42 -070088 * you are responsible here.) If an error occurs, %NULL will be returned.
Linus Torvalds1da177e2005-04-16 15:20:36 -070089 *
Randy Dunlap6468b3a2006-07-20 08:16:42 -070090 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
Linus Torvalds1da177e2005-04-16 15:20:36 -070091 * returned. It is not wise to check for this value, but rather, check for
Randy Dunlap6468b3a2006-07-20 08:16:42 -070092 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
Linus Torvalds1da177e2005-04-16 15:20:36 -070093 * code.
94 */
95struct dentry *debugfs_create_u8(const char *name, mode_t mode,
96 struct dentry *parent, u8 *value)
97{
98 return debugfs_create_file(name, mode, parent, value, &fops_u8);
99}
100EXPORT_SYMBOL_GPL(debugfs_create_u8);
101
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800102static int debugfs_u16_set(void *data, u64 val)
Arnd Bergmannacaefc22005-05-18 14:40:59 +0200103{
104 *(u16 *)data = val;
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800105 return 0;
Arnd Bergmannacaefc22005-05-18 14:40:59 +0200106}
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800107static int debugfs_u16_get(void *data, u64 *val)
Arnd Bergmannacaefc22005-05-18 14:40:59 +0200108{
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800109 *val = *(u16 *)data;
110 return 0;
Arnd Bergmannacaefc22005-05-18 14:40:59 +0200111}
112DEFINE_SIMPLE_ATTRIBUTE(fops_u16, debugfs_u16_get, debugfs_u16_set, "%llu\n");
113
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114/**
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700115 * debugfs_create_u16 - create a debugfs file that is used to read and write an unsigned 16-bit value
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116 * @name: a pointer to a string containing the name of the file to create.
117 * @mode: the permission that the file should have
118 * @parent: a pointer to the parent dentry for this file. This should be a
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700119 * directory dentry if set. If this parameter is %NULL, then the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 * file will be created in the root of the debugfs filesystem.
121 * @value: a pointer to the variable that the file should read to and write
122 * from.
123 *
124 * This function creates a file in debugfs with the given name that
125 * contains the value of the variable @value. If the @mode variable is so
126 * set, it can be read from, and written to.
127 *
128 * This function will return a pointer to a dentry if it succeeds. This
129 * pointer must be passed to the debugfs_remove() function when the file is
130 * to be removed (no automatic cleanup happens if your module is unloaded,
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700131 * you are responsible here.) If an error occurs, %NULL will be returned.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132 *
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700133 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134 * returned. It is not wise to check for this value, but rather, check for
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700135 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136 * code.
137 */
138struct dentry *debugfs_create_u16(const char *name, mode_t mode,
139 struct dentry *parent, u16 *value)
140{
141 return debugfs_create_file(name, mode, parent, value, &fops_u16);
142}
143EXPORT_SYMBOL_GPL(debugfs_create_u16);
144
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800145static int debugfs_u32_set(void *data, u64 val)
Arnd Bergmannacaefc22005-05-18 14:40:59 +0200146{
147 *(u32 *)data = val;
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800148 return 0;
Arnd Bergmannacaefc22005-05-18 14:40:59 +0200149}
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800150static int debugfs_u32_get(void *data, u64 *val)
Arnd Bergmannacaefc22005-05-18 14:40:59 +0200151{
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800152 *val = *(u32 *)data;
153 return 0;
Arnd Bergmannacaefc22005-05-18 14:40:59 +0200154}
155DEFINE_SIMPLE_ATTRIBUTE(fops_u32, debugfs_u32_get, debugfs_u32_set, "%llu\n");
156
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157/**
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700158 * debugfs_create_u32 - create a debugfs file that is used to read and write an unsigned 32-bit value
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159 * @name: a pointer to a string containing the name of the file to create.
160 * @mode: the permission that the file should have
161 * @parent: a pointer to the parent dentry for this file. This should be a
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700162 * directory dentry if set. If this parameter is %NULL, then the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163 * file will be created in the root of the debugfs filesystem.
164 * @value: a pointer to the variable that the file should read to and write
165 * from.
166 *
167 * This function creates a file in debugfs with the given name that
168 * contains the value of the variable @value. If the @mode variable is so
169 * set, it can be read from, and written to.
170 *
171 * This function will return a pointer to a dentry if it succeeds. This
172 * pointer must be passed to the debugfs_remove() function when the file is
173 * to be removed (no automatic cleanup happens if your module is unloaded,
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700174 * you are responsible here.) If an error occurs, %NULL will be returned.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175 *
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700176 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177 * returned. It is not wise to check for this value, but rather, check for
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700178 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
Linus Torvalds1da177e2005-04-16 15:20:36 -0700179 * code.
180 */
181struct dentry *debugfs_create_u32(const char *name, mode_t mode,
182 struct dentry *parent, u32 *value)
183{
184 return debugfs_create_file(name, mode, parent, value, &fops_u32);
185}
186EXPORT_SYMBOL_GPL(debugfs_create_u32);
187
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800188static int debugfs_u64_set(void *data, u64 val)
Michael Ellerman84478912007-04-17 15:59:36 +1000189{
190 *(u64 *)data = val;
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800191 return 0;
Michael Ellerman84478912007-04-17 15:59:36 +1000192}
193
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800194static int debugfs_u64_get(void *data, u64 *val)
Michael Ellerman84478912007-04-17 15:59:36 +1000195{
Christoph Hellwig8b88b092008-02-08 04:20:26 -0800196 *val = *(u64 *)data;
197 return 0;
Michael Ellerman84478912007-04-17 15:59:36 +1000198}
199DEFINE_SIMPLE_ATTRIBUTE(fops_u64, debugfs_u64_get, debugfs_u64_set, "%llu\n");
200
201/**
202 * debugfs_create_u64 - create a debugfs file that is used to read and write an unsigned 64-bit value
203 * @name: a pointer to a string containing the name of the file to create.
204 * @mode: the permission that the file should have
205 * @parent: a pointer to the parent dentry for this file. This should be a
206 * directory dentry if set. If this parameter is %NULL, then the
207 * file will be created in the root of the debugfs filesystem.
208 * @value: a pointer to the variable that the file should read to and write
209 * from.
210 *
211 * This function creates a file in debugfs with the given name that
212 * contains the value of the variable @value. If the @mode variable is so
213 * set, it can be read from, and written to.
214 *
215 * This function will return a pointer to a dentry if it succeeds. This
216 * pointer must be passed to the debugfs_remove() function when the file is
217 * to be removed (no automatic cleanup happens if your module is unloaded,
218 * you are responsible here.) If an error occurs, %NULL will be returned.
219 *
220 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
221 * returned. It is not wise to check for this value, but rather, check for
222 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
223 * code.
224 */
225struct dentry *debugfs_create_u64(const char *name, mode_t mode,
226 struct dentry *parent, u64 *value)
227{
228 return debugfs_create_file(name, mode, parent, value, &fops_u64);
229}
230EXPORT_SYMBOL_GPL(debugfs_create_u64);
231
Robin Getz2ebefc52007-08-02 18:23:50 -0400232DEFINE_SIMPLE_ATTRIBUTE(fops_x8, debugfs_u8_get, debugfs_u8_set, "0x%02llx\n");
233
234DEFINE_SIMPLE_ATTRIBUTE(fops_x16, debugfs_u16_get, debugfs_u16_set, "0x%04llx\n");
235
236DEFINE_SIMPLE_ATTRIBUTE(fops_x32, debugfs_u32_get, debugfs_u32_set, "0x%08llx\n");
237
Randy Dunlape6716b82007-10-15 17:30:19 -0700238/*
239 * debugfs_create_x{8,16,32} - create a debugfs file that is used to read and write an unsigned {8,16,32}-bit value
240 *
241 * These functions are exactly the same as the above functions (but use a hex
242 * output for the decimal challenged). For details look at the above unsigned
243 * decimal functions.
244 */
245
Robin Getz2ebefc52007-08-02 18:23:50 -0400246/**
247 * debugfs_create_x8 - create a debugfs file that is used to read and write an unsigned 8-bit value
Randy Dunlape6716b82007-10-15 17:30:19 -0700248 * @name: a pointer to a string containing the name of the file to create.
249 * @mode: the permission that the file should have
250 * @parent: a pointer to the parent dentry for this file. This should be a
251 * directory dentry if set. If this parameter is %NULL, then the
252 * file will be created in the root of the debugfs filesystem.
253 * @value: a pointer to the variable that the file should read to and write
254 * from.
Robin Getz2ebefc52007-08-02 18:23:50 -0400255 */
256struct dentry *debugfs_create_x8(const char *name, mode_t mode,
257 struct dentry *parent, u8 *value)
258{
259 return debugfs_create_file(name, mode, parent, value, &fops_x8);
260}
261EXPORT_SYMBOL_GPL(debugfs_create_x8);
262
Randy Dunlape6716b82007-10-15 17:30:19 -0700263/**
264 * debugfs_create_x16 - create a debugfs file that is used to read and write an unsigned 16-bit value
265 * @name: a pointer to a string containing the name of the file to create.
266 * @mode: the permission that the file should have
267 * @parent: a pointer to the parent dentry for this file. This should be a
268 * directory dentry if set. If this parameter is %NULL, then the
269 * file will be created in the root of the debugfs filesystem.
270 * @value: a pointer to the variable that the file should read to and write
271 * from.
272 */
Robin Getz2ebefc52007-08-02 18:23:50 -0400273struct dentry *debugfs_create_x16(const char *name, mode_t mode,
274 struct dentry *parent, u16 *value)
275{
276 return debugfs_create_file(name, mode, parent, value, &fops_x16);
277}
278EXPORT_SYMBOL_GPL(debugfs_create_x16);
279
Randy Dunlape6716b82007-10-15 17:30:19 -0700280/**
281 * debugfs_create_x32 - create a debugfs file that is used to read and write an unsigned 32-bit value
282 * @name: a pointer to a string containing the name of the file to create.
283 * @mode: the permission that the file should have
284 * @parent: a pointer to the parent dentry for this file. This should be a
285 * directory dentry if set. If this parameter is %NULL, then the
286 * file will be created in the root of the debugfs filesystem.
287 * @value: a pointer to the variable that the file should read to and write
288 * from.
289 */
Robin Getz2ebefc52007-08-02 18:23:50 -0400290struct dentry *debugfs_create_x32(const char *name, mode_t mode,
291 struct dentry *parent, u32 *value)
292{
293 return debugfs_create_file(name, mode, parent, value, &fops_x32);
294}
295EXPORT_SYMBOL_GPL(debugfs_create_x32);
296
Inaky Perez-Gonzalez5e078782008-12-20 16:57:39 -0800297
298static int debugfs_size_t_set(void *data, u64 val)
299{
300 *(size_t *)data = val;
301 return 0;
302}
303static int debugfs_size_t_get(void *data, u64 *val)
304{
305 *val = *(size_t *)data;
306 return 0;
307}
308DEFINE_SIMPLE_ATTRIBUTE(fops_size_t, debugfs_size_t_get, debugfs_size_t_set,
309 "%llu\n"); /* %llu and %zu are more or less the same */
310
311/**
312 * debugfs_create_size_t - create a debugfs file that is used to read and write an size_t value
313 * @name: a pointer to a string containing the name of the file to create.
314 * @mode: the permission that the file should have
315 * @parent: a pointer to the parent dentry for this file. This should be a
316 * directory dentry if set. If this parameter is %NULL, then the
317 * file will be created in the root of the debugfs filesystem.
318 * @value: a pointer to the variable that the file should read to and write
319 * from.
320 */
321struct dentry *debugfs_create_size_t(const char *name, mode_t mode,
322 struct dentry *parent, size_t *value)
323{
324 return debugfs_create_file(name, mode, parent, value, &fops_size_t);
325}
326EXPORT_SYMBOL_GPL(debugfs_create_size_t);
327
328
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329static ssize_t read_file_bool(struct file *file, char __user *user_buf,
330 size_t count, loff_t *ppos)
331{
332 char buf[3];
333 u32 *val = file->private_data;
334
335 if (*val)
336 buf[0] = 'Y';
337 else
338 buf[0] = 'N';
339 buf[1] = '\n';
340 buf[2] = 0x00;
341 return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
342}
343
344static ssize_t write_file_bool(struct file *file, const char __user *user_buf,
345 size_t count, loff_t *ppos)
346{
347 char buf[32];
348 int buf_size;
349 u32 *val = file->private_data;
350
351 buf_size = min(count, (sizeof(buf)-1));
352 if (copy_from_user(buf, user_buf, buf_size))
353 return -EFAULT;
354
355 switch (buf[0]) {
356 case 'y':
357 case 'Y':
358 case '1':
359 *val = 1;
360 break;
361 case 'n':
362 case 'N':
363 case '0':
364 *val = 0;
365 break;
366 }
367
368 return count;
369}
370
Arjan van de Ven4b6f5d22006-03-28 01:56:42 -0800371static const struct file_operations fops_bool = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700372 .read = read_file_bool,
373 .write = write_file_bool,
374 .open = default_open,
375};
376
377/**
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700378 * debugfs_create_bool - create a debugfs file that is used to read and write a boolean value
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379 * @name: a pointer to a string containing the name of the file to create.
380 * @mode: the permission that the file should have
381 * @parent: a pointer to the parent dentry for this file. This should be a
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700382 * directory dentry if set. If this parameter is %NULL, then the
Linus Torvalds1da177e2005-04-16 15:20:36 -0700383 * file will be created in the root of the debugfs filesystem.
384 * @value: a pointer to the variable that the file should read to and write
385 * from.
386 *
387 * This function creates a file in debugfs with the given name that
388 * contains the value of the variable @value. If the @mode variable is so
389 * set, it can be read from, and written to.
390 *
391 * This function will return a pointer to a dentry if it succeeds. This
392 * pointer must be passed to the debugfs_remove() function when the file is
393 * to be removed (no automatic cleanup happens if your module is unloaded,
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700394 * you are responsible here.) If an error occurs, %NULL will be returned.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700395 *
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700396 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
Linus Torvalds1da177e2005-04-16 15:20:36 -0700397 * returned. It is not wise to check for this value, but rather, check for
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700398 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
Linus Torvalds1da177e2005-04-16 15:20:36 -0700399 * code.
400 */
401struct dentry *debugfs_create_bool(const char *name, mode_t mode,
402 struct dentry *parent, u32 *value)
403{
404 return debugfs_create_file(name, mode, parent, value, &fops_bool);
405}
406EXPORT_SYMBOL_GPL(debugfs_create_bool);
407
Michael Ellermandd308bc2006-03-07 21:41:59 +1100408static ssize_t read_file_blob(struct file *file, char __user *user_buf,
409 size_t count, loff_t *ppos)
410{
411 struct debugfs_blob_wrapper *blob = file->private_data;
412 return simple_read_from_buffer(user_buf, count, ppos, blob->data,
413 blob->size);
414}
415
Arjan van de Ven00977a52007-02-12 00:55:34 -0800416static const struct file_operations fops_blob = {
Michael Ellermandd308bc2006-03-07 21:41:59 +1100417 .read = read_file_blob,
418 .open = default_open,
419};
420
421/**
Jonathan Corbet400ced62009-05-25 10:15:27 -0600422 * debugfs_create_blob - create a debugfs file that is used to read a binary blob
Michael Ellermandd308bc2006-03-07 21:41:59 +1100423 * @name: a pointer to a string containing the name of the file to create.
424 * @mode: the permission that the file should have
425 * @parent: a pointer to the parent dentry for this file. This should be a
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700426 * directory dentry if set. If this parameter is %NULL, then the
Michael Ellermandd308bc2006-03-07 21:41:59 +1100427 * file will be created in the root of the debugfs filesystem.
428 * @blob: a pointer to a struct debugfs_blob_wrapper which contains a pointer
429 * to the blob data and the size of the data.
430 *
431 * This function creates a file in debugfs with the given name that exports
432 * @blob->data as a binary blob. If the @mode variable is so set it can be
433 * read from. Writing is not supported.
434 *
435 * This function will return a pointer to a dentry if it succeeds. This
436 * pointer must be passed to the debugfs_remove() function when the file is
437 * to be removed (no automatic cleanup happens if your module is unloaded,
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700438 * you are responsible here.) If an error occurs, %NULL will be returned.
Michael Ellermandd308bc2006-03-07 21:41:59 +1100439 *
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700440 * If debugfs is not enabled in the kernel, the value -%ENODEV will be
Michael Ellermandd308bc2006-03-07 21:41:59 +1100441 * returned. It is not wise to check for this value, but rather, check for
Randy Dunlap6468b3a2006-07-20 08:16:42 -0700442 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling
Michael Ellermandd308bc2006-03-07 21:41:59 +1100443 * code.
444 */
445struct dentry *debugfs_create_blob(const char *name, mode_t mode,
446 struct dentry *parent,
447 struct debugfs_blob_wrapper *blob)
448{
449 return debugfs_create_file(name, mode, parent, blob, &fops_blob);
450}
451EXPORT_SYMBOL_GPL(debugfs_create_blob);