@@ -1808,6 +1808,7 @@ const struct file_operations ceph_dir_fops = {
.open = ceph_open,
.release = ceph_release,
.unlocked_ioctl = ceph_ioctl,
+ .compat_ioctl = ceph_compat_ioctl,
.fsync = ceph_fsync,
.lock = ceph_lock,
.flock = ceph_flock,
@@ -2138,7 +2138,7 @@ const struct file_operations ceph_file_fops = {
.splice_read = generic_file_splice_read,
.splice_write = iter_file_splice_write,
.unlocked_ioctl = ceph_ioctl,
- .compat_ioctl = ceph_ioctl,
+ .compat_ioctl = ceph_compat_ioctl,
.fallocate = ceph_fallocate,
.copy_file_range = ceph_copy_file_range,
};
@@ -6,6 +6,7 @@
#include <asm/unaligned.h>
#include <linux/backing-dev.h>
+#include <linux/compat.h>
#include <linux/completion.h>
#include <linux/exportfs.h>
#include <linux/fs.h>
@@ -1108,6 +1109,15 @@ extern void ceph_readdir_cache_release(struct ceph_readdir_cache_control *ctl);
/* ioctl.c */
extern long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
+static inline long
+ceph_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+{
+#ifdef CONFIG_COMPAT
+ return ceph_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
+#else
+ return -ENOTTY;
+#endif
+}
/* export.c */
extern const struct export_operations ceph_export_ops;