On Thu, Dec 03, 2009 at 09:22:28AM +1100, Dave Chinner wrote:
> > kmem_free happily takes a NULL pointer, so this is unessecary.
> Yes, it does, but I wanted to make sure that b_pages had been
> assigned before doing the comparison because this is now
> called unconditionally. I?ll remove the check and retest.
> Hmmm - I suspect that this function needs to NULL b_pages
> in case it _xfs_buf_free_pages() is called prior to calling
Yes, at least for now. Long term we should stop messing with the page array
on a live buffer. The only place where we currently do that is
xfs_buf_associate_memory, which has two callers, one for the log wrap
reserver buffer, and the other in various places in log recovery for
aligned v2 logs.
For the first one we know the max number of pages we might have to deal
with so we can pass it when allocating the buffer, and for the second
one the number of pages can't be bigger than the original number of
pages for the buffer every so there's no need to do the reallocation
game at all.