aboutsummaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-07-11 14:19:04 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-07-12 10:02:57 -0400
commitc9c554f21490bbc96cc554f80024d27d09670480 (patch)
treef680bcb2253cf658a7a925d0eb20f2dff71c1f1f /net/socket.c
parent6b4e8085c0004382b985a5c005c685073630e746 (diff)
alloc_file(): switch to passing O_... flags instead of FMODE_... mode
... so that it could set both ->f_flags and ->f_mode, without callers having to set ->f_flags manually. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/socket.c b/net/socket.c
index 8a109012608a..2cdbe8f71b7f 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -411,7 +411,7 @@ struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname)
411 411
412 d_instantiate(path.dentry, SOCK_INODE(sock)); 412 d_instantiate(path.dentry, SOCK_INODE(sock));
413 413
414 file = alloc_file(&path, FMODE_READ | FMODE_WRITE, 414 file = alloc_file(&path, O_RDWR | (flags & O_NONBLOCK),
415 &socket_file_ops); 415 &socket_file_ops);
416 if (IS_ERR(file)) { 416 if (IS_ERR(file)) {
417 /* drop dentry, keep inode for a bit */ 417 /* drop dentry, keep inode for a bit */
@@ -423,7 +423,6 @@ struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname)
423 } 423 }
424 424
425 sock->file = file; 425 sock->file = file;
426 file->f_flags = O_RDWR | (flags & O_NONBLOCK);
427 file->private_data = sock; 426 file->private_data = sock;
428 return file; 427 return file;
429} 428}