Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Arnd Bergmann <arnd@arndb.de>

+7 -2
-2
fs/compat_ioctl.c
··· 345 345 static unsigned int ioctl_pointer[] = { 346 346 /* Little t */ 347 347 COMPATIBLE_IOCTL(TIOCOUTQ) 348 - /* 'X' - originally XFS but some now in the VFS */ 349 - COMPATIBLE_IOCTL(FITRIM) 350 348 #ifdef CONFIG_BLOCK 351 349 /* Big S */ 352 350 COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN)
+1
fs/ecryptfs/file.c
··· 378 378 return rc; 379 379 380 380 switch (cmd) { 381 + case FITRIM: 381 382 case FS_IOC32_GETFLAGS: 382 383 case FS_IOC32_SETFLAGS: 383 384 case FS_IOC32_GETVERSION:
+1
fs/ext4/ioctl.c
··· 1360 1360 } 1361 1361 case EXT4_IOC_MOVE_EXT: 1362 1362 case EXT4_IOC_RESIZE_FS: 1363 + case FITRIM: 1363 1364 case EXT4_IOC_PRECACHE_EXTENTS: 1364 1365 case EXT4_IOC_SET_ENCRYPTION_POLICY: 1365 1366 case EXT4_IOC_GET_ENCRYPTION_PWSALT:
+1
fs/f2fs/file.c
··· 3403 3403 case F2FS_IOC_RELEASE_VOLATILE_WRITE: 3404 3404 case F2FS_IOC_ABORT_VOLATILE_WRITE: 3405 3405 case F2FS_IOC_SHUTDOWN: 3406 + case FITRIM: 3406 3407 case F2FS_IOC_SET_ENCRYPTION_POLICY: 3407 3408 case F2FS_IOC_GET_ENCRYPTION_PWSALT: 3408 3409 case F2FS_IOC_GET_ENCRYPTION_POLICY:
+1
fs/hpfs/dir.c
··· 325 325 .release = hpfs_dir_release, 326 326 .fsync = hpfs_file_fsync, 327 327 .unlocked_ioctl = hpfs_ioctl, 328 + .compat_ioctl = compat_ptr_ioctl, 328 329 };
+1
fs/hpfs/file.c
··· 215 215 .fsync = hpfs_file_fsync, 216 216 .splice_read = generic_file_splice_read, 217 217 .unlocked_ioctl = hpfs_ioctl, 218 + .compat_ioctl = compat_ptr_ioctl, 218 219 }; 219 220 220 221 const struct inode_operations hpfs_file_iops =
+1
fs/nilfs2/ioctl.c
··· 1354 1354 case NILFS_IOCTL_SYNC: 1355 1355 case NILFS_IOCTL_RESIZE: 1356 1356 case NILFS_IOCTL_SET_ALLOC_RANGE: 1357 + case FITRIM: 1357 1358 break; 1358 1359 default: 1359 1360 return -ENOIOCTLCMD;
+1
fs/ocfs2/ioctl.c
··· 985 985 return -EFAULT; 986 986 987 987 return ocfs2_info_handle(inode, &info, 1); 988 + case FITRIM: 988 989 case OCFS2_IOC_MOVE_EXT: 989 990 break; 990 991 default: