linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH] cramfs_lookup(): use d_splice_alias()
@ 2018-05-13 21:12 Al Viro
  2018-05-13 21:29 ` Nicolas Pitre
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2018-05-13 21:12 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: nico, Pitre, Nicolas


simpler code that way, actually

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 fs/cramfs/inode.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index 017b0ab19bc4..4756e9daa0b2 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -808,10 +808,7 @@ static struct dentry *cramfs_lookup(struct inode *dir, struct dentry *dentry, un
 	}
 out:
 	mutex_unlock(&read_mutex);
-	if (IS_ERR(inode))
-		return ERR_CAST(inode);
-	d_add(dentry, inode);
-	return NULL;
+	return d_splice_alias(inode, dentry);
 }
 
 static int cramfs_readpage(struct file *file, struct page *page)
-- 
2.11.0

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

* Re: [RFC][PATCH] cramfs_lookup(): use d_splice_alias()
  2018-05-13 21:12 [RFC][PATCH] cramfs_lookup(): use d_splice_alias() Al Viro
@ 2018-05-13 21:29 ` Nicolas Pitre
  2018-05-13 21:32   ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Pitre @ 2018-05-13 21:29 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel

On Sun, 13 May 2018, Al Viro wrote:

> 
> simpler code that way, actually
> 
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Agreed.

Acked-by: Nicolas Pitre <nico@linaro.org>

Please feel free to carry this patch in your repo as you see fit. Mine 
is empty wrt cramfs at the moment and generating a pull req to Linus to 
bounce only one patch from you would be silly.


> ---
>  fs/cramfs/inode.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
> index 017b0ab19bc4..4756e9daa0b2 100644
> --- a/fs/cramfs/inode.c
> +++ b/fs/cramfs/inode.c
> @@ -808,10 +808,7 @@ static struct dentry *cramfs_lookup(struct inode *dir, struct dentry *dentry, un
>  	}
>  out:
>  	mutex_unlock(&read_mutex);
> -	if (IS_ERR(inode))
> -		return ERR_CAST(inode);
> -	d_add(dentry, inode);
> -	return NULL;
> +	return d_splice_alias(inode, dentry);
>  }
>  
>  static int cramfs_readpage(struct file *file, struct page *page)
> -- 
> 2.11.0
> 
> 
> 

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

* Re: [RFC][PATCH] cramfs_lookup(): use d_splice_alias()
  2018-05-13 21:29 ` Nicolas Pitre
@ 2018-05-13 21:32   ` Al Viro
  0 siblings, 0 replies; 3+ messages in thread
From: Al Viro @ 2018-05-13 21:32 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: Al Viro, linux-fsdevel

On Sun, May 13, 2018 at 05:29:14PM -0400, Nicolas Pitre wrote:
> On Sun, 13 May 2018, Al Viro wrote:
> 
> > 
> > simpler code that way, actually
> > 
> > Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> 
> Agreed.
> 
> Acked-by: Nicolas Pitre <nico@linaro.org>
> 
> Please feel free to carry this patch in your repo as you see fit. Mine 
> is empty wrt cramfs at the moment and generating a pull req to Linus to 
> bounce only one patch from you would be silly.

Sure; apologies for duplicate you'll get - I should've used git-send-email to
start with ;-/

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

end of thread, other threads:[~2018-05-13 21:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-13 21:12 [RFC][PATCH] cramfs_lookup(): use d_splice_alias() Al Viro
2018-05-13 21:29 ` Nicolas Pitre
2018-05-13 21:32   ` Al Viro

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).