summaryrefslogtreecommitdiff
path: root/fs/ext4/ioctl.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2019-08-11 16:30:41 -0400
committerTheodore Ts'o <tytso@mit.edu>2019-08-11 16:30:41 -0400
commitb0c013e2928d3696ceb6401311dbc1d7fcccd6dd (patch)
tree673e10bc5de72eab8f375f913df207ccf6a3afea /fs/ext4/ioctl.c
parent547b9ad698b434eadca46319cb47e5875b55ef03 (diff)
ext4: add a new ioctl EXT4_IOC_CLEAR_ES_CACHE
The new ioctl EXT4_IOC_CLEAR_ES_CACHE will force an inode's extent status cache to be cleared out. This is intended for use for debugging. Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ioctl.c')
-rw-r--r--fs/ext4/ioctl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 442f7ef873fc..15b1047878ab 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -1115,6 +1115,14 @@ resizefs_out:
case EXT4_IOC_GET_ENCRYPTION_POLICY:
return fscrypt_ioctl_get_policy(filp, (void __user *)arg);
+ case EXT4_IOC_CLEAR_ES_CACHE:
+ {
+ if (!inode_owner_or_capable(inode))
+ return -EACCES;
+ ext4_clear_inode_es(inode);
+ return 0;
+ }
+
case EXT4_IOC_FSGETXATTR:
{
struct fsxattr fa;
@@ -1233,6 +1241,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case EXT4_IOC_GET_ENCRYPTION_POLICY:
case EXT4_IOC_SHUTDOWN:
case FS_IOC_GETFSMAP:
+ case EXT4_IOC_CLEAR_ES_CACHE:
break;
default:
return -ENOIOCTLCMD;