blob: 97faa5d6739891fc63f600d77f6187d0f8d4e24e [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001From 8f8cbc7b773da63bce8226249784ba6824635c9c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 7 Dec 2022 20:19:27 -0800
4Subject: [PATCH v3 3/3] internal.h: Make LFS mandatory for all usecases
5
6erosfs depend on the consistent use of a 64bit offset
7type, force downstreams to use transparent LFS (_FILE_OFFSET_BITS=64),
8so that it becomes impossible for them to use 32bit interfaces.
9
10Upstream-Status: Submitted [https://lore.kernel.org/linux-erofs/20221215064758.93821-3-raj.khem@gmail.com/T/#u]
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 include/erofs/internal.h | 5 +++++
14 1 file changed, 5 insertions(+)
15
16diff --git a/include/erofs/internal.h b/include/erofs/internal.h
17index 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--
402.39.0
41