mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Haifeng Xu <haifeng.xu@shopee.com>
To: Miklos Szeredi <mszeredi@redhat.com>
Cc: viro@zeniv.linux.org.uk, bigeasy@linutronix.de,
	mcgrof@kernel.org, xiubli@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] vfs: clean up d_backing_inode() function
Date: Wed, 19 Apr 2023 17:32:32 +0800	[thread overview]
Message-ID: <9413fc25-e7d6-718f-18f2-cf0b9ac60b9c@shopee.com> (raw)
In-Reply-To: <CAOssrKfCiByavRNekRUOCv==AEvWAO6B6=tAASyYdvWj9XRhBw@mail.gmail.com>



On 2023/4/19 16:05, Miklos Szeredi wrote:
> If we are touching that function, I'd just get rid of it completely
> (s/d_backing_inode/d_inode/).
> 
> Thanks,
> Miklos
> 
> On Wed, Apr 19, 2023 at 9:27 AM Haifeng Xu <haifeng.xu@shopee.com> wrote:
>>
>> Using an extra variable to record the inode is unnecessary, return it
>> directly.
>>
>> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
>> ---
>>  include/linux/dcache.h | 4 +---
>>  1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/include/linux/dcache.h b/include/linux/dcache.h
>> index 13023c7211d6..97324b6434e5 100644
>> --- a/include/linux/dcache.h
>> +++ b/include/linux/dcache.h
>> @@ -540,9 +540,7 @@ static inline struct inode *d_inode_rcu(const struct dentry *dentry)
>>   */
>>  static inline struct inode *d_backing_inode(const struct dentry *upper)
>>  {
>> -       struct inode *inode = upper->d_inode;
>> -
>> -       return inode;
>> +       return upper->d_inode;
>>  }
>>
>>  /**
>> --
>> 2.25.1
>>
> 

Yes, d_backing_inode() does the same thing with d_inode(). Thanks for your suggestion.

  reply	other threads:[~2023-04-19  9:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19  7:27 Haifeng Xu
2023-04-19  8:05 ` Miklos Szeredi
2023-04-19  9:32   ` Haifeng Xu [this message]
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

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=9413fc25-e7d6-718f-18f2-cf0b9ac60b9c@shopee.com \
    --to=haifeng.xu@shopee.com \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    --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®