aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 7feeec6f7c39..9f5468fb06da 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3541,6 +3541,48 @@ static int ext4_get_sb(struct file_system_type *fs_type,
3541 return get_sb_bdev(fs_type, flags, dev_name, data, ext4_fill_super, mnt); 3541 return get_sb_bdev(fs_type, flags, dev_name, data, ext4_fill_super, mnt);
3542} 3542}
3543 3543
3544#ifdef CONFIG_PROC_FS
3545static int ext4_ui_proc_show(struct seq_file *m, void *v)
3546{
3547 unsigned int *p = m->private;
3548
3549 seq_printf(m, "%u\n", *p);
3550 return 0;
3551}
3552
3553static int ext4_ui_proc_open(struct inode *inode, struct file *file)
3554{
3555 return single_open(file, ext4_ui_proc_show, PDE(inode)->data);
3556}
3557
3558static ssize_t ext4_ui_proc_write(struct file *file, const char __user *buf,
3559 size_t cnt, loff_t *ppos)
3560{
3561 unsigned int *p = PDE(file->f_path.dentry->d_inode)->data;
3562 char str[32];
3563 unsigned long value;
3564
3565 if (cnt >= sizeof(str))
3566 return -EINVAL;
3567 if (copy_from_user(str, buf, cnt))
3568 return -EFAULT;
3569 value = simple_strtol(str, NULL, 0);
3570 if (value < 0)
3571 return -ERANGE;
3572 *p = value;
3573 return cnt;
3574}
3575
3576const struct file_operations ext4_ui_proc_fops = {
3577 .owner = THIS_MODULE,
3578 .open = ext4_ui_proc_open,
3579 .read = seq_read,
3580 .llseek = seq_lseek,
3581 .release = single_release,
3582 .write = ext4_ui_proc_write,
3583};
3584#endif
3585
3544static struct file_system_type ext4dev_fs_type = { 3586static struct file_system_type ext4dev_fs_type = {
3545 .owner = THIS_MODULE, 3587 .owner = THIS_MODULE,
3546 .name = "ext4dev", 3588 .name = "ext4dev",