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
427c77d4
Commit
427c77d4
authored
Oct 12, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d_add_ci() should just accept a hashed exact match if it finds one
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
ca5358ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
39 deletions
+7
-39
fs/dcache.c
fs/dcache.c
+7
-39
No files found.
fs/dcache.c
View file @
427c77d4
...
...
@@ -1888,15 +1888,11 @@ struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode,
* if not go ahead and create it now.
*/
found
=
d_hash_and_lookup
(
dentry
->
d_parent
,
name
);
if
(
unlikely
(
IS_ERR
(
found
)))
goto
err_out
;
if
(
!
found
)
{
new
=
d_alloc
(
dentry
->
d_parent
,
name
);
if
(
!
new
)
{
found
=
ERR_PTR
(
-
ENOMEM
);
goto
err_out
;
}
}
else
{
found
=
d_splice_alias
(
inode
,
new
);
if
(
found
)
{
dput
(
new
);
...
...
@@ -1904,37 +1900,9 @@ struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode,
}
return
new
;
}
/*
* If a matching dentry exists, and it's not negative use it.
*
* Decrement the reference count to balance the iget() done
* earlier on.
*/
if
(
found
->
d_inode
)
{
if
(
unlikely
(
found
->
d_inode
!=
inode
))
{
/* This can't happen because bad inodes are unhashed. */
BUG_ON
(
!
is_bad_inode
(
inode
));
BUG_ON
(
!
is_bad_inode
(
found
->
d_inode
));
}
iput
(
inode
);
return
found
;
}
/*
* Negative dentry: instantiate it unless the inode is a directory and
* already has a dentry.
*/
new
=
d_splice_alias
(
inode
,
found
);
if
(
new
)
{
dput
(
found
);
found
=
new
;
}
return
found
;
err_out:
iput
(
inode
);
return
found
;
}
EXPORT_SYMBOL
(
d_add_ci
);
...
...
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