@@ -80,9 +80,15 @@ enum {
#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(AUTOFS_IOCTL, \
AUTOFS_IOC_SETTIMEOUT_CMD, \
compat_ulong_t)
+#if __riscv_xlen == 64
+#define AUTOFS_IOC_SETTIMEOUT _IOWR(AUTOFS_IOCTL, \
+ AUTOFS_IOC_SETTIMEOUT_CMD, \
+ unsigned long long)
+#else
#define AUTOFS_IOC_SETTIMEOUT _IOWR(AUTOFS_IOCTL, \
AUTOFS_IOC_SETTIMEOUT_CMD, \
unsigned long)
+#endif
#define AUTOFS_IOC_EXPIRE _IOR(AUTOFS_IOCTL, \
AUTOFS_IOC_EXPIRE_CMD, \
struct autofs_packet_expire)
@@ -203,11 +203,17 @@ long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask,
return -EFAULT;
while (nr_compat_longs > 1) {
- compat_ulong_t l1, l2;
+ compat_ulong_t l1;
unsafe_get_user(l1, umask++, Efault);
+ nr_compat_longs -= 1;
+#if BITS_PER_LONG == 64
+ compat_ulong_t l2;
unsafe_get_user(l2, umask++, Efault);
*mask++ = ((unsigned long)l2 << BITS_PER_COMPAT_LONG) | l1;
- nr_compat_longs -= 2;
+ nr_compat_longs -= 1;
+#else
+ *mask++ = l1;
+#endif
}
if (nr_compat_longs)
unsafe_get_user(*mask, umask++, Efault);
@@ -234,8 +240,11 @@ long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
while (nr_compat_longs > 1) {
unsigned long m = *mask++;
unsafe_put_user((compat_ulong_t)m, umask++, Efault);
+ nr_compat_longs -= 1;
+#if BITS_PER_LONG == 64
unsafe_put_user(m >> BITS_PER_COMPAT_LONG, umask++, Efault);
- nr_compat_longs -= 2;
+ nr_compat_longs -= 1;
+#endif
}
if (nr_compat_longs)
unsafe_put_user((compat_ulong_t)*mask, umask++, Efault);