From: Miklos Szeredi Sprinkle a few comments on the not-so-trivial parts of the control filesystem. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton --- fs/fuse/control.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff -puN fs/fuse/control.c~fuse-add-control-filesystem-fuse-comment-control-filesystem fs/fuse/control.c --- a/fs/fuse/control.c~fuse-add-control-filesystem-fuse-comment-control-filesystem +++ a/fs/fuse/control.c @@ -13,6 +13,10 @@ #define FUSE_CTL_SUPER_MAGIC 0x65735543 +/* + * This is non-NULL when the single instance of the control filesystem + * exists. Protected by fuse_mutex + */ static struct super_block *fuse_control_sb; static struct fuse_conn *fuse_ctl_file_conn_get(struct file *file) @@ -89,6 +93,7 @@ static struct dentry *fuse_ctl_add_dentr inode->i_uid = fc->user_id; inode->i_gid = fc->group_id; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + /* setting ->i_op to NULL is not allowed */ if (iop) inode->i_op = iop; inode->i_fop = fop; @@ -98,6 +103,10 @@ static struct dentry *fuse_ctl_add_dentr return dentry; } +/* + * Add a connection to the control filesystem (if it exists). Caller + * must host fuse_mutex + */ int fuse_ctl_add_conn(struct fuse_conn *fc) { struct dentry *parent; @@ -128,6 +137,10 @@ int fuse_ctl_add_conn(struct fuse_conn * return -ENOMEM; } +/* + * Remove a connection from the control filesystem (if it exists). + * Caller must host fuse_mutex + */ void fuse_ctl_remove_conn(struct fuse_conn *fc) { int i; _