dput(): turn into explicit while() loop
No need to mess with gotos when the code yielded by straight while() isn't any worse... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
9c5f1d3019
commit
1088a6408c
31
fs/dcache.c
31
fs/dcache.c
|
@ -828,29 +828,24 @@ static inline bool fast_dput(struct dentry *dentry)
|
||||||
*/
|
*/
|
||||||
void dput(struct dentry *dentry)
|
void dput(struct dentry *dentry)
|
||||||
{
|
{
|
||||||
if (unlikely(!dentry))
|
while (dentry) {
|
||||||
return;
|
might_sleep();
|
||||||
|
|
||||||
repeat:
|
rcu_read_lock();
|
||||||
might_sleep();
|
if (likely(fast_dput(dentry))) {
|
||||||
|
rcu_read_unlock();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rcu_read_lock();
|
/* Slow case: now with the dentry lock held */
|
||||||
if (likely(fast_dput(dentry))) {
|
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Slow case: now with the dentry lock held */
|
if (likely(retain_dentry(dentry))) {
|
||||||
rcu_read_unlock();
|
spin_unlock(&dentry->d_lock);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (likely(retain_dentry(dentry))) {
|
dentry = dentry_kill(dentry);
|
||||||
spin_unlock(&dentry->d_lock);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
dentry = dentry_kill(dentry);
|
|
||||||
if (dentry) {
|
|
||||||
goto repeat;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(dput);
|
EXPORT_SYMBOL(dput);
|
||||||
|
|
Loading…
Reference in New Issue