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
825f9692
Commit
825f9692
authored
Aug 05, 2009
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switched inotify_init1() to alloc_file()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
4b42af81
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
fs/notify/inotify/inotify_user.c
fs/notify/inotify/inotify_user.c
+10
-15
No files found.
fs/notify/inotify/inotify_user.c
View file @
825f9692
...
...
@@ -659,12 +659,6 @@ SYSCALL_DEFINE1(inotify_init1, int, flags)
if
(
fd
<
0
)
return
fd
;
filp
=
get_empty_filp
();
if
(
!
filp
)
{
ret
=
-
ENFILE
;
goto
out_put_fd
;
}
user
=
get_current_user
();
if
(
unlikely
(
atomic_read
(
&
user
->
inotify_devs
)
>=
inotify_max_user_instances
))
{
...
...
@@ -679,24 +673,25 @@ SYSCALL_DEFINE1(inotify_init1, int, flags)
goto
out_free_uid
;
}
filp
->
f_op
=
&
inotify_fops
;
filp
->
f_path
.
mnt
=
mntget
(
inotify_mnt
);
filp
->
f_path
.
dentry
=
dget
(
inotify_mnt
->
mnt_root
);
filp
->
f_mapping
=
filp
->
f_path
.
dentry
->
d_inode
->
i_mapping
;
filp
->
f_mode
=
FMODE_READ
;
atomic_inc
(
&
user
->
inotify_devs
);
filp
=
alloc_file
(
inotify_mnt
,
dget
(
inotify_mnt
->
mnt_root
),
FMODE_READ
,
&
inotify_fops
);
if
(
!
filp
)
goto
Enfile
;
filp
->
f_flags
=
O_RDONLY
|
(
flags
&
O_NONBLOCK
);
filp
->
private_data
=
group
;
atomic_inc
(
&
user
->
inotify_devs
);
fd_install
(
fd
,
filp
);
return
fd
;
Enfile:
ret
=
-
ENFILE
;
atomic_dec
(
&
user
->
inotify_devs
);
out_free_uid:
free_uid
(
user
);
put_filp
(
filp
);
out_put_fd:
put_unused_fd
(
fd
);
return
ret
;
}
...
...
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