ovl: use lockless_dereference() for upperdentry
authorMiklos Szeredi <mszeredi@suse.cz>
Thu, 20 Nov 2014 15:40:01 +0000 (16:40 +0100)
committerMiklos Szeredi <mszeredi@suse.cz>
Thu, 20 Nov 2014 15:40:01 +0000 (16:40 +0100)
Don't open code lockless_dereference() in ovl_upperdentry_dereference().

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/overlayfs/super.c

index eee7a62e1c0e6ddf171ff08350a422d1d433d19f..f16d318b71f8bbe4e77f8a3214e616101848e49c 100644 (file)
@@ -84,12 +84,7 @@ enum ovl_path_type ovl_path_type(struct dentry *dentry)
 
 static struct dentry *ovl_upperdentry_dereference(struct ovl_entry *oe)
 {
-       struct dentry *upperdentry = ACCESS_ONCE(oe->__upperdentry);
-       /*
-        * Make sure to order reads to upperdentry wrt ovl_dentry_update()
-        */
-       smp_read_barrier_depends();
-       return upperdentry;
+       return lockless_dereference(oe->__upperdentry);
 }
 
 void ovl_path_upper(struct dentry *dentry, struct path *path)