]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: Remove kmem_zone_alloc() usage
authorCarlos Maiolino <cmaiolino@redhat.com>
Tue, 15 Sep 2020 19:59:36 +0000 (15:59 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 15 Sep 2020 19:59:36 +0000 (15:59 -0400)
commitd7faa18a17389ad06b5c9fee3b194a18c6570c73
tree19dad1dcb17dfe3897073a3bb3da9b5d01c1149b
parent98c76f9ee6e740e6e2b0b91eea906b14c0eb1ec4
xfs: Remove kmem_zone_alloc() usage

Source kernel commit: 3050bd0bfe706381c36e4b48bf4de465b0ab94f7

Use kmem_cache_alloc() directly.

All kmem_zone_alloc() users pass 0 as flags, which are translated into:
GFP_KERNEL | __GFP_NOWARN, and kmem_zone_alloc() loops forever until the
allocation succeeds.

We can use __GFP_NOFAIL to tell the allocator to loop forever rather
than doing it ourself, and because the allocation will never fail, we do
not need to use __GFP_NOWARN anymore. Hence, all callers can be
converted to use GFP_KERNEL | __GFP_NOFAIL

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: add a comment back in about nofail]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/kmem.h
libxfs/kmem.c
libxfs/xfs_alloc.c
libxfs/xfs_bmap.c