xfs: rename xfs_buf_get_nodaddr to be more appropriate
xfs_buf_get_nodaddr() is really used to allocate a buffer that is uncached. While it is not directly assigned a disk address, the fact that they are not cached is a more important distinction. With the upcoming uncached buffer read primitive, we should be consistent with this disctinction. While there, make page allocation in xfs_buf_get_nodaddr() safe against memory reclaim re-entrancy into the filesystem by allowing a flags parameter to be passed. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Alex Elder <aelder@sgi.com>
This commit is contained in:
@@ -707,9 +707,10 @@ xfs_buf_associate_memory(
|
||||
}
|
||||
|
||||
xfs_buf_t *
|
||||
xfs_buf_get_noaddr(
|
||||
xfs_buf_get_uncached(
|
||||
struct xfs_buftarg *target,
|
||||
size_t len,
|
||||
xfs_buftarg_t *target)
|
||||
int flags)
|
||||
{
|
||||
unsigned long page_count = PAGE_ALIGN(len) >> PAGE_SHIFT;
|
||||
int error, i;
|
||||
@@ -725,7 +726,7 @@ xfs_buf_get_noaddr(
|
||||
goto fail_free_buf;
|
||||
|
||||
for (i = 0; i < page_count; i++) {
|
||||
bp->b_pages[i] = alloc_page(GFP_KERNEL);
|
||||
bp->b_pages[i] = alloc_page(xb_to_gfp(flags));
|
||||
if (!bp->b_pages[i])
|
||||
goto fail_free_mem;
|
||||
}
|
||||
@@ -740,7 +741,7 @@ xfs_buf_get_noaddr(
|
||||
|
||||
xfs_buf_unlock(bp);
|
||||
|
||||
trace_xfs_buf_get_noaddr(bp, _RET_IP_);
|
||||
trace_xfs_buf_get_uncached(bp, _RET_IP_);
|
||||
return bp;
|
||||
|
||||
fail_free_mem:
|
||||
|
Reference in New Issue
Block a user