[Linux-cachefs] [PATCH v12 3/4] xfs: refactor the usage around xfs_trans_context_{set, clear}

Yafang Shao laoar.shao at gmail.com
Tue Dec 15 04:39:05 UTC 2020


On Tue, Dec 15, 2020 at 9:12 AM Dave Chinner <david at fromorbit.com> wrote:
>
> On Tue, Dec 15, 2020 at 08:42:08AM +0800, Yafang Shao wrote:
> > On Tue, Dec 15, 2020 at 5:08 AM Dave Chinner <david at fromorbit.com> wrote:
> > > On Sun, Dec 13, 2020 at 05:09:02PM +0800, Yafang Shao wrote:
> > > > On Thu, Dec 10, 2020 at 3:52 AM Darrick J. Wong <darrick.wong at oracle.com> wrote:
> > > > > On Wed, Dec 09, 2020 at 09:11:45PM +0800, Yafang Shao wrote:
> > > static inline void
> > > xfs_trans_context_clear(struct xfs_trans *tp)
> > > {
> > >         /*
> > >          * If xfs_trans_context_swap() handed the NOFS context to a
> > >          * new transaction we do not clear the context here.
> > >          */
> > >         if (current->journal_info != tp)
> >
> > current->journal_info hasn't been used in patch #3, that will make
> > patch #3 a little more complex.
> > We have to do some workaround in patch #3. I will think about it.
>
> What I wrote is how the function should look at the end of the patch
> series.  Do not add the current->journal_info parts of it until the
> patch that introduces the current->journal_info tracking.
>

I know what you meant.
While I mean we have to do some hack, as suggested by Darrrick that
"set NOFS in the old transaction's
t_pflags so that when we clear the context on the old transaction we
don't actually change the thread's NOFS state." in patch #3 and then
remove it in patch #4.


-- 
Thanks
Yafang




More information about the Linux-cachefs mailing list