Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame^] | 1 | From 8f8cbc7b773da63bce8226249784ba6824635c9c Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Wed, 7 Dec 2022 20:19:27 -0800 |
| 4 | Subject: [PATCH v3 3/3] internal.h: Make LFS mandatory for all usecases |
| 5 | |
| 6 | erosfs depend on the consistent use of a 64bit offset |
| 7 | type, force downstreams to use transparent LFS (_FILE_OFFSET_BITS=64), |
| 8 | so that it becomes impossible for them to use 32bit interfaces. |
| 9 | |
| 10 | Upstream-Status: Submitted [https://lore.kernel.org/linux-erofs/20221215064758.93821-3-raj.khem@gmail.com/T/#u] |
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 12 | --- |
| 13 | include/erofs/internal.h | 5 +++++ |
| 14 | 1 file changed, 5 insertions(+) |
| 15 | |
| 16 | diff --git a/include/erofs/internal.h b/include/erofs/internal.h |
| 17 | index 6a70f11..d3b2986 100644 |
| 18 | --- a/include/erofs/internal.h |
| 19 | +++ b/include/erofs/internal.h |
| 20 | @@ -21,6 +21,7 @@ typedef unsigned short umode_t; |
| 21 | |
| 22 | #include "erofs_fs.h" |
| 23 | #include <fcntl.h> |
| 24 | +#include <sys/types.h> /* for off_t definition */ |
| 25 | |
| 26 | #ifndef PATH_MAX |
| 27 | #define PATH_MAX 4096 /* # chars in a path name including nul */ |
| 28 | @@ -104,6 +105,10 @@ struct erofs_sb_info { |
| 29 | }; |
| 30 | }; |
| 31 | |
| 32 | + |
| 33 | +/* make sure that any user of the erofs headers has atleast 64bit off_t type */ |
| 34 | +extern int erofs_assert_largefile[sizeof(off_t)-8]; |
| 35 | + |
| 36 | /* global sbi */ |
| 37 | extern struct erofs_sb_info sbi; |
| 38 | |
| 39 | -- |
| 40 | 2.39.0 |
| 41 | |