Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
Linux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
E-EXK4 - Operating System Group
projects
Linux
Commits
c44dcc56
Commit
c44dcc56
authored
15 years ago
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
switch inotify_user to anon_inode
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
cccc6bba
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fs/notify/inotify/inotify_user.c
+6
-53
6 additions, 53 deletions
fs/notify/inotify/inotify_user.c
include/linux/magic.h
+0
-1
0 additions, 1 deletion
include/linux/magic.h
with
6 additions
and
54 deletions
fs/notify/inotify/inotify_user.c
+
6
−
53
View file @
c44dcc56
...
...
@@ -29,14 +29,12 @@
#include
<linux/init.h>
/* module_init */
#include
<linux/inotify.h>
#include
<linux/kernel.h>
/* roundup() */
#include
<linux/magic.h>
/* superblock magic number */
#include
<linux/mount.h>
/* mntget */
#include
<linux/namei.h>
/* LOOKUP_FOLLOW */
#include
<linux/path.h>
/* struct path */
#include
<linux/sched.h>
/* struct user */
#include
<linux/slab.h>
/* struct kmem_cache */
#include
<linux/syscalls.h>
#include
<linux/types.h>
#include
<linux/anon_inodes.h>
#include
<linux/uaccess.h>
#include
<linux/poll.h>
#include
<linux/wait.h>
...
...
@@ -45,8 +43,6 @@
#include
<asm/ioctls.h>
static
struct
vfsmount
*
inotify_mnt
__read_mostly
;
/* these are configurable via /proc/sys/fs/inotify/ */
static
int
inotify_max_user_instances
__read_mostly
;
static
int
inotify_max_queued_events
__read_mostly
;
...
...
@@ -645,9 +641,7 @@ SYSCALL_DEFINE1(inotify_init1, int, flags)
{
struct
fsnotify_group
*
group
;
struct
user_struct
*
user
;
struct
file
*
filp
;
struct
path
path
;
int
fd
,
ret
;
int
ret
;
/* Check the IN_* constants for consistency. */
BUILD_BUG_ON
(
IN_CLOEXEC
!=
O_CLOEXEC
);
...
...
@@ -656,10 +650,6 @@ SYSCALL_DEFINE1(inotify_init1, int, flags)
if
(
flags
&
~
(
IN_CLOEXEC
|
IN_NONBLOCK
))
return
-
EINVAL
;
fd
=
get_unused_fd_flags
(
flags
&
O_CLOEXEC
);
if
(
fd
<
0
)
return
fd
;
user
=
get_current_user
();
if
(
unlikely
(
atomic_read
(
&
user
->
inotify_devs
)
>=
inotify_max_user_instances
))
{
...
...
@@ -676,27 +666,14 @@ SYSCALL_DEFINE1(inotify_init1, int, flags)
atomic_inc
(
&
user
->
inotify_devs
);
path
.
mnt
=
inotify_mnt
;
path
.
dentry
=
inotify_mnt
->
mnt_root
;
path_get
(
&
path
);
filp
=
alloc_file
(
&
path
,
FMODE_READ
,
&
inotify_fops
);
if
(
!
filp
)
goto
Enfile
;
ret
=
anon_inode_getfd
(
"inotify"
,
&
inotify_fops
,
group
,
O_RDONLY
|
flags
);
if
(
ret
>=
0
)
return
ret
;
filp
->
f_flags
=
O_RDONLY
|
(
flags
&
O_NONBLOCK
);
filp
->
private_data
=
group
;
fd_install
(
fd
,
filp
);
return
fd
;
Enfile:
ret
=
-
ENFILE
;
path_put
(
&
path
);
atomic_dec
(
&
user
->
inotify_devs
);
out_free_uid:
free_uid
(
user
);
put_unused_fd
(
fd
);
return
ret
;
}
...
...
@@ -783,20 +760,6 @@ SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd)
return
ret
;
}
static
int
inotify_get_sb
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
,
struct
vfsmount
*
mnt
)
{
return
get_sb_pseudo
(
fs_type
,
"inotify"
,
NULL
,
INOTIFYFS_SUPER_MAGIC
,
mnt
);
}
static
struct
file_system_type
inotify_fs_type
=
{
.
name
=
"inotifyfs"
,
.
get_sb
=
inotify_get_sb
,
.
kill_sb
=
kill_anon_super
,
};
/*
* inotify_user_setup - Our initialization function. Note that we cannnot return
* error because we have compiled-in VFS hooks. So an (unlikely) failure here
...
...
@@ -804,16 +767,6 @@ static struct file_system_type inotify_fs_type = {
*/
static
int
__init
inotify_user_setup
(
void
)
{
int
ret
;
ret
=
register_filesystem
(
&
inotify_fs_type
);
if
(
unlikely
(
ret
))
panic
(
"inotify: register_filesystem returned %d!
\n
"
,
ret
);
inotify_mnt
=
kern_mount
(
&
inotify_fs_type
);
if
(
IS_ERR
(
inotify_mnt
))
panic
(
"inotify: kern_mount ret %ld!
\n
"
,
PTR_ERR
(
inotify_mnt
));
inotify_inode_mark_cachep
=
KMEM_CACHE
(
inotify_inode_mark_entry
,
SLAB_PANIC
);
event_priv_cachep
=
KMEM_CACHE
(
inotify_event_private_data
,
SLAB_PANIC
);
...
...
This diff is collapsed.
Click to expand it.
include/linux/magic.h
+
0
−
1
View file @
c44dcc56
...
...
@@ -52,7 +52,6 @@
#define CGROUP_SUPER_MAGIC 0x27e0eb
#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA
#define STACK_END_MAGIC 0x57AC6E9D
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment