mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Haifeng Xu <haifeng.xu@shopee.com>
Cc: mszeredi@redhat.com, bigeasy@linutronix.de, mcgrof@kernel.org,
	xiubli@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] vfs: clean up d_backing_inode() function
Date: Fri, 21 Apr 2023 04:34:56 +0100	[thread overview]
Message-ID: <20230421033456.GC3390869@ZenIV> (raw)
In-Reply-To: <2b0e06e0-5dd4-8ca7-6d85-b492468fd71a@shopee.com>

On Fri, Apr 21, 2023 at 10:50:05AM +0800, Haifeng Xu wrote:
> 
> 
> On 2023/4/21 04:45, Al Viro wrote:
> > On Wed, Apr 19, 2023 at 10:47:04AM +0000, Haifeng Xu wrote:
> >> d_backing_inode() does the same thing with d_inode(), so using
> >> d_inode() to get the inode of dentry instead of d_backing_inode().
> >>
> >> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
> >> Suggested-by: Miklos Szeredi <mszeredi@redhat.com>
> > 
> > Fine by me, but generally that kind of search-and-replace is
> > better done differently:
> > 
> > 1) patch replacing the definition of d_backing_inode() with
> > #define d_backing_inode d_inode
> > 
> > 2) mail to Linus, asking to do mechanical search-and-replace
> > just prior to -rc1; see e.g. 7c0f6ba682b9 for example of
> > that being done.  In this case the script would be
> > sed -i -e "s/\<d_backing_inode\>/d_inode/g" $(git grep -l -w "d_backing_inode")
> > sed -i -e "/#define d_inode d_inode/d" include/linux/dentry.h
> 
> Thanks for your suggestion.
> 
> The file "include/linux/dentry.h" doesn't exist, do you mean "include/linux/dcache.h"?

Yes.

> By the way, why we need to add a definiton first and delete it later instead of replacing 
> the "d_backing_inode" directly?

Because it's much harder to do in a sed script ;-)  Taking out one line is
easier than doing the same to comment + definition.  Seriously, try it; it's
doable, but it's not fun to write and even less so - to read.

> In addition, there's another patch need to be reviewed.
> link: https://lore.kernel.org/all/20230419072736.172593-1-haifeng.xu@shopee.com/

No problems with that one.

      reply	other threads:[~2023-04-21  3:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19  7:27 [PATCH " Haifeng Xu
2023-04-19  8:05 ` Miklos Szeredi
2023-04-19  9:32   ` Haifeng Xu
2023-04-19 10:47   ` [PATCH v2 " Haifeng Xu
2023-04-20 20:45     ` Al Viro
2023-04-21  2:50       ` Haifeng Xu
2023-04-21  3:34         ` Al Viro [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230421033456.GC3390869@ZenIV \
    --to=viro@zeniv.linux.org.uk \
    --cc=bigeasy@linutronix.de \
    --cc=haifeng.xu@shopee.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=xiubli@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®