linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 04/16] dcache: Replace smp_read_barrier_depends() with lockless_dereference()
       [not found] <1415906662-4576-1-git-send-email-bobby.prani@gmail.com>
@ 2014-11-13 19:24 ` Pranith Kumar
  2014-11-13 19:24 ` [PATCH 05/16] overlayfs: " Pranith Kumar
  1 sibling, 0 replies; 3+ messages in thread
From: Pranith Kumar @ 2014-11-13 19:24 UTC (permalink / raw)
  To: Alexander Viro, linux-fsdevel, open list; +Cc: paulmck

Recently lockless_dereference() was added which can be used in place of
hard-coding smp_read_barrier_depends(). The following PATCH makes the change.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 fs/dcache.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index a6c5d7e..27b8b5b 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -230,8 +230,7 @@ static inline int dentry_cmp(const struct dentry *dentry, const unsigned char *c
 	 * early because the data cannot match (there can
 	 * be no NUL in the ct/tcount data)
 	 */
-	cs = ACCESS_ONCE(dentry->d_name.name);
-	smp_read_barrier_depends();
+	cs = lockless_dereference(dentry->d_name.name);
 	return dentry_string_cmp(cs, ct, tcount);
 }
 
@@ -2714,10 +2713,8 @@ static int prepend(char **buffer, int *buflen, const char *str, int namelen)
 static int prepend_name(char **buffer, int *buflen, struct qstr *name)
 {
 	const char *dname = ACCESS_ONCE(name->name);
-	u32 dlen = ACCESS_ONCE(name->len);
 	char *p;
-
-	smp_read_barrier_depends();
+	u32 dlen = lockless_dereference(name->len);
 
 	*buflen -= dlen + 1;
 	if (*buflen < 0)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 05/16] overlayfs: Replace smp_read_barrier_depends() with lockless_dereference()
       [not found] <1415906662-4576-1-git-send-email-bobby.prani@gmail.com>
  2014-11-13 19:24 ` [PATCH 04/16] dcache: Replace smp_read_barrier_depends() with lockless_dereference() Pranith Kumar
@ 2014-11-13 19:24 ` Pranith Kumar
  2014-11-17 10:35   ` Miklos Szeredi
  1 sibling, 1 reply; 3+ messages in thread
From: Pranith Kumar @ 2014-11-13 19:24 UTC (permalink / raw)
  To: Miklos Szeredi, open list:OVERLAYFS FILESYSTEM, open list; +Cc: paulmck

Recently lockless_dereference() was added which can be used in place of
hard-coding smp_read_barrier_depends(). The following PATCH makes the change.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 fs/overlayfs/super.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 08b704c..b0f050e 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -84,12 +84,10 @@ 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)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 05/16] overlayfs: Replace smp_read_barrier_depends() with lockless_dereference()
  2014-11-13 19:24 ` [PATCH 05/16] overlayfs: " Pranith Kumar
@ 2014-11-17 10:35   ` Miklos Szeredi
  0 siblings, 0 replies; 3+ messages in thread
From: Miklos Szeredi @ 2014-11-17 10:35 UTC (permalink / raw)
  To: Pranith Kumar; +Cc: open list:OVERLAYFS FILESYSTEM, open list, Paul McKenney

On Thu, Nov 13, 2014 at 8:24 PM, Pranith Kumar <bobby.prani@gmail.com> wrote:
> Recently lockless_dereference() was added which can be used in place of
> hard-coding smp_read_barrier_depends(). The following PATCH makes the change.
>
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> ---
>  fs/overlayfs/super.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> index 08b704c..b0f050e 100644
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
> @@ -84,12 +84,10 @@ 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)
> --
> 1.9.1
>

Thanks, already in overlayfs-next branch of

  git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs.git overlayfs-next

Thanks,
Miklos

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-17 10:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1415906662-4576-1-git-send-email-bobby.prani@gmail.com>
2014-11-13 19:24 ` [PATCH 04/16] dcache: Replace smp_read_barrier_depends() with lockless_dereference() Pranith Kumar
2014-11-13 19:24 ` [PATCH 05/16] overlayfs: " Pranith Kumar
2014-11-17 10:35   ` Miklos Szeredi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).