Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
cc3808f8
Commit
cc3808f8
authored
Aug 06, 2009
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switch sock_alloc_file() to alloc_file()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
6b18662e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
net/socket.c
net/socket.c
+11
-11
No files found.
net/socket.c
View file @
cc3808f8
...
...
@@ -366,16 +366,8 @@ static int sock_alloc_file(struct socket *sock, struct file **f, int flags)
if
(
unlikely
(
fd
<
0
))
return
fd
;
file
=
get_empty_filp
();
if
(
unlikely
(
!
file
))
{
put_unused_fd
(
fd
);
return
-
ENFILE
;
}
dentry
=
d_alloc
(
sock_mnt
->
mnt_sb
->
s_root
,
&
name
);
if
(
unlikely
(
!
dentry
))
{
put_filp
(
file
);
put_unused_fd
(
fd
);
return
-
ENOMEM
;
}
...
...
@@ -388,11 +380,19 @@ static int sock_alloc_file(struct socket *sock, struct file **f, int flags)
*/
dentry
->
d_flags
&=
~
DCACHE_UNHASHED
;
d_instantiate
(
dentry
,
SOCK_INODE
(
sock
));
SOCK_INODE
(
sock
)
->
i_fop
=
&
socket_file_ops
;
sock
->
file
=
file
;
init_file
(
file
,
sock_mnt
,
dentry
,
FMODE_READ
|
FMODE_WRITE
,
file
=
alloc_file
(
sock_mnt
,
dentry
,
FMODE_READ
|
FMODE_WRITE
,
&
socket_file_ops
);
SOCK_INODE
(
sock
)
->
i_fop
=
&
socket_file_ops
;
if
(
unlikely
(
!
file
))
{
/* drop dentry, keep inode */
atomic_inc
(
&
path
.
dentry
->
d_inode
->
i_count
);
dput
(
dentry
);
put_unused_fd
(
fd
);
return
-
ENFILE
;
}
sock
->
file
=
file
;
file
->
f_flags
=
O_RDWR
|
(
flags
&
O_NONBLOCK
);
file
->
f_pos
=
0
;
file
->
private_data
=
sock
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment