Commit 6a7fed4e authored by Tejun Heo's avatar Tejun Heo Committed by Greg Kroah-Hartman

kernfs: implement kernfs_syscall_ops->remount_fs() and ->show_options()

Add two super_block related syscall callbacks ->remount_fs() and
->show_options() to kernfs_syscall_ops.  These simply forward the
matching super_operations.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 90c07c89
...@@ -19,10 +19,33 @@ ...@@ -19,10 +19,33 @@
struct kmem_cache *kernfs_node_cache; struct kmem_cache *kernfs_node_cache;
static int kernfs_sop_remount_fs(struct super_block *sb, int *flags, char *data)
{
struct kernfs_root *root = kernfs_info(sb)->root;
struct kernfs_syscall_ops *scops = root->syscall_ops;
if (scops && scops->remount_fs)
return scops->remount_fs(root, flags, data);
return 0;
}
static int kernfs_sop_show_options(struct seq_file *sf, struct dentry *dentry)
{
struct kernfs_root *root = kernfs_root(dentry->d_fsdata);
struct kernfs_syscall_ops *scops = root->syscall_ops;
if (scops && scops->show_options)
return scops->show_options(sf, root);
return 0;
}
static const struct super_operations kernfs_sops = { static const struct super_operations kernfs_sops = {
.statfs = simple_statfs, .statfs = simple_statfs,
.drop_inode = generic_delete_inode, .drop_inode = generic_delete_inode,
.evict_inode = kernfs_evict_inode, .evict_inode = kernfs_evict_inode,
.remount_fs = kernfs_sop_remount_fs,
.show_options = kernfs_sop_show_options,
}; };
static int kernfs_fill_super(struct super_block *sb) static int kernfs_fill_super(struct super_block *sb)
......
...@@ -115,6 +115,9 @@ struct kernfs_node { ...@@ -115,6 +115,9 @@ struct kernfs_node {
* kernfs_node parameter. * kernfs_node parameter.
*/ */
struct kernfs_syscall_ops { struct kernfs_syscall_ops {
int (*remount_fs)(struct kernfs_root *root, int *flags, char *data);
int (*show_options)(struct seq_file *sf, struct kernfs_root *root);
int (*mkdir)(struct kernfs_node *parent, const char *name, int (*mkdir)(struct kernfs_node *parent, const char *name,
umode_t mode); umode_t mode);
int (*rmdir)(struct kernfs_node *kn); int (*rmdir)(struct kernfs_node *kn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment