lindebugfs: Add `debugfs_create_file_size()`
This is the same as `debugfs_create_file()` but takes the initial size of the file. In FreeBSD, the given size is ignored and `debugfs_create_file()` is called. Reviewed by: emaste, manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D37914
This commit is contained in:
parent
66cc55a041
commit
a04aa80e77
|
@ -213,6 +213,16 @@ debugfs_create_file(const char *name, umode_t mode,
|
||||||
return (dnode);
|
return (dnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 __unused)
|
||||||
|
{
|
||||||
|
|
||||||
|
return debugfs_create_file(name, mode, parent, data, fops);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NOTE: Files created with the _unsafe moniker will not be protected from
|
* NOTE: Files created with the _unsafe moniker will not be protected from
|
||||||
* debugfs core file removals. It is the responsibility of @fops to protect
|
* debugfs core file removals. It is the responsibility of @fops to protect
|
||||||
|
@ -228,6 +238,7 @@ debugfs_create_file_unsafe(const char *name, umode_t mode,
|
||||||
struct dentry *parent, void *data,
|
struct dentry *parent, void *data,
|
||||||
const struct file_operations *fops)
|
const struct file_operations *fops)
|
||||||
{
|
{
|
||||||
|
|
||||||
return (debugfs_create_file(name, mode, parent, data, fops));
|
return (debugfs_create_file(name, mode, parent, data, fops));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,14 @@ struct dentry *debugfs_create_file(const char *name, umode_t mode,
|
||||||
struct dentry *parent, void *data,
|
struct dentry *parent, void *data,
|
||||||
const struct file_operations *fops);
|
const struct file_operations *fops);
|
||||||
|
|
||||||
struct dentry *debugfs_create_file_unsafe(const char *name, umode_t mode,
|
/* TODO: We currently ignore the `file_size` argument. */
|
||||||
|
struct dentry *debugfs_create_file_size(const char *name, umode_t mode,
|
||||||
struct dentry *parent, void *data,
|
struct dentry *parent, void *data,
|
||||||
|
const struct file_operations *fops,
|
||||||
|
loff_t file_size);
|
||||||
|
|
||||||
|
struct dentry *debugfs_create_file_unsafe(const char *name, umode_t mode,
|
||||||
|
struct dentry *parent, void *data,
|
||||||
const struct file_operations *fops);
|
const struct file_operations *fops);
|
||||||
|
|
||||||
struct dentry *debugfs_create_mode_unsafe(const char *name, umode_t mode,
|
struct dentry *debugfs_create_mode_unsafe(const char *name, umode_t mode,
|
||||||
|
|
Loading…
Reference in New Issue