Skip to content

Commit

Permalink
[PATCH] Clean up the fcntl operations
Browse files Browse the repository at this point in the history
This patch puts the most popular of each fcntl operation/flag into
asm-generic/fcntl.h and cleans up the arch files.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Stephen Rothwell authored and Linus Torvalds committed Sep 7, 2005
1 parent e64ca97 commit 1abf62a
Show file tree
Hide file tree
Showing 20 changed files with 31 additions and 348 deletions.
21 changes: 0 additions & 21 deletions include/asm-arm/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,10 @@
#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
#define O_LARGEFILE 0400000

#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7

#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */

#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2

/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */

/* for leases */
#define F_INPROGRESS 16

struct flock {
short l_type;
short l_whence;
Expand Down
21 changes: 0 additions & 21 deletions include/asm-arm26/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,10 @@
#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
#define O_LARGEFILE 0400000

#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7

#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */

#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2

/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */

/* for leases */
#define F_INPROGRESS 16

struct flock {
short l_type;
short l_whence;
Expand Down
21 changes: 0 additions & 21 deletions include/asm-cris/fcntl.h
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
#ifndef _CRIS_FCNTL_H
#define _CRIS_FCNTL_H

#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7

#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */

#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2

/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */

/* for leases */
#define F_INPROGRESS 16

struct flock {
short l_type;
short l_whence;
Expand Down
21 changes: 0 additions & 21 deletions include/asm-frv/fcntl.h
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
#ifndef _ASM_FCNTL_H
#define _ASM_FCNTL_H

#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7

#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */

#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2

/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */

/* for leases */
#define F_INPROGRESS 16

struct flock {
short l_type;
short l_whence;
Expand Down
31 changes: 31 additions & 0 deletions include/asm-generic/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,41 @@
#define F_SETFD 2 /* set/clear close_on_exec */
#define F_GETFL 3 /* get file->f_flags */
#define F_SETFL 4 /* set file->f_flags */
#ifndef F_GETLK
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
#endif
#ifndef F_SETOWN
#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
#endif
#ifndef F_SETSIG
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */
#endif

/* for F_[GET|SET]FL */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */

/* for posix fcntl() and lockf() */
#ifndef F_RDLCK
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2
#endif

/* for old implementation of bsd flock () */
#ifndef F_EXLCK
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
#endif

/* for leases */
#ifndef F_INPROGRESS
#define F_INPROGRESS 16
#endif

/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
Expand Down
21 changes: 0 additions & 21 deletions include/asm-h8300/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,10 @@
#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
#define O_LARGEFILE 0400000

#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7

#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */

#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2

/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */

/* for leases */
#define F_INPROGRESS 16

struct flock {
short l_type;
short l_whence;
Expand Down
21 changes: 0 additions & 21 deletions include/asm-i386/fcntl.h
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
#ifndef _I386_FCNTL_H
#define _I386_FCNTL_H

#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7

#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */

#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2

/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */

/* for leases */
#define F_INPROGRESS 16

struct flock {
short l_type;
short l_whence;
Expand Down
21 changes: 0 additions & 21 deletions include/asm-ia64/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,6 @@
* David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
*/

#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7

#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2

/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */

/* for leases */
#define F_INPROGRESS 16

struct flock {
short l_type;
short l_whence;
Expand Down
21 changes: 0 additions & 21 deletions include/asm-m32r/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,10 @@

/* orig : i386 2.4.18 */

#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7

#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */

#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2

/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */

/* for leases */
#define F_INPROGRESS 16

struct flock {
short l_type;
short l_whence;
Expand Down
21 changes: 0 additions & 21 deletions include/asm-m68k/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,10 @@
#define O_DIRECT 0200000 /* direct disk access hint - currently ignored */
#define O_LARGEFILE 0400000

#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7

#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */

#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2

/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */

/* for leases */
#define F_INPROGRESS 16

struct flock {
short l_type;
short l_whence;
Expand Down
12 changes: 0 additions & 12 deletions include/asm-mips/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,6 @@
#define F_SETLKW64 35
#endif

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2

/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */

/* for leases */
#define F_INPROGRESS 16

/*
* The flavours of struct flock. "struct flock" is the ABI compliant
* variant. Finally struct flock64 is the LFS variant of struct flock. As
Expand Down
10 changes: 0 additions & 10 deletions include/asm-parisc/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
#define O_NOFOLLOW 00000200 /* don't follow links */
#define O_INVISIBLE 04000000 /* invisible I/O, for DMAPI/XDSM */

#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
#define F_GETLK64 8
#define F_SETLK64 9
#define F_SETLKW64 10
Expand All @@ -36,13 +33,6 @@
#define F_WRLCK 02
#define F_UNLCK 03

/* for old implementation of bsd flock () */
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */

/* for leases */
#define F_INPROGRESS 16

struct flock {
short l_type;
short l_whence;
Expand Down
Loading

0 comments on commit 1abf62a

Please sign in to comment.