aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-12-02 06:36:08 -0500
committerChris Mason <chris.mason@oracle.com>2008-12-02 06:36:08 -0500
commit4bcabaa30a63a156fc50026f972377dada66452c (patch)
tree4f6575aca5209748a716eeac2c3fb0bb0263daa5
parent97288f2c71e46965a2010baea10548fcb5f3af73 (diff)
Btrfs: clean up btrfs_ioctl a little bit
Provide a void __user *argp pointer so that we can avoid duplicating the cast for various sub-command calls. Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--fs/btrfs/ioctl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index cc7c5161e269..d2d5a5a9b026 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1117,20 +1117,21 @@ long btrfs_ioctl(struct file *file, unsigned int
1117 cmd, unsigned long arg) 1117 cmd, unsigned long arg)
1118{ 1118{
1119 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 1119 struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root;
1120 void __user *argp = (void __user *)arg;
1120 1121
1121 switch (cmd) { 1122 switch (cmd) {
1122 case BTRFS_IOC_SNAP_CREATE: 1123 case BTRFS_IOC_SNAP_CREATE:
1123 return btrfs_ioctl_snap_create(file, (void __user *)arg, 0); 1124 return btrfs_ioctl_snap_create(file, argp, 0);
1124 case BTRFS_IOC_SUBVOL_CREATE: 1125 case BTRFS_IOC_SUBVOL_CREATE:
1125 return btrfs_ioctl_snap_create(file, (void __user *)arg, 1); 1126 return btrfs_ioctl_snap_create(file, argp, 1);
1126 case BTRFS_IOC_DEFRAG: 1127 case BTRFS_IOC_DEFRAG:
1127 return btrfs_ioctl_defrag(file); 1128 return btrfs_ioctl_defrag(file);
1128 case BTRFS_IOC_RESIZE: 1129 case BTRFS_IOC_RESIZE:
1129 return btrfs_ioctl_resize(root, (void __user *)arg); 1130 return btrfs_ioctl_resize(root, argp);
1130 case BTRFS_IOC_ADD_DEV: 1131 case BTRFS_IOC_ADD_DEV:
1131 return btrfs_ioctl_add_dev(root, (void __user *)arg); 1132 return btrfs_ioctl_add_dev(root, argp);
1132 case BTRFS_IOC_RM_DEV: 1133 case BTRFS_IOC_RM_DEV:
1133 return btrfs_ioctl_rm_dev(root, (void __user *)arg); 1134 return btrfs_ioctl_rm_dev(root, argp);
1134 case BTRFS_IOC_BALANCE: 1135 case BTRFS_IOC_BALANCE:
1135 return btrfs_balance(root->fs_info->dev_root); 1136 return btrfs_balance(root->fs_info->dev_root);
1136 case BTRFS_IOC_CLONE: 1137 case BTRFS_IOC_CLONE: