From 5ac353f9baf7169298ebb7de86b2d697b25bca44 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Tue, 6 Sep 2005 15:18:00 -0700 Subject: [PATCH] [PATCH] Clean up struct flock definitions This patch just gathers together all the struct flock definitions except xtensa into asm-generic/fcntl.h. Signed-off-by: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-alpha/fcntl.h | 8 -------- include/asm-arm/fcntl.h | 8 -------- include/asm-arm26/fcntl.h | 8 -------- include/asm-cris/fcntl.h | 8 -------- include/asm-frv/fcntl.h | 8 -------- include/asm-generic/fcntl.h | 17 +++++++++++++++++ include/asm-h8300/fcntl.h | 8 -------- include/asm-i386/fcntl.h | 8 -------- include/asm-ia64/fcntl.h | 8 -------- include/asm-m32r/fcntl.h | 12 ------------ include/asm-m68k/fcntl.h | 8 -------- include/asm-mips/fcntl.h | 17 ++++------------- include/asm-parisc/fcntl.h | 8 -------- include/asm-ppc/fcntl.h | 10 ---------- include/asm-s390/fcntl.h | 10 ---------- include/asm-sh/fcntl.h | 8 -------- include/asm-sparc/fcntl.h | 11 ++--------- include/asm-sparc64/fcntl.h | 9 +-------- include/asm-v850/fcntl.h | 8 -------- include/asm-x86_64/fcntl.h | 13 ------------- include/asm-xtensa/fcntl.h | 2 ++ 21 files changed, 26 insertions(+), 171 deletions(-) diff --git a/include/asm-alpha/fcntl.h b/include/asm-alpha/fcntl.h index e2aacbbe38bc..87f2cf459e26 100644 --- a/include/asm-alpha/fcntl.h +++ b/include/asm-alpha/fcntl.h @@ -37,14 +37,6 @@ #define F_INPROGRESS 64 -struct flock { - short l_type; - short l_whence; - __kernel_off_t l_start; - __kernel_off_t l_len; - __kernel_pid_t l_pid; -}; - #include #endif diff --git a/include/asm-arm/fcntl.h b/include/asm-arm/fcntl.h index 6337df23831f..1816a6ac6f10 100644 --- a/include/asm-arm/fcntl.h +++ b/include/asm-arm/fcntl.h @@ -10,14 +10,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-arm26/fcntl.h b/include/asm-arm26/fcntl.h index 2f08302fa8c6..b88f8d08c60c 100644 --- a/include/asm-arm26/fcntl.h +++ b/include/asm-arm26/fcntl.h @@ -12,14 +12,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-cris/fcntl.h b/include/asm-cris/fcntl.h index e91b576985d2..f8e7d1307ebc 100644 --- a/include/asm-cris/fcntl.h +++ b/include/asm-cris/fcntl.h @@ -5,14 +5,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-frv/fcntl.h b/include/asm-frv/fcntl.h index e5523669b62e..0b212d945adb 100644 --- a/include/asm-frv/fcntl.h +++ b/include/asm-frv/fcntl.h @@ -5,14 +5,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index 1e66f923a252..b001d7fe0384 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h @@ -1,6 +1,8 @@ #ifndef _ASM_GENERIC_FCNTL_H #define _ASM_GENERIC_FCNTL_H +#include + /* open/fcntl - O_SYNC is only implemented on blocks devices and on files located on an ext2 file system */ #define O_ACCMODE 00000003 @@ -104,4 +106,19 @@ #define F_LINUX_SPECIFIC_BASE 1024 +#ifndef HAVE_ARCH_STRUCT_FLOCK +#ifndef __ARCH_FLOCK_PAD +#define __ARCH_FLOCK_PAD +#endif + +struct flock { + short l_type; + short l_whence; + off_t l_start; + off_t l_len; + pid_t l_pid; + __ARCH_FLOCK_PAD +}; +#endif + #endif /* _ASM_GENERIC_FCNTL_H */ diff --git a/include/asm-h8300/fcntl.h b/include/asm-h8300/fcntl.h index 805aaa09c717..8caeb05e84df 100644 --- a/include/asm-h8300/fcntl.h +++ b/include/asm-h8300/fcntl.h @@ -10,14 +10,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-i386/fcntl.h b/include/asm-i386/fcntl.h index 1d06913c3bfd..01f17d29d288 100644 --- a/include/asm-i386/fcntl.h +++ b/include/asm-i386/fcntl.h @@ -5,14 +5,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h index a9d04aca7903..1dd275dc8f65 100644 --- a/include/asm-ia64/fcntl.h +++ b/include/asm-ia64/fcntl.h @@ -5,14 +5,6 @@ * David Mosberger-Tang , Hewlett-Packard Co. */ -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - #define force_o_largefile() \ (personality(current->personality) != PER_LINUX32) diff --git a/include/asm-m32r/fcntl.h b/include/asm-m32r/fcntl.h index ff3a0849bb85..90f71735fa9a 100644 --- a/include/asm-m32r/fcntl.h +++ b/include/asm-m32r/fcntl.h @@ -1,22 +1,10 @@ #ifndef _ASM_M32R_FCNTL_H #define _ASM_M32R_FCNTL_H -/* $Id$ */ - -/* orig : i386 2.4.18 */ - #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-m68k/fcntl.h b/include/asm-m68k/fcntl.h index 7dd8062c8ce6..d3b24e3fbac0 100644 --- a/include/asm-m68k/fcntl.h +++ b/include/asm-m68k/fcntl.h @@ -10,14 +10,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h index be971d6ac9b5..fb824bf09296 100644 --- a/include/asm-mips/fcntl.h +++ b/include/asm-mips/fcntl.h @@ -50,7 +50,7 @@ struct flock { long l_sysid; __kernel_pid_t l_pid; long pad[4]; -} flock_t; +}; typedef struct flock64 { short l_type; @@ -60,22 +60,13 @@ typedef struct flock64 { pid_t l_pid; } flock64_t; -#else /* 64-bit definitions */ -typedef struct flock { - short l_type; - short l_whence; - __kernel_off_t l_start; - __kernel_off_t l_len; - __kernel_pid_t l_pid; -} flock_t; - -#ifdef __KERNEL__ -#define flock64 flock -#endif +#define HAVE_ARCH_STRUCT_FLOCK #endif #include +typedef struct flock flock_t; + #endif /* _ASM_FCNTL_H */ diff --git a/include/asm-parisc/fcntl.h b/include/asm-parisc/fcntl.h index 59a54fff7c63..eadda003c201 100644 --- a/include/asm-parisc/fcntl.h +++ b/include/asm-parisc/fcntl.h @@ -33,14 +33,6 @@ #define F_WRLCK 02 #define F_UNLCK 03 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-ppc/fcntl.h b/include/asm-ppc/fcntl.h index 8549c0332c98..4480f21bfdea 100644 --- a/include/asm-ppc/fcntl.h +++ b/include/asm-ppc/fcntl.h @@ -10,17 +10,7 @@ #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -#endif - -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; -#ifndef __powerpc64__ struct flock64 { short l_type; short l_whence; diff --git a/include/asm-s390/fcntl.h b/include/asm-s390/fcntl.h index 2974433e8ea4..3a66fba09ee9 100644 --- a/include/asm-s390/fcntl.h +++ b/include/asm-s390/fcntl.h @@ -12,17 +12,7 @@ #define F_GETLK64 12 /* using 'struct flock64' */ #define F_SETLK64 13 #define F_SETLKW64 14 -#endif /* ! __s390x__ */ -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - -#ifndef __s390x__ struct flock64 { short l_type; short l_whence; diff --git a/include/asm-sh/fcntl.h b/include/asm-sh/fcntl.h index 1db7b74450b5..c481bab8ba17 100644 --- a/include/asm-sh/fcntl.h +++ b/include/asm-sh/fcntl.h @@ -5,14 +5,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-sparc/fcntl.h b/include/asm-sparc/fcntl.h index 61334bff18c4..634557374e95 100644 --- a/include/asm-sparc/fcntl.h +++ b/include/asm-sparc/fcntl.h @@ -32,15 +32,6 @@ #define F_WRLCK 2 #define F_UNLCK 3 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; - short __unused; -}; - struct flock64 { short l_type; short l_whence; @@ -50,6 +41,8 @@ struct flock64 { short __unused; }; +#define __ARCH_FLOCK_PAD short __unused; + #include #endif diff --git a/include/asm-sparc64/fcntl.h b/include/asm-sparc64/fcntl.h index 3db10e076eec..b2aecf0054bd 100644 --- a/include/asm-sparc64/fcntl.h +++ b/include/asm-sparc64/fcntl.h @@ -29,14 +29,7 @@ #define F_WRLCK 2 #define F_UNLCK 3 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; - short __unused; -}; +#define __ARCH_FLOCK_PAD short __unused; #include diff --git a/include/asm-v850/fcntl.h b/include/asm-v850/fcntl.h index 70015131e4b2..0fd47f0c6a8a 100644 --- a/include/asm-v850/fcntl.h +++ b/include/asm-v850/fcntl.h @@ -10,14 +10,6 @@ #define F_SETLK64 13 #define F_SETLKW64 14 -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - struct flock64 { short l_type; short l_whence; diff --git a/include/asm-x86_64/fcntl.h b/include/asm-x86_64/fcntl.h index c7b09ea97d36..46ab12db5739 100644 --- a/include/asm-x86_64/fcntl.h +++ b/include/asm-x86_64/fcntl.h @@ -1,14 +1 @@ -#ifndef _X86_64_FCNTL_H -#define _X86_64_FCNTL_H - -struct flock { - short l_type; - short l_whence; - off_t l_start; - off_t l_len; - pid_t l_pid; -}; - #include - -#endif /* !_X86_64_FCNTL_H */ diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h index 06f0dc9cc525..fdae0e170585 100644 --- a/include/asm-xtensa/fcntl.h +++ b/include/asm-xtensa/fcntl.h @@ -53,6 +53,8 @@ struct flock64 { pid_t l_pid; }; +#define HAVE_ARCH_STRUCT_FLOCK + #include #endif /* _XTENSA_FCNTL_H */ -- 2.20.1