From: Miklos Szeredi <[email-masked]>

Deprecate access mode of '3' in open() as suggested by Linus.

Signed-off-by: Miklos Szeredi <[email-masked]>
Cc: <[email-masked]>
Cc: Christoph Hellwig <[email-masked]>
Signed-off-by: Andrew Morton <[email-masked]>
---

 fs/open.c |   12 ++++++++++++
 1 files changed, 12 insertions(+)

diff -puN fs/open.c~deprecate-openfoo-3 fs/open.c
--- devel/fs/open.c~deprecate-openfoo-3	2005-09-12 03:34:35.000000000 -0700
+++ devel-akpm/fs/open.c	2005-09-12 03:34:35.000000000 -0700
@@ -815,7 +815,19 @@ struct file *filp_open(const char * file
 	int namei_flags, error;
 	struct nameidata nd;
 	struct file *f;
+	static int warned;
 
+	/*
+	 * Access mode of 3 had some old uses, that are probably not
+	 * applicable anymore.  For now just warn about deprecation.
+	 * Later it can be changed to return -EINVAL.
+	 */
+	if ((flags & O_ACCMODE) == 3 && warned < 5) {
+		warned++;
+		printk(KERN_WARNING "Warning: '%s' (pid=%i) uses deprecated "
+				"open flags, please report!\n",
+			current->comm, current->tgid);
+	}
 	namei_flags = flags;
 	if ((namei_flags+1) & O_ACCMODE)
 		namei_flags++;
_