forked from luck/tmp_suning_uos_patched
xfs: remove xfs_zone_{alloc,zalloc} helpers
All their users have been converted to use MM API directly, no need to keep them around anymore. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com>
This commit is contained in:
parent
ca4f258990
commit
bae633a4a2
|
@ -115,24 +115,3 @@ kmem_realloc(const void *old, size_t newsize, xfs_km_flags_t flags)
|
||||||
congestion_wait(BLK_RW_ASYNC, HZ/50);
|
congestion_wait(BLK_RW_ASYNC, HZ/50);
|
||||||
} while (1);
|
} while (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
|
||||||
kmem_zone_alloc(kmem_zone_t *zone, xfs_km_flags_t flags)
|
|
||||||
{
|
|
||||||
int retries = 0;
|
|
||||||
gfp_t lflags = kmem_flags_convert(flags);
|
|
||||||
void *ptr;
|
|
||||||
|
|
||||||
trace_kmem_zone_alloc(kmem_cache_size(zone), flags, _RET_IP_);
|
|
||||||
do {
|
|
||||||
ptr = kmem_cache_alloc(zone, lflags);
|
|
||||||
if (ptr || (flags & KM_MAYFAIL))
|
|
||||||
return ptr;
|
|
||||||
if (!(++retries % 100))
|
|
||||||
xfs_err(NULL,
|
|
||||||
"%s(%u) possible memory allocation deadlock in %s (mode:0x%x)",
|
|
||||||
current->comm, current->pid,
|
|
||||||
__func__, lflags);
|
|
||||||
congestion_wait(BLK_RW_ASYNC, HZ/50);
|
|
||||||
} while (1);
|
|
||||||
}
|
|
||||||
|
|
|
@ -85,14 +85,6 @@ kmem_zalloc_large(size_t size, xfs_km_flags_t flags)
|
||||||
#define kmem_zone kmem_cache
|
#define kmem_zone kmem_cache
|
||||||
#define kmem_zone_t struct kmem_cache
|
#define kmem_zone_t struct kmem_cache
|
||||||
|
|
||||||
extern void *kmem_zone_alloc(kmem_zone_t *, xfs_km_flags_t);
|
|
||||||
|
|
||||||
static inline void *
|
|
||||||
kmem_zone_zalloc(kmem_zone_t *zone, xfs_km_flags_t flags)
|
|
||||||
{
|
|
||||||
return kmem_zone_alloc(zone, flags | KM_ZERO);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct page *
|
static inline struct page *
|
||||||
kmem_to_page(void *addr)
|
kmem_to_page(void *addr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3677,7 +3677,6 @@ DEFINE_KMEM_EVENT(kmem_alloc);
|
||||||
DEFINE_KMEM_EVENT(kmem_alloc_io);
|
DEFINE_KMEM_EVENT(kmem_alloc_io);
|
||||||
DEFINE_KMEM_EVENT(kmem_alloc_large);
|
DEFINE_KMEM_EVENT(kmem_alloc_large);
|
||||||
DEFINE_KMEM_EVENT(kmem_realloc);
|
DEFINE_KMEM_EVENT(kmem_realloc);
|
||||||
DEFINE_KMEM_EVENT(kmem_zone_alloc);
|
|
||||||
|
|
||||||
TRACE_EVENT(xfs_check_new_dalign,
|
TRACE_EVENT(xfs_check_new_dalign,
|
||||||
TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino),
|
TP_PROTO(struct xfs_mount *mp, int new_dalign, xfs_ino_t calc_rootino),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user