Skip to content

Commit 9abea2d

Browse files
mikulas-patockatorvalds
authored andcommitted
ioctl_compat: handle FITRIM
The FITRIM ioctl has the same arguments on 32-bit and 64-bit architectures, so we can add it to the list of compatible ioctls and drop it from compat_ioctl method of various filesystems. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Ted Ts'o <tytso@google.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 6f95772 commit 9abea2d

6 files changed

Lines changed: 1 addition & 7 deletions

File tree

‎fs/compat_ioctl.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,7 @@ COMPATIBLE_IOCTL(FIGETBSZ)
896896
/* 'X' - originally XFS but some now in the VFS */
897897
COMPATIBLE_IOCTL(FIFREEZE)
898898
COMPATIBLE_IOCTL(FITHAW)
899+
COMPATIBLE_IOCTL(FITRIM)
899900
COMPATIBLE_IOCTL(KDGETKEYCODE)
900901
COMPATIBLE_IOCTL(KDSETKEYCODE)
901902
COMPATIBLE_IOCTL(KDGKBTYPE)

‎fs/ecryptfs/file.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
325325
return rc;
326326

327327
switch (cmd) {
328-
case FITRIM:
329328
case FS_IOC32_GETFLAGS:
330329
case FS_IOC32_SETFLAGS:
331330
case FS_IOC32_GETVERSION:

‎fs/ext4/ioctl.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,6 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
755755
return err;
756756
}
757757
case EXT4_IOC_MOVE_EXT:
758-
case FITRIM:
759758
case EXT4_IOC_RESIZE_FS:
760759
case EXT4_IOC_PRECACHE_EXTENTS:
761760
case EXT4_IOC_SET_ENCRYPTION_POLICY:

‎fs/jfs/ioctl.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ long jfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
180180
case JFS_IOC_SETFLAGS32:
181181
cmd = JFS_IOC_SETFLAGS;
182182
break;
183-
case FITRIM:
184-
cmd = FITRIM;
185-
break;
186183
}
187184
return jfs_ioctl(filp, cmd, arg);
188185
}

‎fs/nilfs2/ioctl.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,6 @@ long nilfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
13691369
case NILFS_IOCTL_SYNC:
13701370
case NILFS_IOCTL_RESIZE:
13711371
case NILFS_IOCTL_SET_ALLOC_RANGE:
1372-
case FITRIM:
13731372
break;
13741373
default:
13751374
return -ENOIOCTLCMD;

‎fs/ocfs2/ioctl.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,6 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
980980
case OCFS2_IOC_GROUP_EXTEND:
981981
case OCFS2_IOC_GROUP_ADD:
982982
case OCFS2_IOC_GROUP_ADD64:
983-
case FITRIM:
984983
break;
985984
case OCFS2_IOC_REFLINK:
986985
if (copy_from_user(&args, argp, sizeof(args)))

0 commit comments

Comments
 (0)