提交 5ac353f9 编写于 作者: S Stephen Rothwell 提交者: Linus Torvalds

[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: NStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1abf62af
...@@ -37,14 +37,6 @@ ...@@ -37,14 +37,6 @@
#define F_INPROGRESS 64 #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 <asm-generic/fcntl.h> #include <asm-generic/fcntl.h>
#endif #endif
...@@ -10,14 +10,6 @@ ...@@ -10,14 +10,6 @@
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
...@@ -12,14 +12,6 @@ ...@@ -12,14 +12,6 @@
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
...@@ -5,14 +5,6 @@ ...@@ -5,14 +5,6 @@
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
...@@ -5,14 +5,6 @@ ...@@ -5,14 +5,6 @@
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
#ifndef _ASM_GENERIC_FCNTL_H #ifndef _ASM_GENERIC_FCNTL_H
#define _ASM_GENERIC_FCNTL_H #define _ASM_GENERIC_FCNTL_H
#include <linux/types.h>
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files /* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */ located on an ext2 file system */
#define O_ACCMODE 00000003 #define O_ACCMODE 00000003
...@@ -104,4 +106,19 @@ ...@@ -104,4 +106,19 @@
#define F_LINUX_SPECIFIC_BASE 1024 #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 */ #endif /* _ASM_GENERIC_FCNTL_H */
...@@ -10,14 +10,6 @@ ...@@ -10,14 +10,6 @@
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
...@@ -5,14 +5,6 @@ ...@@ -5,14 +5,6 @@
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
...@@ -5,14 +5,6 @@ ...@@ -5,14 +5,6 @@
* David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co. * David Mosberger-Tang <davidm@hpl.hp.com>, 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() \ #define force_o_largefile() \
(personality(current->personality) != PER_LINUX32) (personality(current->personality) != PER_LINUX32)
......
#ifndef _ASM_M32R_FCNTL_H #ifndef _ASM_M32R_FCNTL_H
#define _ASM_M32R_FCNTL_H #define _ASM_M32R_FCNTL_H
/* $Id$ */
/* orig : i386 2.4.18 */
#define F_GETLK64 12 /* using 'struct flock64' */ #define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
...@@ -10,14 +10,6 @@ ...@@ -10,14 +10,6 @@
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
...@@ -50,7 +50,7 @@ struct flock { ...@@ -50,7 +50,7 @@ struct flock {
long l_sysid; long l_sysid;
__kernel_pid_t l_pid; __kernel_pid_t l_pid;
long pad[4]; long pad[4];
} flock_t; };
typedef struct flock64 { typedef struct flock64 {
short l_type; short l_type;
...@@ -60,22 +60,13 @@ typedef struct flock64 { ...@@ -60,22 +60,13 @@ typedef struct flock64 {
pid_t l_pid; pid_t l_pid;
} flock64_t; } flock64_t;
#else /* 64-bit definitions */
typedef struct flock { #define HAVE_ARCH_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
#endif #endif
#include <asm-generic/fcntl.h> #include <asm-generic/fcntl.h>
typedef struct flock flock_t;
#endif /* _ASM_FCNTL_H */ #endif /* _ASM_FCNTL_H */
...@@ -33,14 +33,6 @@ ...@@ -33,14 +33,6 @@
#define F_WRLCK 02 #define F_WRLCK 02
#define F_UNLCK 03 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
...@@ -10,17 +10,7 @@ ...@@ -10,17 +10,7 @@
#define F_GETLK64 12 /* using 'struct flock64' */ #define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
...@@ -12,17 +12,7 @@ ...@@ -12,17 +12,7 @@
#define F_GETLK64 12 /* using 'struct flock64' */ #define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
...@@ -5,14 +5,6 @@ ...@@ -5,14 +5,6 @@
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
...@@ -32,15 +32,6 @@ ...@@ -32,15 +32,6 @@
#define F_WRLCK 2 #define F_WRLCK 2
#define F_UNLCK 3 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
...@@ -50,6 +41,8 @@ struct flock64 { ...@@ -50,6 +41,8 @@ struct flock64 {
short __unused; short __unused;
}; };
#define __ARCH_FLOCK_PAD short __unused;
#include <asm-generic/fcntl.h> #include <asm-generic/fcntl.h>
#endif #endif
...@@ -29,14 +29,7 @@ ...@@ -29,14 +29,7 @@
#define F_WRLCK 2 #define F_WRLCK 2
#define F_UNLCK 3 #define F_UNLCK 3
struct flock { #define __ARCH_FLOCK_PAD short __unused;
short l_type;
short l_whence;
off_t l_start;
off_t l_len;
pid_t l_pid;
short __unused;
};
#include <asm-generic/fcntl.h> #include <asm-generic/fcntl.h>
......
...@@ -10,14 +10,6 @@ ...@@ -10,14 +10,6 @@
#define F_SETLK64 13 #define F_SETLK64 13
#define F_SETLKW64 14 #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 { struct flock64 {
short l_type; short l_type;
short l_whence; short l_whence;
......
#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 <asm-generic/fcntl.h> #include <asm-generic/fcntl.h>
#endif /* !_X86_64_FCNTL_H */
...@@ -53,6 +53,8 @@ struct flock64 { ...@@ -53,6 +53,8 @@ struct flock64 {
pid_t l_pid; pid_t l_pid;
}; };
#define HAVE_ARCH_STRUCT_FLOCK
#include <asm-generic/fcntl.h> #include <asm-generic/fcntl.h>
#endif /* _XTENSA_FCNTL_H */ #endif /* _XTENSA_FCNTL_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册