/* The modification state of any associated pages is left unchanged. The buffer most not be on any hash - use xfs_buf_rele instead for hashed and refcounted buffers  */
void xfs_buf_free(xfs_buf_t *bp)
/* The modification state of any associated pages is left unchanged. The buffer most not be on any hash - use xfs_buf_rele instead for hashed and refcounted buffers  */
void xfs_buf_free(xfs_buf_t *bp)
{
	trace_xfs_buf_free(bp, _RET_IP_);
	ASSERT(list_empty(&bp->b_hash_list));
	if (bp->b_flags & (_XBF_PAGE_CACHE|_XBF_PAGES)) {
		uint		i;
		if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1))
			free_address(bp->b_addr - bp->b_offset);
		for (i = 0; i < bp->b_page_count; i++) {
			struct page	*page = bp->b_pages[i];
			if (bp->b_flags & _XBF_PAGE_CACHE)
				ASSERT(!PagePrivate(page));
			page_cache_release(page);
		}
	}
	_xfs_buf_free_pages(bp);
	xfs_buf_deallocate(bp);
}