diff options
Diffstat (limited to 'fs/fuse/control.c')
| -rw-r--r-- | fs/fuse/control.c | 21 | 
1 files changed, 8 insertions, 13 deletions
diff --git a/fs/fuse/control.c b/fs/fuse/control.c index 85542a7daf4..205e0d5d530 100644 --- a/fs/fuse/control.c +++ b/fs/fuse/control.c @@ -23,7 +23,7 @@ static struct fuse_conn *fuse_ctl_file_conn_get(struct file *file)  {  	struct fuse_conn *fc;  	mutex_lock(&fuse_mutex); -	fc = file->f_path.dentry->d_inode->i_private; +	fc = file_inode(file)->i_private;  	if (fc)  		fc = fuse_conn_get(fc);  	mutex_unlock(&fuse_mutex); @@ -75,19 +75,13 @@ static ssize_t fuse_conn_limit_write(struct file *file, const char __user *buf,  				     unsigned global_limit)  {  	unsigned long t; -	char tmp[32];  	unsigned limit = (1 << 16) - 1;  	int err; -	if (*ppos || count >= sizeof(tmp) - 1) -		return -EINVAL; - -	if (copy_from_user(tmp, buf, count)) +	if (*ppos)  		return -EINVAL; -	tmp[count] = '\0'; - -	err = strict_strtoul(tmp, 0, &t); +	err = kstrtoul_from_user(buf, count, 0, &t);  	if (err)  		return err; @@ -123,7 +117,7 @@ static ssize_t fuse_conn_max_background_write(struct file *file,  					      const char __user *buf,  					      size_t count, loff_t *ppos)  { -	unsigned val; +	unsigned uninitialized_var(val);  	ssize_t ret;  	ret = fuse_conn_limit_write(file, buf, count, ppos, &val, @@ -160,7 +154,7 @@ static ssize_t fuse_conn_congestion_threshold_write(struct file *file,  						    const char __user *buf,  						    size_t count, loff_t *ppos)  { -	unsigned val; +	unsigned uninitialized_var(val);  	ssize_t ret;  	ret = fuse_conn_limit_write(file, buf, count, ppos, &val, @@ -231,7 +225,7 @@ static struct dentry *fuse_ctl_add_dentry(struct dentry *parent,  	if (iop)  		inode->i_op = iop;  	inode->i_fop = fop; -	inode->i_nlink = nlink; +	set_nlink(inode, nlink);  	inode->i_private = fc;  	d_add(dentry, inode);  	return dentry; @@ -347,13 +341,14 @@ static struct file_system_type fuse_ctl_fs_type = {  	.mount		= fuse_ctl_mount,  	.kill_sb	= fuse_ctl_kill_sb,  }; +MODULE_ALIAS_FS("fusectl");  int __init fuse_ctl_init(void)  {  	return register_filesystem(&fuse_ctl_fs_type);  } -void fuse_ctl_cleanup(void) +void __exit fuse_ctl_cleanup(void)  {  	unregister_filesystem(&fuse_ctl_fs_type);  }  | 
