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
17648b87
Commit
17648b87
authored
Jul 24, 2016
by
Al Viro
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test.d_iput' into work.misc
parents
f4fdace9
550dce01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
35 deletions
+10
-35
fs/dcache.c
fs/dcache.c
+10
-35
No files found.
fs/dcache.c
View file @
17648b87
...
...
@@ -334,43 +334,20 @@ static inline void dentry_rcuwalk_invalidate(struct dentry *dentry)
/*
* Release the dentry's inode, using the filesystem
* d_iput() operation if defined. Dentry has no refcount
* and is unhashed.
*/
static
void
dentry_iput
(
struct
dentry
*
dentry
)
__releases
(
dentry
->
d_lock
)
__releases
(
dentry
->
d_inode
->
i_lock
)
{
struct
inode
*
inode
=
dentry
->
d_inode
;
if
(
inode
)
{
__d_clear_type_and_inode
(
dentry
);
hlist_del_init
(
&
dentry
->
d_u
.
d_alias
);
spin_unlock
(
&
dentry
->
d_lock
);
spin_unlock
(
&
inode
->
i_lock
);
if
(
!
inode
->
i_nlink
)
fsnotify_inoderemove
(
inode
);
if
(
dentry
->
d_op
&&
dentry
->
d_op
->
d_iput
)
dentry
->
d_op
->
d_iput
(
dentry
,
inode
);
else
iput
(
inode
);
}
else
{
spin_unlock
(
&
dentry
->
d_lock
);
}
}
/*
* Release the dentry's inode, using the filesystem
* d_iput() operation if defined. dentry remains in-use.
* d_iput() operation if defined.
*/
static
void
dentry_unlink_inode
(
struct
dentry
*
dentry
)
__releases
(
dentry
->
d_lock
)
__releases
(
dentry
->
d_inode
->
i_lock
)
{
struct
inode
*
inode
=
dentry
->
d_inode
;
bool
hashed
=
!
d_unhashed
(
dentry
);
if
(
hashed
)
raw_write_seqcount_begin
(
&
dentry
->
d_seq
);
__d_clear_type_and_inode
(
dentry
);
hlist_del_init
(
&
dentry
->
d_u
.
d_alias
);
if
(
hashed
)
raw_write_seqcount_end
(
&
dentry
->
d_seq
);
spin_unlock
(
&
dentry
->
d_lock
);
spin_unlock
(
&
inode
->
i_lock
);
...
...
@@ -572,12 +549,10 @@ static void __dentry_kill(struct dentry *dentry)
dentry_unlist
(
dentry
,
parent
);
if
(
parent
)
spin_unlock
(
&
parent
->
d_lock
);
dentry_iput
(
dentry
);
/*
* dentry_iput drops the locks, at which point nobody (except
* transient RCU lookups) can reach this dentry.
*/
BUG_ON
(
dentry
->
d_lockref
.
count
>
0
);
if
(
dentry
->
d_inode
)
dentry_unlink_inode
(
dentry
);
else
spin_unlock
(
&
dentry
->
d_lock
);
this_cpu_dec
(
nr_dentry
);
if
(
dentry
->
d_op
&&
dentry
->
d_op
->
d_release
)
dentry
->
d_op
->
d_release
(
dentry
);
...
...
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