Re: [PATCH 2/7] xfs: cache last bitmap block in realtime allocator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 18, 2023 at 08:19:11AM +0200, Christoph Hellwig wrote:
> On Tue, Oct 17, 2023 at 08:54:23AM -0700, Darrick J. Wong wrote:
> >   * The buffer is returned read and locked.
> > @@ -59,12 +73,32 @@ xfs_rtbuf_get(
> >  	struct xfs_buf		**bpp)		/* output: buffer for the block */
> >  {
> >  	struct xfs_mount	*mp = args->mount;
> > +	struct xfs_buf		**cbpp;		/* cached block buffer */
> > +	xfs_fsblock_t		*cbp;		/* cached block number */
> >  	struct xfs_buf		*bp;		/* block buffer, result */
> >  	struct xfs_inode	*ip;		/* bitmap or summary inode */
> >  	struct xfs_bmbt_irec	map;
> >  	int			nmap = 1;
> >  	int			error;		/* error value */
> >  
> > +	cbpp = issum ? &args->bbuf : &args->sbuf;
> > +	cbp = issum ? &args->bblock : &args->sblock;
> 
> Now that we have the summary/bitmap buffers in the args structure,
> it seems like we can also drop the bp argument from xfs_rtbuf_get and
> just the pointer in the args structue in the callers.

Yeah, I was wondering about that too -- either we take a second refcount
on @bp and pass it out via **bpp, or callers can pluck it from @args
directly and call _cache_relse before @args goes out of scope.

I'll remove **bpp since it's redundant.

--D



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux