> + ptr = kmem_alloc(size, flags | KM_MAYFAIL); > + if (ptr) { > + if (!((uintptr_t)ptr & align_mask)) > + return ptr; > + kfree(ptr); > + } > + return __kmem_vmalloc(size, flags); Not that іt really matters, I'd write so that the fast path is the main return: ptr = kmem_alloc(size, flags | KM_MAYFAIL); if (unlikely(!ptr || (intptr_t)ptr & align_mask)) { kfree(ptr); ptr = __kmem_vmalloc(size, flags); } return ptr; > + int align_mask = xfs_buftarg_dma_alignment(bp->b_target); > + bp->b_addr = kmem_alloc_io(size, align_mask, KM_NOFS); The int vs an unsigned type here looks a little odd, but I guess that just propagates from queue_dma_alignment. Otherwise looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>