On 04/05/2013 01:12 PM, Al Viro wrote:
@@ -635,22 +640,14 @@ struct dentry *dget_parent(struct dentry *dentry)
{
struct dentry *ret;
-repeat:
- /*
-* Don't need rcu_dereference because we re-check it was correct under
-* the lock.
-*/
rcu_read_lock
> @@ -635,22 +640,14 @@ struct dentry *dget_parent(struct dentry *dentry)
> {
> struct dentry *ret;
>
> -repeat:
> - /*
> - * Don't need rcu_dereference because we re-check it was correct under
> - * the lock.
> - */
> rcu_read_lock();
> - ret = dentry->d_paren
The current code takes the dentry's d_lock lock whenever the d_count
reference count is being updated. In reality, nothing big really
happens until d_count goes to 0 in dput(). So it is not necessary to
take the lock if the reference count won't go to 0.
Without using a lock, multiple threads may
3 matches
Mail list logo