Skip to content

Commit 33ddd64

Browse files
norovRondom
authored andcommitted
32-bit ABI: introduce ARCH_32BIT_OFF_T config option
All new 32-bit architectures should have 64-bit off_t type, but existing architectures has 32-bit ones. To handle it, new config option is added to arch/Kconfig that defaults ARCH_32BIT_OFF_T to be disabled for non-64 bit architectures. All existing 32-bit architectures enable it explicitly here. New option affects force_o_largefile() behaviour. Namely, if 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, metag, nios2, openrisc, tile32 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>
1 parent ddc34f7 commit 33ddd64

27 files changed

Lines changed: 30 additions & 1 deletion

File tree

arch/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ config ARCH_THREAD_STACK_ALLOCATOR
238238
config ARCH_WANTS_DYNAMIC_TASK_STRUCT
239239
bool
240240

241+
config ARCH_32BIT_OFF_T
242+
bool
243+
depends on !64BIT
244+
241245
config HAVE_REGS_AND_STACK_ACCESS_API
242246
bool
243247
help

arch/arc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ config ARC
1111
select ARC_TIMERS
1212
select ARCH_HAS_SG_CHAIN
1313
select ARCH_SUPPORTS_ATOMIC_RMW if ARC_HAS_LLSC
14+
select ARCH_32BIT_OFF_T
1415
select BUILDTIME_EXTABLE_SORT
1516
select CLONE_BACKWARDS
1617
select COMMON_CLK

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config ARM
22
bool
33
default y
4+
select ARCH_32BIT_OFF_T
45
select ARCH_CLOCKSOURCE_DATA
56
select ARCH_HAS_DEVMEM_IS_ALLOWED
67
select ARCH_HAS_ELF_RANDOMIZE

arch/blackfin/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ config RWSEM_XCHGADD_ALGORITHM
1212

1313
config BLACKFIN
1414
def_bool y
15+
select ARCH_32BIT_OFF_T
1516
select HAVE_ARCH_KGDB
1617
select HAVE_ARCH_TRACEHOOK
1718
select HAVE_DYNAMIC_FTRACE

arch/cris/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ config LOCKDEP_SUPPORT
5050
config CRIS
5151
bool
5252
default y
53+
select ARCH_32BIT_OFF_T
5354
select HAVE_IDE
5455
select GENERIC_ATOMIC64
5556
select HAVE_UID16

arch/frv/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config FRV
22
bool
33
default y
4+
select ARCH_32BIT_OFF_T
45
select HAVE_IDE
56
select HAVE_ARCH_TRACEHOOK
67
select HAVE_PERF_EVENTS

arch/h8300/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
config H8300
22
def_bool y
3+
select ARCH_32BIT_OFF_T
34
select GENERIC_ATOMIC64
45
select HAVE_UID16
56
select VIRT_TO_BUS

arch/hexagon/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ comment "Linux Kernel Configuration for Hexagon"
33

44
config HEXAGON
55
def_bool y
6+
select ARCH_32BIT_OFF_T
67
select HAVE_OPROFILE
78
# Other pending projects/to-do items.
89
# select HAVE_REGS_AND_STACK_ACCESS_API

arch/m32r/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config M32R
22
bool
33
default y
4+
select ARCH_32BIT_OFF_T
45
select HAVE_IDE
56
select HAVE_OPROFILE
67
select INIT_ALL_POSSIBLE

arch/m68k/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
config M68K
22
bool
33
default y
4+
select ARCH_32BIT_OFF_T
45
select ARCH_MIGHT_HAVE_PC_PARPORT if ISA
56
select HAVE_IDE
67
select HAVE_AOUT if MMU

0 commit comments

Comments
 (0)