Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
7cc2fd8b
Commit
7cc2fd8b
authored
Aug 12, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of /proc dependency on inode numbers
parent
b40c812e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
fs/proc/base.c
fs/proc/base.c
+0
-6
fs/proc/inode.c
fs/proc/inode.c
+18
-6
include/linux/proc_fs.h
include/linux/proc_fs.h
+0
-3
No files found.
fs/proc/base.c
View file @
7cc2fd8b
...
@@ -1121,12 +1121,6 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry)
...
@@ -1121,12 +1121,6 @@ struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry)
return
ERR_PTR
(
-
ENOENT
);
return
ERR_PTR
(
-
ENOENT
);
}
}
void
proc_pid_delete_inode
(
struct
inode
*
inode
)
{
if
(
proc_task
(
inode
))
put_task_struct
(
proc_task
(
inode
));
}
#define PROC_NUMBUF 10
#define PROC_NUMBUF 10
#define PROC_MAXPIDS 20
#define PROC_MAXPIDS 20
...
...
fs/proc/inode.c
View file @
7cc2fd8b
...
@@ -59,14 +59,18 @@ void de_put(struct proc_dir_entry *de)
...
@@ -59,14 +59,18 @@ void de_put(struct proc_dir_entry *de)
*/
*/
static
void
proc_delete_inode
(
struct
inode
*
inode
)
static
void
proc_delete_inode
(
struct
inode
*
inode
)
{
{
struct
proc_dir_entry
*
de
=
PDE
(
inode
);
struct
proc_dir_entry
*
de
;
struct
task_struct
*
tsk
;
inode
->
i_state
=
I_CLEAR
;
inode
->
i_state
=
I_CLEAR
;
if
(
PROC_INODE_PROPER
(
inode
))
{
/* Let go of any associated process */
proc_pid_delete_inode
(
inode
);
tsk
=
PROC_I
(
inode
)
->
task
;
return
;
if
(
tsk
)
}
put_task_struct
(
tsk
);
/* Let go of any associated proc directory entry */
de
=
PROC_I
(
inode
)
->
pde
;
if
(
de
)
{
if
(
de
)
{
if
(
de
->
owner
)
if
(
de
->
owner
)
__MOD_DEC_USE_COUNT
(
de
->
owner
);
__MOD_DEC_USE_COUNT
(
de
->
owner
);
...
@@ -86,10 +90,18 @@ static kmem_cache_t * proc_inode_cachep;
...
@@ -86,10 +90,18 @@ static kmem_cache_t * proc_inode_cachep;
static
struct
inode
*
proc_alloc_inode
(
struct
super_block
*
sb
)
static
struct
inode
*
proc_alloc_inode
(
struct
super_block
*
sb
)
{
{
struct
proc_inode
*
ei
;
struct
proc_inode
*
ei
;
struct
inode
*
inode
;
ei
=
(
struct
proc_inode
*
)
kmem_cache_alloc
(
proc_inode_cachep
,
SLAB_KERNEL
);
ei
=
(
struct
proc_inode
*
)
kmem_cache_alloc
(
proc_inode_cachep
,
SLAB_KERNEL
);
if
(
!
ei
)
if
(
!
ei
)
return
NULL
;
return
NULL
;
return
&
ei
->
vfs_inode
;
ei
->
task
=
NULL
;
ei
->
type
=
0
;
ei
->
op
.
proc_get_link
=
NULL
;
ei
->
pde
=
NULL
;
inode
=
&
ei
->
vfs_inode
;
inode
->
i_mtime
=
inode
->
i_atime
=
inode
->
i_ctime
=
CURRENT_TIME
;
return
inode
;
}
}
static
void
proc_destroy_inode
(
struct
inode
*
inode
)
static
void
proc_destroy_inode
(
struct
inode
*
inode
)
...
...
include/linux/proc_fs.h
View file @
7cc2fd8b
...
@@ -74,8 +74,6 @@ struct proc_dir_entry {
...
@@ -74,8 +74,6 @@ struct proc_dir_entry {
kdev_t
rdev
;
kdev_t
rdev
;
};
};
#define PROC_INODE_PROPER(inode) ((inode)->i_ino & ~0xffff)
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
extern
struct
proc_dir_entry
proc_root
;
extern
struct
proc_dir_entry
proc_root
;
...
@@ -89,7 +87,6 @@ extern void proc_root_init(void);
...
@@ -89,7 +87,6 @@ extern void proc_root_init(void);
extern
void
proc_misc_init
(
void
);
extern
void
proc_misc_init
(
void
);
struct
dentry
*
proc_pid_lookup
(
struct
inode
*
dir
,
struct
dentry
*
dentry
);
struct
dentry
*
proc_pid_lookup
(
struct
inode
*
dir
,
struct
dentry
*
dentry
);
void
proc_pid_delete_inode
(
struct
inode
*
inode
);
int
proc_pid_readdir
(
struct
file
*
filp
,
void
*
dirent
,
filldir_t
filldir
);
int
proc_pid_readdir
(
struct
file
*
filp
,
void
*
dirent
,
filldir_t
filldir
);
extern
struct
proc_dir_entry
*
create_proc_entry
(
const
char
*
name
,
mode_t
mode
,
extern
struct
proc_dir_entry
*
create_proc_entry
(
const
char
*
name
,
mode_t
mode
,
...
...
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