提交 42e50a5a 编写于 作者: M Miklos Szeredi 提交者: Linus Torvalds

[PATCH] open: cleanup in lookup_flags()

lookup_flags() is only called from the non-create case, so it needn't check
for O_CREAT|O_EXCL.
Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
Cc: Al Viro <viro@ftp.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 a9289728
...@@ -1311,9 +1311,6 @@ static inline int may_create(struct inode *dir, struct dentry *child, ...@@ -1311,9 +1311,6 @@ static inline int may_create(struct inode *dir, struct dentry *child,
} }
/* /*
* Special case: O_CREAT|O_EXCL implies O_NOFOLLOW for security
* reasons.
*
* O_DIRECTORY translates into forcing a directory lookup. * O_DIRECTORY translates into forcing a directory lookup.
*/ */
static inline int lookup_flags(unsigned int f) static inline int lookup_flags(unsigned int f)
...@@ -1323,9 +1320,6 @@ static inline int lookup_flags(unsigned int f) ...@@ -1323,9 +1320,6 @@ static inline int lookup_flags(unsigned int f)
if (f & O_NOFOLLOW) if (f & O_NOFOLLOW)
retval &= ~LOOKUP_FOLLOW; retval &= ~LOOKUP_FOLLOW;
if ((f & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
retval &= ~LOOKUP_FOLLOW;
if (f & O_DIRECTORY) if (f & O_DIRECTORY)
retval |= LOOKUP_DIRECTORY; retval |= LOOKUP_DIRECTORY;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册