Skip to content

Commit

Permalink
[PATCH] Clean up struct flock definitions
Browse files Browse the repository at this point in the history
This patch just gathers together all the struct flock definitions except
xtensa into asm-generic/fcntl.h.

Signed-off-by: Stephen Rothwell <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
sfrothwell authored and Linus Torvalds committed Sep 7, 2005
1 parent 1abf62a commit 5ac353f
Show file tree
Hide file tree
Showing 21 changed files with 26 additions and 171 deletions.
8 changes: 0 additions & 8 deletions include/asm-alpha/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <asm-generic/fcntl.h>

#endif
8 changes: 0 additions & 8 deletions include/asm-arm/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions include/asm-arm26/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions include/asm-cris/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions include/asm-frv/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 17 additions & 0 deletions include/asm-generic/fcntl.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef _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
located on an ext2 file system */
#define O_ACCMODE 00000003
Expand Down Expand Up @@ -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 */
8 changes: 0 additions & 8 deletions include/asm-h8300/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions include/asm-i386/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions include/asm-ia64/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
* David Mosberger-Tang <[email protected]>, 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)

Expand Down
12 changes: 0 additions & 12 deletions include/asm-m32r/fcntl.h
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
8 changes: 0 additions & 8 deletions include/asm-m68k/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 4 additions & 13 deletions include/asm-mips/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 <asm-generic/fcntl.h>

typedef struct flock flock_t;

#endif /* _ASM_FCNTL_H */
8 changes: 0 additions & 8 deletions include/asm-parisc/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 0 additions & 10 deletions include/asm-ppc/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 0 additions & 10 deletions include/asm-s390/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 0 additions & 8 deletions include/asm-sh/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 2 additions & 9 deletions include/asm-sparc/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -50,6 +41,8 @@ struct flock64 {
short __unused;
};

#define __ARCH_FLOCK_PAD short __unused;

#include <asm-generic/fcntl.h>

#endif
9 changes: 1 addition & 8 deletions include/asm-sparc64/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <asm-generic/fcntl.h>

Expand Down
8 changes: 0 additions & 8 deletions include/asm-v850/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 0 additions & 13 deletions include/asm-x86_64/fcntl.h
Original file line number Diff line number Diff line change
@@ -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 <asm-generic/fcntl.h>

#endif /* !_X86_64_FCNTL_H */
2 changes: 2 additions & 0 deletions include/asm-xtensa/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ struct flock64 {
pid_t l_pid;
};

#define HAVE_ARCH_STRUCT_FLOCK

#include <asm-generic/fcntl.h>

#endif /* _XTENSA_FCNTL_H */

0 comments on commit 5ac353f

Please sign in to comment.