aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/fcntl.h
diff options
context:
space:
mode:
authorYury Norov <ynorov@caviumnetworks.com>2018-05-16 11:18:49 +0300
committerArnd Bergmann <arnd@arndb.de>2019-02-19 10:10:05 +0100
commit942fa985e9f161ac018ce2230d3e6f7668cca6ac (patch)
treec4f0d0fead0b4a0af0a1f6ecf87d8f79295b9485 /include/linux/fcntl.h
parentcompat ABI: use non-compat openat and open_by_handle_at variants (diff)
downloadwireguard-linux-942fa985e9f161ac018ce2230d3e6f7668cca6ac.tar.xz
wireguard-linux-942fa985e9f161ac018ce2230d3e6f7668cca6ac.zip
32-bit userspace ABI: introduce ARCH_32BIT_OFF_T config option
All new 32-bit architectures should have 64-bit userspace off_t type, but existing architectures has 32-bit ones. To enforce the rule, new config option is added to arch/Kconfig that defaults ARCH_32BIT_OFF_T to be disabled for new 32-bit architectures. All existing 32-bit architectures enable it explicitly. New option affects force_o_largefile() behaviour. Namely, if userspace off_t is 64-bits long, we have no reason to reject user to open big files. Note that even if architectures has only 64-bit off_t in the kernel (arc, c6x, h8300, hexagon, nios2, openrisc, and unicore32), a libc may use 32-bit off_t, and therefore want to limit the file size to 4GB unless specified differently in the open flags. Signed-off-by: Yury Norov <ynorov@caviumnetworks.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Yury Norov <ynorov@marvell.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/linux/fcntl.h')
-rw-r--r--include/linux/fcntl.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
index 27dc7a60693e..d019df946cb2 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -12,7 +12,7 @@
O_NOATIME | O_CLOEXEC | O_PATH | __O_TMPFILE)
#ifndef force_o_largefile
-#define force_o_largefile() (BITS_PER_LONG != 32)
+#define force_o_largefile() (!IS_ENABLED(CONFIG_ARCH_32BIT_OFF_T))
#endif
#if BITS_PER_LONG == 32