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
nexedi
linux
Commits
1df98b8b
Commit
1df98b8b
authored
Jun 15, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proc_fill_cache(): clean up, get rid of pointless find_inode_number() use
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
c52a47ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
23 deletions
+13
-23
fs/proc/base.c
fs/proc/base.c
+13
-23
No files found.
fs/proc/base.c
View file @
1df98b8b
...
@@ -1686,39 +1686,29 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx,
...
@@ -1686,39 +1686,29 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx,
instantiate_t
instantiate
,
struct
task_struct
*
task
,
const
void
*
ptr
)
instantiate_t
instantiate
,
struct
task_struct
*
task
,
const
void
*
ptr
)
{
{
struct
dentry
*
child
,
*
dir
=
file
->
f_path
.
dentry
;
struct
dentry
*
child
,
*
dir
=
file
->
f_path
.
dentry
;
struct
qstr
qname
=
QSTR_INIT
(
name
,
len
);
struct
inode
*
inode
;
struct
inode
*
inode
;
struct
qstr
qname
;
unsigned
type
;
ino_t
ino
=
0
;
ino_t
ino
;
unsigned
type
=
DT_UNKNOWN
;
qname
.
name
=
name
;
child
=
d_hash_and_lookup
(
dir
,
&
qname
);
qname
.
len
=
len
;
qname
.
hash
=
full_name_hash
(
name
,
len
);
child
=
d_lookup
(
dir
,
&
qname
);
if
(
!
child
)
{
if
(
!
child
)
{
struct
dentry
*
new
;
child
=
d_alloc
(
dir
,
&
qname
);
new
=
d_alloc
(
dir
,
&
qname
);
if
(
!
child
)
if
(
new
)
{
goto
end_instantiate
;
child
=
ERR_PTR
(
instantiate
(
dir
->
d_inode
,
new
,
task
,
ptr
));
if
(
instantiate
(
dir
->
d_inode
,
child
,
task
,
ptr
)
<
0
)
{
if
(
child
)
dput
(
child
);
dput
(
new
);
goto
end_instantiate
;
else
child
=
new
;
}
}
}
}
if
(
!
child
||
IS_ERR
(
child
)
||
!
child
->
d_inode
)
goto
end_instantiate
;
inode
=
child
->
d_inode
;
inode
=
child
->
d_inode
;
ino
=
inode
->
i_ino
;
ino
=
inode
->
i_ino
;
type
=
inode
->
i_mode
>>
12
;
type
=
inode
->
i_mode
>>
12
;
dput
(
child
);
dput
(
child
);
end_instantiate:
if
(
!
ino
)
ino
=
find_inode_number
(
dir
,
&
qname
);
if
(
!
ino
)
ino
=
1
;
return
dir_emit
(
ctx
,
name
,
len
,
ino
,
type
);
return
dir_emit
(
ctx
,
name
,
len
,
ino
,
type
);
end_instantiate:
return
dir_emit
(
ctx
,
name
,
len
,
1
,
DT_UNKNOWN
);
}
}
#ifdef CONFIG_CHECKPOINT_RESTORE
#ifdef CONFIG_CHECKPOINT_RESTORE
...
...
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