diff options
author | Brian Behlendorf <[email protected]> | 2013-06-26 12:53:04 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-06-26 15:20:13 -0700 |
commit | 88c283952f0bfeab54612f9ce666601d83c4244f (patch) | |
tree | 6106c5f99056e834ddcf229858d41d03e50780d2 /module/zfs/zpl_file.c | |
parent | 0c1171dcb5c50f3a03c60f4346209c23a2b5ef86 (diff) |
Return -EOPNOTSUPP for ZFS_IOC_{GET|SET}FLAGS
Until these hooks are fully implemented return the expected
-EOPNOTSUPP error to indicate they are not functional. This
allows test suites such as xfstests to cleanly skip testing
this functionality until it's implemented.
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #229
Diffstat (limited to 'module/zfs/zpl_file.c')
-rw-r--r-- | module/zfs/zpl_file.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c index db6a72c98..c6d97db50 100644 --- a/module/zfs/zpl_file.c +++ b/module/zfs/zpl_file.c @@ -433,6 +433,27 @@ zpl_fallocate(struct file *filp, int mode, loff_t offset, loff_t len) } #endif /* HAVE_FILE_FALLOCATE */ +static long +zpl_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +{ + switch (cmd) { + case ZFS_IOC_GETFLAGS: + case ZFS_IOC_SETFLAGS: + return (-EOPNOTSUPP); + default: + return (-ENOTTY); + } +} + +#ifdef CONFIG_COMPAT +static long +zpl_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +{ + return zpl_ioctl(filp, cmd, arg); +} +#endif /* CONFIG_COMPAT */ + + const struct address_space_operations zpl_address_space_operations = { .readpages = zpl_readpages, .readpage = zpl_readpage, @@ -451,6 +472,10 @@ const struct file_operations zpl_file_operations = { #ifdef HAVE_FILE_FALLOCATE .fallocate = zpl_fallocate, #endif /* HAVE_FILE_FALLOCATE */ + .unlocked_ioctl = zpl_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = zpl_compat_ioctl, +#endif }; const struct file_operations zpl_dir_file_operations = { @@ -458,4 +483,8 @@ const struct file_operations zpl_dir_file_operations = { .read = generic_read_dir, .readdir = zpl_readdir, .fsync = zpl_fsync, + .unlocked_ioctl = zpl_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = zpl_compat_ioctl, +#endif }; |