diff options
| author | David Howells <dhowells@redhat.com> | 2015-01-21 15:03:40 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-01-25 23:23:23 -0500 |
| commit | 163f9eb95a10371ead59b62087e0d4e7ce53112e (patch) | |
| tree | d1194fe02bcb93cd0fbf4924c9756158717338e9 /include/linux/debugfs.h | |
| parent | 77b3da6e3232d3b4d4b8addb4b05799fe98f3bf8 (diff) | |
debugfs: Provide a file creation function that also takes an initial size
Provide a file creation function that also takes an initial size so that the
caller doesn't have to set i_size, thus meaning that we don't have to call
deal with ->d_inode in the callers.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/linux/debugfs.h')
| -rw-r--r-- | include/linux/debugfs.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index ea149a24a1f2..cb25af461054 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
| @@ -51,6 +51,11 @@ struct dentry *debugfs_create_file(const char *name, umode_t mode, | |||
| 51 | struct dentry *parent, void *data, | 51 | struct dentry *parent, void *data, |
| 52 | const struct file_operations *fops); | 52 | const struct file_operations *fops); |
| 53 | 53 | ||
| 54 | struct dentry *debugfs_create_file_size(const char *name, umode_t mode, | ||
| 55 | struct dentry *parent, void *data, | ||
| 56 | const struct file_operations *fops, | ||
| 57 | loff_t file_size); | ||
| 58 | |||
| 54 | struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); | 59 | struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); |
| 55 | 60 | ||
| 56 | struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, | 61 | struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, |
| @@ -129,6 +134,14 @@ static inline struct dentry *debugfs_create_file(const char *name, umode_t mode, | |||
| 129 | return ERR_PTR(-ENODEV); | 134 | return ERR_PTR(-ENODEV); |
| 130 | } | 135 | } |
| 131 | 136 | ||
| 137 | static inline struct dentry *debugfs_create_file_size(const char *name, umode_t mode, | ||
| 138 | struct dentry *parent, void *data, | ||
| 139 | const struct file_operations *fops, | ||
| 140 | loff_t file_size) | ||
| 141 | { | ||
| 142 | return ERR_PTR(-ENODEV); | ||
| 143 | } | ||
| 144 | |||
| 132 | static inline struct dentry *debugfs_create_dir(const char *name, | 145 | static inline struct dentry *debugfs_create_dir(const char *name, |
| 133 | struct dentry *parent) | 146 | struct dentry *parent) |
| 134 | { | 147 | { |
