summaryrefslogtreecommitdiff
path: root/include/linux/debugfs.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-01-21 23:03:40 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2015-02-17 20:21:51 +0300
commite59b4e9187bd5175b9845dc10fedb0879b7efbfd (patch)
treed1194fe02bcb93cd0fbf4924c9756158717338e9 /include/linux/debugfs.h
parent77b3da6e3232d3b4d4b8addb4b05799fe98f3bf8 (diff)
downloadlinux-e59b4e9187bd5175b9845dc10fedb0879b7efbfd.tar.xz
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> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/debugfs.h')
-rw-r--r--include/linux/debugfs.h13
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,
struct dentry *parent, void *data,
const struct file_operations *fops);
+struct dentry *debugfs_create_file_size(const char *name, umode_t mode,
+ struct dentry *parent, void *data,
+ const struct file_operations *fops,
+ loff_t file_size);
+
struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
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,
return ERR_PTR(-ENODEV);
}
+static inline struct dentry *debugfs_create_file_size(const char *name, umode_t mode,
+ struct dentry *parent, void *data,
+ const struct file_operations *fops,
+ loff_t file_size)
+{
+ return ERR_PTR(-ENODEV);
+}
+
static inline struct dentry *debugfs_create_dir(const char *name,
struct dentry *parent)
{