Commit 314999dc authored by Arnd Bergmann's avatar Arnd Bergmann

fs: compat_ioctl: move FITRIM emulation into file systems

Remove the special case for FITRIM, and make file systems
handle that like all other ioctl commands with their own
handlers.

Cc: linux-ext4@vger.kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
Cc: linux-nilfs@vger.kernel.org
Cc: ocfs2-devel@oss.oracle.com
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 8d098070
...@@ -345,8 +345,6 @@ static int ppp_scompress(struct file *file, unsigned int cmd, ...@@ -345,8 +345,6 @@ static int ppp_scompress(struct file *file, unsigned int cmd,
static unsigned int ioctl_pointer[] = { static unsigned int ioctl_pointer[] = {
/* Little t */ /* Little t */
COMPATIBLE_IOCTL(TIOCOUTQ) COMPATIBLE_IOCTL(TIOCOUTQ)
/* 'X' - originally XFS but some now in the VFS */
COMPATIBLE_IOCTL(FITRIM)
#ifdef CONFIG_BLOCK #ifdef CONFIG_BLOCK
/* Big S */ /* Big S */
COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN) COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN)
......
...@@ -378,6 +378,7 @@ ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -378,6 +378,7 @@ ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return rc; return rc;
switch (cmd) { switch (cmd) {
case FITRIM:
case FS_IOC32_GETFLAGS: case FS_IOC32_GETFLAGS:
case FS_IOC32_SETFLAGS: case FS_IOC32_SETFLAGS:
case FS_IOC32_GETVERSION: case FS_IOC32_GETVERSION:
......
...@@ -1360,6 +1360,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -1360,6 +1360,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
} }
case EXT4_IOC_MOVE_EXT: case EXT4_IOC_MOVE_EXT:
case EXT4_IOC_RESIZE_FS: case EXT4_IOC_RESIZE_FS:
case FITRIM:
case EXT4_IOC_PRECACHE_EXTENTS: case EXT4_IOC_PRECACHE_EXTENTS:
case EXT4_IOC_SET_ENCRYPTION_POLICY: case EXT4_IOC_SET_ENCRYPTION_POLICY:
case EXT4_IOC_GET_ENCRYPTION_PWSALT: case EXT4_IOC_GET_ENCRYPTION_PWSALT:
......
...@@ -3403,6 +3403,7 @@ long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -3403,6 +3403,7 @@ long f2fs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case F2FS_IOC_RELEASE_VOLATILE_WRITE: case F2FS_IOC_RELEASE_VOLATILE_WRITE:
case F2FS_IOC_ABORT_VOLATILE_WRITE: case F2FS_IOC_ABORT_VOLATILE_WRITE:
case F2FS_IOC_SHUTDOWN: case F2FS_IOC_SHUTDOWN:
case FITRIM:
case F2FS_IOC_SET_ENCRYPTION_POLICY: case F2FS_IOC_SET_ENCRYPTION_POLICY:
case F2FS_IOC_GET_ENCRYPTION_PWSALT: case F2FS_IOC_GET_ENCRYPTION_PWSALT:
case F2FS_IOC_GET_ENCRYPTION_POLICY: case F2FS_IOC_GET_ENCRYPTION_POLICY:
......
...@@ -325,4 +325,5 @@ const struct file_operations hpfs_dir_ops = ...@@ -325,4 +325,5 @@ const struct file_operations hpfs_dir_ops =
.release = hpfs_dir_release, .release = hpfs_dir_release,
.fsync = hpfs_file_fsync, .fsync = hpfs_file_fsync,
.unlocked_ioctl = hpfs_ioctl, .unlocked_ioctl = hpfs_ioctl,
.compat_ioctl = compat_ptr_ioctl,
}; };
...@@ -215,6 +215,7 @@ const struct file_operations hpfs_file_ops = ...@@ -215,6 +215,7 @@ const struct file_operations hpfs_file_ops =
.fsync = hpfs_file_fsync, .fsync = hpfs_file_fsync,
.splice_read = generic_file_splice_read, .splice_read = generic_file_splice_read,
.unlocked_ioctl = hpfs_ioctl, .unlocked_ioctl = hpfs_ioctl,
.compat_ioctl = compat_ptr_ioctl,
}; };
const struct inode_operations hpfs_file_iops = const struct inode_operations hpfs_file_iops =
......
...@@ -1354,6 +1354,7 @@ long nilfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -1354,6 +1354,7 @@ long nilfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
case NILFS_IOCTL_SYNC: case NILFS_IOCTL_SYNC:
case NILFS_IOCTL_RESIZE: case NILFS_IOCTL_RESIZE:
case NILFS_IOCTL_SET_ALLOC_RANGE: case NILFS_IOCTL_SET_ALLOC_RANGE:
case FITRIM:
break; break;
default: default:
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
......
...@@ -985,6 +985,7 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg) ...@@ -985,6 +985,7 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
return -EFAULT; return -EFAULT;
return ocfs2_info_handle(inode, &info, 1); return ocfs2_info_handle(inode, &info, 1);
case FITRIM:
case OCFS2_IOC_MOVE_EXT: case OCFS2_IOC_MOVE_EXT:
break; break;
default: default:
......
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