summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/ioctl.c')
-rw-r--r--fs/ext4/ioctl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c
index 15b1047878ab..ffb7bde4900d 100644
--- a/fs/ext4/ioctl.c
+++ b/fs/ext4/ioctl.c
@@ -1123,6 +1123,22 @@ resizefs_out:
1123 return 0; 1123 return 0;
1124 } 1124 }
1125 1125
1126 case EXT4_IOC_GETSTATE:
1127 {
1128 __u32 state = 0;
1129
1130 if (ext4_test_inode_state(inode, EXT4_STATE_EXT_PRECACHED))
1131 state |= EXT4_STATE_FLAG_EXT_PRECACHED;
1132 if (ext4_test_inode_state(inode, EXT4_STATE_NEW))
1133 state |= EXT4_STATE_FLAG_NEW;
1134 if (ext4_test_inode_state(inode, EXT4_STATE_NEWENTRY))
1135 state |= EXT4_STATE_FLAG_NEWENTRY;
1136 if (ext4_test_inode_state(inode, EXT4_STATE_DA_ALLOC_CLOSE))
1137 state |= EXT4_STATE_FLAG_DA_ALLOC_CLOSE;
1138
1139 return put_user(state, (__u32 __user *) arg);
1140 }
1141
1126 case EXT4_IOC_FSGETXATTR: 1142 case EXT4_IOC_FSGETXATTR:
1127 { 1143 {
1128 struct fsxattr fa; 1144 struct fsxattr fa;
@@ -1242,6 +1258,7 @@ long ext4_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1242 case EXT4_IOC_SHUTDOWN: 1258 case EXT4_IOC_SHUTDOWN:
1243 case FS_IOC_GETFSMAP: 1259 case FS_IOC_GETFSMAP:
1244 case EXT4_IOC_CLEAR_ES_CACHE: 1260 case EXT4_IOC_CLEAR_ES_CACHE:
1261 case EXT4_IOC_GETSTATE:
1245 break; 1262 break;
1246 default: 1263 default:
1247 return -ENOIOCTLCMD; 1264 return -ENOIOCTLCMD;