linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: get rid of the ip parameter to xchk_setup_*
Date: Thu, 8 Apr 2021 09:30:58 -0700	[thread overview]
Message-ID: <20210408163058.GU3957620@magnolia> (raw)
In-Reply-To: <20210408121933.GB3848544@infradead.org>

On Thu, Apr 08, 2021 at 01:19:33PM +0100, Christoph Hellwig wrote:
> On Wed, Apr 07, 2021 at 06:01:14PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Now that the scrub context stores a pointer to the file that was used to
> > invoke the scrub call, the struct xfs_inode pointer that we passed to
> > all the setup functions is no longer necessary.  This is only ever used
> > if the caller wants us to scrub the metadata of the open file.
> 
> Even before we had the xfs_inode in struct xfs_scrub, so why detour
> through struct file?

xfs_scrub.fil[ep] is the file corresponding to the fd that userspace
used to call scrub.

xfs_scrub.ip is the file that we're actively checking, if applicable.
This can be a different file than filp if we're checking file-based
metadata such as the rt bitmap and summary files; or if the caller is
doing scrub-by-handle for a non-regular file (e.g. open the root
directory and pass in the ino/gen of a symlink file to check that the
symlink is ok).

Let me respin this with added struct commentary in scrub.h.

--D

  reply	other threads:[~2021-04-08 16:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08  1:01 [PATCH] xfs: get rid of the ip parameter to xchk_setup_* Darrick J. Wong
2021-04-08  7:50 ` Chandan Babu R
2021-04-08 12:19 ` Christoph Hellwig
2021-04-08 16:30   ` Darrick J. Wong [this message]
2021-04-08 20:08 ` [PATCH v2] " Darrick J. Wong
2021-04-09  5:31   ` Christoph Hellwig

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=20210408163058.GU3957620@magnolia \
    --to=djwong@kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).