Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jan 2016 16:31:10 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r293541 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux
Message-ID:  <201601091631.u09GVAmg041358@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sat Jan  9 16:31:10 2016
New Revision: 293541
URL: https://svnweb.freebsd.org/changeset/base/293541

Log:
  MFC r283437:
  
  To avoid code duplication move open/fcntl definitions to the MI
  header file.

Modified:
  stable/10/sys/amd64/linux/linux.h
  stable/10/sys/amd64/linux32/linux.h
  stable/10/sys/compat/linux/linux_file.h
  stable/10/sys/compat/linux/linux_socket.c
  stable/10/sys/i386/linux/linux.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/linux/linux.h
==============================================================================
--- stable/10/sys/amd64/linux/linux.h	Sat Jan  9 16:29:51 2016	(r293540)
+++ stable/10/sys/amd64/linux/linux.h	Sat Jan  9 16:31:10 2016	(r293541)
@@ -407,44 +407,6 @@ struct l_rt_sigframe {
 };
 
 /*
- * open/fcntl flags
- */
-#define	LINUX_O_RDONLY		00000000
-#define	LINUX_O_WRONLY		00000001
-#define	LINUX_O_RDWR		00000002
-#define	LINUX_O_ACCMODE		00000003
-#define	LINUX_O_CREAT		00000100
-#define	LINUX_O_EXCL		00000200
-#define	LINUX_O_NOCTTY		00000400
-#define	LINUX_O_TRUNC		00001000
-#define	LINUX_O_APPEND		00002000
-#define	LINUX_O_NONBLOCK	00004000
-#define	LINUX_O_NDELAY		LINUX_O_NONBLOCK
-#define	LINUX_O_SYNC		00010000
-#define	LINUX_FASYNC		00020000
-#define	LINUX_O_DIRECT		00040000	/* Direct disk access hint */
-#define	LINUX_O_LARGEFILE	00100000
-#define	LINUX_O_DIRECTORY	00200000	/* Must be a directory */
-#define	LINUX_O_NOFOLLOW	00400000	/* Do not follow links */
-#define	LINUX_O_NOATIME		01000000
-#define	LINUX_O_CLOEXEC		02000000
-
-#define	LINUX_F_DUPFD		0
-#define	LINUX_F_GETFD		1
-#define	LINUX_F_SETFD		2
-#define	LINUX_F_GETFL		3
-#define	LINUX_F_SETFL		4
-#define	LINUX_F_GETLK		5
-#define	LINUX_F_SETLK		6
-#define	LINUX_F_SETLKW		7
-#define	LINUX_F_SETOWN		8
-#define	LINUX_F_GETOWN		9
-
-#define	LINUX_F_RDLCK		0
-#define	LINUX_F_WRLCK		1
-#define	LINUX_F_UNLCK		2
-
-/*
  * mount flags
  */
 #define	LINUX_MS_RDONLY		0x0001

Modified: stable/10/sys/amd64/linux32/linux.h
==============================================================================
--- stable/10/sys/amd64/linux32/linux.h	Sat Jan  9 16:29:51 2016	(r293540)
+++ stable/10/sys/amd64/linux32/linux.h	Sat Jan  9 16:31:10 2016	(r293541)
@@ -520,47 +520,12 @@ struct l_rt_sigframe {
 } __packed;
 
 /*
- * open/fcntl flags
+ * arch specific open/fcntl flags
  */
-#define	LINUX_O_RDONLY		00000000
-#define	LINUX_O_WRONLY		00000001
-#define	LINUX_O_RDWR		00000002
-#define	LINUX_O_ACCMODE		00000003
-#define	LINUX_O_CREAT		00000100
-#define	LINUX_O_EXCL		00000200
-#define	LINUX_O_NOCTTY		00000400
-#define	LINUX_O_TRUNC		00001000
-#define	LINUX_O_APPEND		00002000
-#define	LINUX_O_NONBLOCK	00004000
-#define	LINUX_O_NDELAY		LINUX_O_NONBLOCK
-#define	LINUX_O_SYNC		00010000
-#define	LINUX_FASYNC		00020000
-#define	LINUX_O_DIRECT		00040000	/* Direct disk access hint */
-#define	LINUX_O_LARGEFILE	00100000
-#define	LINUX_O_DIRECTORY	00200000	/* Must be a directory */
-#define	LINUX_O_NOFOLLOW	00400000	/* Do not follow links */
-#define	LINUX_O_NOATIME		01000000
-#define	LINUX_O_CLOEXEC		02000000
-
-#define	LINUX_F_DUPFD		0
-#define	LINUX_F_GETFD		1
-#define	LINUX_F_SETFD		2
-#define	LINUX_F_GETFL		3
-#define	LINUX_F_SETFL		4
-#define	LINUX_F_GETLK		5
-#define	LINUX_F_SETLK		6
-#define	LINUX_F_SETLKW		7
-#define	LINUX_F_SETOWN		8
-#define	LINUX_F_GETOWN		9
-
 #define	LINUX_F_GETLK64		12
 #define	LINUX_F_SETLK64		13
 #define	LINUX_F_SETLKW64	14
 
