File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -756,28 +756,6 @@ void d_mark_dontcache(struct inode *inode)
756756}
757757EXPORT_SYMBOL (d_mark_dontcache );
758758
759- /*
760- * Finish off a dentry we've decided to kill.
761- * dentry->d_lock must be held, returns with it unlocked.
762- * Returns dentry requiring refcount drop, or NULL if we're done.
763- */
764- static struct dentry * dentry_kill (struct dentry * dentry )
765- __releases (dentry - > d_lock )
766- {
767-
768- dentry -> d_lockref .count -- ;
769- rcu_read_lock ();
770- if (likely (lock_for_kill (dentry ))) {
771- struct dentry * parent = dentry -> d_parent ;
772- rcu_read_unlock ();
773- __dentry_kill (dentry );
774- return parent != dentry ? parent : NULL ;
775- }
776- rcu_read_unlock ();
777- spin_unlock (& dentry -> d_lock );
778- return NULL ;
779- }
780-
781759/*
782760 * Try to do a lockless dput(), and return whether that was successful.
783761 *
@@ -915,9 +893,18 @@ void dput(struct dentry *dentry)
915893 }
916894
917895 /* Slow case: now with the dentry lock held */
918- rcu_read_unlock ();
919- dentry -> d_lockref .count = 1 ;
920- dentry = dentry_kill (dentry );
896+ if (likely (lock_for_kill (dentry ))) {
897+ struct dentry * parent = dentry -> d_parent ;
898+ rcu_read_unlock ();
899+ __dentry_kill (dentry );
900+ if (dentry == parent )
901+ return ;
902+ dentry = parent ;
903+ } else {
904+ rcu_read_unlock ();
905+ spin_unlock (& dentry -> d_lock );
906+ return ;
907+ }
921908 }
922909}
923910EXPORT_SYMBOL (dput );
You can’t perform that action at this time.
0 commit comments