[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250828-knicken-erpicht-daacec0648f3@brauner>
Date: Thu, 28 Aug 2025 14:38:44 +0200
From: Christian Brauner <brauner@...nel.org>
To: Mateusz Guzik <mjguzik@...il.com>
Cc: Josef Bacik <josef@...icpanda.com>, linux-fsdevel@...r.kernel.org,
linux-btrfs@...r.kernel.org, kernel-team@...com, linux-ext4@...r.kernel.org,
linux-xfs@...r.kernel.org, viro@...iv.linux.org.uk, amir73il@...il.com
Subject: Re: [PATCH v2 43/54] fs: change inode_is_dirtytime_only to use
refcount
On Wed, Aug 27, 2025 at 12:06:12AM +0200, Mateusz Guzik wrote:
> On Tue, Aug 26, 2025 at 11:39:43AM -0400, Josef Bacik wrote:
> > We don't need the I_WILL_FREE|I_FREEING check, we can use the refcount
> > to see if the inode is valid.
> >
> > Signed-off-by: Josef Bacik <josef@...icpanda.com>
> > ---
> > include/linux/fs.h | 14 +++++++-------
> > 1 file changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/include/linux/fs.h b/include/linux/fs.h
> > index b13d057ad0d7..531a6d0afa75 100644
> > --- a/include/linux/fs.h
> > +++ b/include/linux/fs.h
> > @@ -2628,6 +2628,11 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
> > __mark_inode_dirty(inode, I_DIRTY_SYNC);
> > }
> >
> > +static inline int icount_read(const struct inode *inode)
> > +{
> > + return refcount_read(&inode->i_count);
> > +}
> > +
> > /*
> > * Returns true if the given inode itself only has dirty timestamps (its pages
> > * may still be dirty) and isn't currently being allocated or freed.
> > @@ -2639,8 +2644,8 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
> > */
> > static inline bool inode_is_dirtytime_only(struct inode *inode)
> > {
> > - return (inode->i_state & (I_DIRTY_TIME | I_NEW |
> > - I_FREEING | I_WILL_FREE)) == I_DIRTY_TIME;
> > + return (inode->i_state & (I_DIRTY_TIME | I_NEW)) == I_DIRTY_TIME &&
> > + icount_read(inode);
> > }
> >
> > extern void inc_nlink(struct inode *inode);
> > @@ -3432,11 +3437,6 @@ static inline void __iget(struct inode *inode)
> > refcount_inc(&inode->i_count);
> > }
> >
> > -static inline int icount_read(const struct inode *inode)
> > -{
> > - return refcount_read(&inode->i_count);
> > -}
> > -
> > extern void iget_failed(struct inode *);
> > extern void clear_inode(struct inode *);
> > extern void __destroy_inode(struct inode *);
> > --
> > 2.49.0
> >
>
> nit: I would change the diff introducing icount_read() to already place
> it in the right spot. As is this is going to mess with blame for no good
> reason.
Fwiw, I did that in the preliminaries patch. Just looked at your comment
here.
Powered by blists - more mailing lists