diff options
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 9f63e493a9b6..344577933f62 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -1182,6 +1182,30 @@ static int fuse_dir_fsync(struct file *file, loff_t start, loff_t end, | |||
1182 | return fuse_fsync_common(file, start, end, datasync, 1); | 1182 | return fuse_fsync_common(file, start, end, datasync, 1); |
1183 | } | 1183 | } |
1184 | 1184 | ||
1185 | static long fuse_dir_ioctl(struct file *file, unsigned int cmd, | ||
1186 | unsigned long arg) | ||
1187 | { | ||
1188 | struct fuse_conn *fc = get_fuse_conn(file->f_mapping->host); | ||
1189 | |||
1190 | /* FUSE_IOCTL_DIR only supported for API version >= 7.18 */ | ||
1191 | if (fc->minor < 18) | ||
1192 | return -ENOTTY; | ||
1193 | |||
1194 | return fuse_ioctl_common(file, cmd, arg, FUSE_IOCTL_DIR); | ||
1195 | } | ||
1196 | |||
1197 | static long fuse_dir_compat_ioctl(struct file *file, unsigned int cmd, | ||
1198 | unsigned long arg) | ||
1199 | { | ||
1200 | struct fuse_conn *fc = get_fuse_conn(file->f_mapping->host); | ||
1201 | |||
1202 | if (fc->minor < 18) | ||
1203 | return -ENOTTY; | ||
1204 | |||
1205 | return fuse_ioctl_common(file, cmd, arg, | ||
1206 | FUSE_IOCTL_COMPAT | FUSE_IOCTL_DIR); | ||
1207 | } | ||
1208 | |||
1185 | static bool update_mtime(unsigned ivalid) | 1209 | static bool update_mtime(unsigned ivalid) |
1186 | { | 1210 | { |
1187 | /* Always update if mtime is explicitly set */ | 1211 | /* Always update if mtime is explicitly set */ |
@@ -1596,6 +1620,8 @@ static const struct file_operations fuse_dir_operations = { | |||
1596 | .open = fuse_dir_open, | 1620 | .open = fuse_dir_open, |
1597 | .release = fuse_dir_release, | 1621 | .release = fuse_dir_release, |
1598 | .fsync = fuse_dir_fsync, | 1622 | .fsync = fuse_dir_fsync, |
1623 | .unlocked_ioctl = fuse_dir_ioctl, | ||
1624 | .compat_ioctl = fuse_dir_compat_ioctl, | ||
1599 | }; | 1625 | }; |
1600 | 1626 | ||
1601 | static const struct inode_operations fuse_common_inode_operations = { | 1627 | static const struct inode_operations fuse_common_inode_operations = { |