History

uapi: simplify __ARCH_FLOCK{,64}_PAD a little

Don't bother to define the symbols empty, just don't use them. That makes the intent a little more clear. Remove the unused HAVE_ARCH_STRUCT_FLOCK64 define and merge the 32-bit mips struct flock into the generic one. Add a new __ARCH_FLOCK_EXTRA_SYSID macro following the style of __ARCH_FLOCK_PAD to avoid having a separate definition just for one architecture.

Christoph Hellwig committed 4 years ago

Commit 9f79b8b1 parent 31231093 files · +17 −47Browse files

Unified · Split

3 files
  1. arch/mips/include/uapi/asm/fcntl.h +3 −23
  2. include/uapi/asm-generic/fcntl.h +7 −12
  3. tools/include/uapi/asm-generic/fcntl.h +7 −12
arch/mips/include/uapi/asm/fcntl.h+3−23
@@ -50,30 +50,10 @@ · 49 unmodified lines
5050 #define F_SETLKW64 35
5151 #endif
5252
53−/*
54− * The flavours of struct flock. "struct flock" is the ABI compliant
55− * variant. Finally struct flock64 is the LFS variant of struct flock. As
56− * a historic accident and inconsistence with the ABI definition it doesn't
57− * contain all the same fields as struct flock.
58− */
59−
6053 #if _MIPS_SIM != _MIPS_SIM_ABI64
61−
62−#include <linux/types.h>
63−
64−struct flock {
65− short l_type;
66− short l_whence;
67− __kernel_off_t l_start;
68− __kernel_off_t l_len;
69− long l_sysid;
70− __kernel_pid_t l_pid;
71− long pad[4];
72−};
73−
74−#define HAVE_ARCH_STRUCT_FLOCK
75−
76−#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
54+#define __ARCH_FLOCK_EXTRA_SYSID long l_sysid;
55+#define __ARCH_FLOCK_PAD long pad[4];
56+#endif
7757
7858 #include <asm-generic/fcntl.h>
7959
include/uapi/asm-generic/fcntl.h+7−12
@@ -192,25 +192,19 @@ struct f_owner_ex { · 191 unmodified lines
192192
193193 #define F_LINUX_SPECIFIC_BASE 1024
194194
195−#ifndef HAVE_ARCH_STRUCT_FLOCK
196−#ifndef __ARCH_FLOCK_PAD
197−#define __ARCH_FLOCK_PAD
198−#endif
199−
200195 struct flock {
201196 short l_type;
202197 short l_whence;
203198 __kernel_off_t l_start;
204199 __kernel_off_t l_len;
205200 __kernel_pid_t l_pid;
206− __ARCH_FLOCK_PAD
207−};
201+#ifdef __ARCH_FLOCK_EXTRA_SYSID
202+ __ARCH_FLOCK_EXTRA_SYSID
208203 #endif
209−
210−#ifndef HAVE_ARCH_STRUCT_FLOCK64
211−#ifndef __ARCH_FLOCK64_PAD
212−#define __ARCH_FLOCK64_PAD
204+#ifdef __ARCH_FLOCK_PAD
205+ __ARCH_FLOCK_PAD
213206 #endif
207+};
214208
215209 struct flock64 {
216210 short l_type;
@@ -218,8 +212,9 @@ struct flock64 { · 1 unmodified line
218212 __kernel_loff_t l_start;
219213 __kernel_loff_t l_len;
220214 __kernel_pid_t l_pid;
215+#ifdef __ARCH_FLOCK64_PAD
221216 __ARCH_FLOCK64_PAD
222−};
223217 #endif
218+};
224219
225220 #endif /* _ASM_GENERIC_FCNTL_H */
tools/include/uapi/asm-generic/fcntl.h+7−12
@@ -187,25 +187,19 @@ struct f_owner_ex { · 186 unmodified lines
187187
188188 #define F_LINUX_SPECIFIC_BASE 1024
189189
190−#ifndef HAVE_ARCH_STRUCT_FLOCK
191−#ifndef __ARCH_FLOCK_PAD
192−#define __ARCH_FLOCK_PAD
193−#endif
194−
195190 struct flock {
196191 short l_type;
197192 short l_whence;
198193 __kernel_off_t l_start;
199194 __kernel_off_t l_len;
200195 __kernel_pid_t l_pid;
201− __ARCH_FLOCK_PAD
202−};
196+#ifdef __ARCH_FLOCK_EXTRA_SYSID
197+ __ARCH_FLOCK_EXTRA_SYSID
203198 #endif
204−
205−#ifndef HAVE_ARCH_STRUCT_FLOCK64
206−#ifndef __ARCH_FLOCK64_PAD
207−#define __ARCH_FLOCK64_PAD
199+#ifdef __ARCH_FLOCK_PAD
200+ __ARCH_FLOCK_PAD
208201 #endif
202+};
209203
210204 struct flock64 {
211205 short l_type;
@@ -213,8 +207,9 @@ struct flock64 { · 1 unmodified line
213207 __kernel_loff_t l_start;
214208 __kernel_loff_t l_len;
215209 __kernel_pid_t l_pid;
210+#ifdef __ARCH_FLOCK64_PAD
216211 __ARCH_FLOCK64_PAD
217−};
218212 #endif
213+};
219214
220215 #endif /* _ASM_GENERIC_FCNTL_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t