-#define	LINUX_F_RDLCK		0
-#define	LINUX_F_WRLCK		1
-#define	LINUX_F_UNLCK		2
-
 union l_semun {
 	l_int		val;
 	l_uintptr_t	buf;

Modified: stable/10/sys/compat/linux/linux_file.h
==============================================================================
--- stable/10/sys/compat/linux/linux_file.h	Sat Jan  9 16:29:51 2016	(r293540)
+++ stable/10/sys/compat/linux/linux_file.h	Sat Jan  9 16:31:10 2016	(r293541)
@@ -54,4 +54,48 @@
 #define	LINUX_MS_NOEXEC		0x0008
 #define	LINUX_MS_REMOUNT	0x0020
 
+/*
+ * common open/fcntl flags
+ */
+#define	LINUX_O_RDONLY		00000000
+#define	LINUX_O_WRONLY		00000001
+#define	LINUX_O_RDWR		00000002
+#define	LINUX_O_ACCMODE		00000003
+#define	LINUX_O_CREAT		00000100
+#define	LINUX_O_EXCL		00000200
+#define	LINUX_O_NOCTTY		00000400
+#define	LINUX_O_TRUNC		00001000
+#define	LINUX_O_APPEND		00002000
+#define	LINUX_O_NONBLOCK	00004000
+#define	LINUX_O_NDELAY		LINUX_O_NONBLOCK
+#define	LINUX_O_SYNC		00010000
+#define	LINUX_FASYNC		00020000
+#define	LINUX_O_DIRECT		00040000	/* Direct disk access hint */
+#define	LINUX_O_LARGEFILE	00100000
+#define	LINUX_O_DIRECTORY	00200000	/* Must be a directory */
+#define	LINUX_O_NOFOLLOW	00400000	/* Do not follow links */
+#define	LINUX_O_NOATIME		01000000
+#define	LINUX_O_CLOEXEC		02000000
+
+#define	LINUX_F_DUPFD		0
+#define	LINUX_F_GETFD		1
+#define	LINUX_F_SETFD		2
+#define	LINUX_F_GETFL		3
+#define	LINUX_F_SETFL		4
+#ifndef LINUX_F_GETLK
+#define	LINUX_F_GETLK		5
+#define	LINUX_F_SETLK		6
+#define	LINUX_F_SETLKW		7
+#endif
+#ifndef LINUX_F_SETOWN
+#define	LINUX_F_SETOWN		8
+#define	LINUX_F_GETOWN		9
+#endif
+
+#ifndef LINUX_F_RDLCK
+#define	LINUX_F_RDLCK		0
+#define	LINUX_F_WRLCK		1
+#define	LINUX_F_UNLCK		2
+#endif
+
 #endif	/* !_LINUX_FILE_H_ */

Modified: stable/10/sys/compat/linux/linux_socket.c
==============================================================================
--- stable/10/sys/compat/linux/linux_socket.c	Sat Jan  9 16:29:51 2016	(r293540)
+++ stable/10/sys/compat/linux/linux_socket.c	Sat Jan  9 16:31:10 2016	(r293541)
@@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$");
 #include <machine/../linux/linux.h>
 #include <machine/../linux/linux_proto.h>
 #endif
+#include <compat/linux/linux_file.h>
 #include <compat/linux/linux_socket.h>
 #include <compat/linux/linux_util.h>
 

Modified: stable/10/sys/i386/linux/linux.h
==============================================================================
--- stable/10/sys/i386/linux/linux.h	Sat Jan  9 16:29:51 2016	(r293540)
+++ stable/10/sys/i386/linux/linux.h	Sat Jan  9 16:31:10 2016	(r293541)
@@ -497,47 +497,12 @@ struct l_rt_sigframe {
 extern struct sysentvec linux_sysvec;
 
 /*
- * open/fcntl flags
+ * arch specific open/fcntl flags
  */
-#define	LINUX_O_RDONLY		00000000
-#define	LINUX_O_WRONLY		00000001
-#define	LINUX_O_RDWR		00000002
-#define	LINUX_O_ACCMODE		00000003
-#define	LINUX_O_CREAT		00000100
-#define	LINUX_O_EXCL		00000200
-#define	LINUX_O_NOCTTY		00000400
-#define	LINUX_O_TRUNC		00001000
-#define	LINUX_O_APPEND		00002000
-#define	LINUX_O_NONBLOCK	00004000
-#define	LINUX_O_NDELAY		LINUX_O_NONBLOCK
-#define	LINUX_O_SYNC		00010000
-#define	LINUX_FASYNC		00020000
-#define	LINUX_O_DIRECT		00040000	/* Direct disk access hint */
-#define	LINUX_O_LARGEFILE	00100000
-#define	LINUX_O_DIRECTORY	00200000	/* Must be a directory */
-#define	LINUX_O_NOFOLLOW	00400000	/* Do not follow links */
-#define	LINUX_O_NOATIME		01000000
-#define	LINUX_O_CLOEXEC		02000000
-
-#define	LINUX_F_DUPFD		0
-#define	LINUX_F_GETFD		1
-#define	LINUX_F_SETFD		2
-#define	LINUX_F_GETFL		3
-#define	LINUX_F_SETFL		4
-#define	LINUX_F_GETLK		5
-#define	LINUX_F_SETLK		6
-#define	LINUX_F_SETLKW		7
-#define	LINUX_F_SETOWN		8
-#define	LINUX_F_GETOWN		9
-
 #define	LINUX_F_GETLK64		12
 #define	LINUX_F_SETLK64		13
 #define	LINUX_F_SETLKW64	14
 
-#define	LINUX_F_RDLCK		0
-#define	LINUX_F_WRLCK		1
-#define	LINUX_F_UNLCK		2
-
 union l_semun {
 	l_int		val;
 	struct l_semid_ds	*buf;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601091631.u09GVAmg041358>