Skip to content

Commit

Permalink
[PATCH] Create asm-generic/fcntl.h
Browse files Browse the repository at this point in the history
This set of patches creates asm-generic/fcntl.h and consolidates as much as
possible from the asm-*/fcntl.h files into it.

This patch just gathers all the identical bits of the asm-*/fcntl.h files into
asm-generic/fcntl.h.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
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 5ba4d46 commit 9317259
Show file tree
Hide file tree
Showing 22 changed files with 66 additions and 526 deletions.
25 changes: 1 addition & 24 deletions include/asm-alpha/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#define O_ACCMODE 0003
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
#define O_CREAT 01000 /* not fcntl */
#define O_TRUNC 02000 /* not fcntl */
#define O_EXCL 04000 /* not fcntl */
Expand All @@ -23,11 +19,6 @@
#define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */
#define O_NOATIME 04000000

#define F_DUPFD 0 /* dup */
#define F_GETFD 1 /* get close_on_exec */
#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 */
#define F_GETLK 7
#define F_SETLK 8
#define F_SETLKW 9
Expand All @@ -37,9 +28,6 @@
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */

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

/* for posix fcntl() and lockf() */
#define F_RDLCK 1
#define F_WRLCK 2
Expand All @@ -51,17 +39,6 @@

#define F_INPROGRESS 64

/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
#define LOCK_NB 4 /* or'd with one of the above to prevent
blocking */
#define LOCK_UN 8 /* remove lock */
#define LOCK_MAND 32 /* This is a mandatory flock */
#define LOCK_READ 64 /* ... Which allows concurrent read operations */
#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */

struct flock {
short l_type;
short l_whence;
Expand All @@ -70,6 +47,6 @@ struct flock {
__kernel_pid_t l_pid;
};

#define F_LINUX_SPECIFIC_BASE 1024
#include <asm-generic/fcntl.h>

#endif
27 changes: 2 additions & 25 deletions include/asm-arm/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#define O_ACCMODE 0003
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
#define O_CREAT 0100 /* not fcntl */
#define O_EXCL 0200 /* not fcntl */
#define O_NOCTTY 0400 /* not fcntl */
Expand All @@ -22,11 +18,6 @@
#define O_LARGEFILE 0400000
#define O_NOATIME 01000000

#define F_DUPFD 0 /* dup */
#define F_GETFD 1 /* get close_on_exec */
#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 */
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
Expand All @@ -40,9 +31,6 @@
#define F_SETLK64 13
#define F_SETLKW64 14

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

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
Expand All @@ -55,18 +43,6 @@
/* for leases */
#define F_INPROGRESS 16

/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
#define LOCK_NB 4 /* or'd with one of the above to prevent
blocking */
#define LOCK_UN 8 /* remove lock */

#define LOCK_MAND 32 /* This is a mandatory flock */
#define LOCK_READ 64 /* ... Which allows concurrent read operations */
#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */

struct flock {
short l_type;
short l_whence;
Expand All @@ -83,5 +59,6 @@ struct flock64 {
pid_t l_pid;
};

#define F_LINUX_SPECIFIC_BASE 1024
#include <asm-generic/fcntl.h>

#endif
27 changes: 2 additions & 25 deletions include/asm-arm26/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#define O_ACCMODE 0003
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
#define O_CREAT 0100 /* not fcntl */
#define O_EXCL 0200 /* not fcntl */
#define O_NOCTTY 0400 /* not fcntl */
Expand All @@ -22,11 +18,6 @@
#define O_LARGEFILE 0400000
#define O_NOATIME 01000000

#define F_DUPFD 0 /* dup */
#define F_GETFD 1 /* get close_on_exec */
#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 */
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
Expand All @@ -40,9 +31,6 @@
#define F_SETLK64 13
#define F_SETLKW64 14

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

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
Expand All @@ -55,18 +43,6 @@
/* for leases */
#define F_INPROGRESS 16

/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
#define LOCK_NB 4 /* or'd with one of the above to prevent
blocking */
#define LOCK_UN 8 /* remove lock */

#define LOCK_MAND 32 /* This is a mandatory flock */
#define LOCK_READ 64 /* ... Which allows concurrent read operations */
#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */

struct flock {
short l_type;
short l_whence;
Expand All @@ -83,5 +59,6 @@ struct flock64 {
pid_t l_pid;
};

#define F_LINUX_SPECIFIC_BASE 1024
#include <asm-generic/fcntl.h>

#endif
26 changes: 1 addition & 25 deletions include/asm-cris/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#define O_ACCMODE 0003
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
#define O_CREAT 0100 /* not fcntl */
#define O_EXCL 0200 /* not fcntl */
#define O_NOCTTY 0400 /* not fcntl */
Expand All @@ -24,11 +20,6 @@
#define O_NOFOLLOW 0400000 /* don't follow links */
#define O_NOATIME 01000000

#define F_DUPFD 0 /* dup */
#define F_GETFD 1 /* get f_flags */
#define F_SETFD 2 /* set f_flags */
#define F_GETFL 3 /* more flags (cloexec) */
#define F_SETFL 4
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
Expand All @@ -42,9 +33,6 @@
#define F_SETLK64 13
#define F_SETLKW64 14

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

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
Expand All @@ -57,18 +45,6 @@
/* for leases */
#define F_INPROGRESS 16

/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
#define LOCK_NB 4 /* or'd with one of the above to prevent
blocking */
#define LOCK_UN 8 /* remove lock */

#define LOCK_MAND 32 /* This is a mandatory flock */
#define LOCK_READ 64 /* ... Which allows concurrent read operations */
#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */

struct flock {
short l_type;
short l_whence;
Expand All @@ -85,6 +61,6 @@ struct flock64 {
pid_t l_pid;
};

#define F_LINUX_SPECIFIC_BASE 1024
#include <asm-generic/fcntl.h>

#endif
27 changes: 2 additions & 25 deletions include/asm-frv/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#define O_ACCMODE 0003
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
#define O_CREAT 0100 /* not fcntl */
#define O_EXCL 0200 /* not fcntl */
#define O_NOCTTY 0400 /* not fcntl */
Expand All @@ -22,11 +18,6 @@
#define O_NOFOLLOW 0400000 /* don't follow links */
#define O_NOATIME 01000000

#define F_DUPFD 0 /* dup */
#define F_GETFD 1 /* get close_on_exec */
#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 */
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
Expand All @@ -40,9 +31,6 @@
#define F_SETLK64 13
#define F_SETLKW64 14

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

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
Expand All @@ -55,18 +43,6 @@
/* for leases */
#define F_INPROGRESS 16

/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
#define LOCK_NB 4 /* or'd with one of the above to prevent
blocking */
#define LOCK_UN 8 /* remove lock */

#define LOCK_MAND 32 /* This is a mandatory flock */
#define LOCK_READ 64 /* ... Which allows concurrent read operations */
#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */

struct flock {
short l_type;
short l_whence;
Expand All @@ -83,6 +59,7 @@ struct flock64 {
pid_t l_pid;
};

#define F_LINUX_SPECIFIC_BASE 1024
#include <asm-generic/fcntl.h>

#endif /* _ASM_FCNTL_H */

32 changes: 32 additions & 0 deletions include/asm-generic/fcntl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#ifndef _ASM_GENERIC_FCNTL_H
#define _ASM_GENERIC_FCNTL_H

#define O_ACCMODE 0003
#define O_RDONLY 0000
#define O_WRONLY 0001
#define O_RDWR 0002

#define F_DUPFD 0 /* dup */
#define F_GETFD 1 /* get close_on_exec */
#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 */

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

/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
#define LOCK_NB 4 /* or'd with one of the above to prevent
blocking */
#define LOCK_UN 8 /* remove lock */

#define LOCK_MAND 32 /* This is a mandatory flock ... */
#define LOCK_READ 64 /* which allows concurrent read operations */
#define LOCK_WRITE 128 /* which allows concurrent write operations */
#define LOCK_RW 192 /* which allows concurrent read & write ops */

#define F_LINUX_SPECIFIC_BASE 1024

#endif /* _ASM_GENERIC_FCNTL_H */
27 changes: 2 additions & 25 deletions include/asm-h8300/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#define O_ACCMODE 0003
#define O_RDONLY 00
#define O_WRONLY 01
#define O_RDWR 02
#define O_CREAT 0100 /* not fcntl */
#define O_EXCL 0200 /* not fcntl */
#define O_NOCTTY 0400 /* not fcntl */
Expand All @@ -22,11 +18,6 @@
#define O_LARGEFILE 0400000
#define O_NOATIME 01000000

#define F_DUPFD 0 /* dup */
#define F_GETFD 1 /* get close_on_exec */
#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 */
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
Expand All @@ -40,9 +31,6 @@
#define F_SETLK64 13
#define F_SETLKW64 14

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

/* for posix fcntl() and lockf() */
#define F_RDLCK 0
#define F_WRLCK 1
Expand All @@ -55,18 +43,6 @@
/* for leases */
#define F_INPROGRESS 16

/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
#define LOCK_NB 4 /* or'd with one of the above to prevent
blocking */
#define LOCK_UN 8 /* remove lock */

#define LOCK_MAND 32 /* This is a mandatory flock */
#define LOCK_READ 64 /* ... Which allows concurrent read operations */
#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */
#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */

struct flock {
short l_type;
short l_whence;
Expand All @@ -83,5 +59,6 @@ struct flock64 {
pid_t l_pid;
};

#define F_LINUX_SPECIFIC_BASE 1024
#include <asm-generic/fcntl.h>

#endif /* _H8300_FCNTL_H */
Loading

0 comments on commit 9317259

Please sign in to comment.