[PATCH 1/4] xfs: Don't allocate new buffers on every call to _xfs_buf_find
Christoph Hellwig
hch at infradead.org
Wed Sep 21 06:28:56 CDT 2011
On Wed, Sep 21, 2011 at 04:44:43PM +1000, Dave Chinner wrote:
>
> > And once you touch _xfs_buf_initialize
> > after the core of this patch, please merge it with xfs_buf_allocate into
> > a new xfs_buf_alloc that does the full allocation + initialization and
> > can also replace xfs_buf_get_empty.
>
> Not right now. That restructing can be done separately, probably in
> the same patch set that fixes the API types problems...
That's what I meant - the conversion changes should be part of a larger
patch (-series) to also fix up the API, and this bit.
> > > if (bp == new_bp) {
> > > error = xfs_buf_allocate_memory(bp, flags);
> > > if (error)
> > > goto no_buffer;
> > > + } else
> > > xfs_buf_deallocate(new_bp);
> >
> > I'd recommend moving the call to xfs_buf_allocate_memory into
> > _xfs_buf_find so that it returns a fully allocated buffer. In fact I'd
> > also move the xfs_buf_deallocate(new_bp) into the found side of
> > _xfs_buf_find, avoiding any conditionals in xfs_buf_get.
>
> <sigh>
>
> This code s pretty much as you requested it after the first time I
> posted it.
>
> http://oss.sgi.com/archives/xfs/2011-08/msg00146.html
>
> I'll go rewrite this again, but IMO all you are asking for is for me
> to put a different colour on the bike shed....
We can leave it as-is for now. My suggestion in the previous mail just
went half-way to where it makes most sense after looking at it for a
while.
More information about the xfs
mailing list