On Fri, Jun 25, 2021 at 12:30:27PM +1000, Dave Chinner wrote: > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 8ae31622deef..34d88ff00f31 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -830,6 +830,20 @@ static inline void *kvcalloc(size_t n, size_t size, gfp_t flags) > extern void kvfree(const void *addr); > extern void kvfree_sensitive(const void *addr, size_t len); > > +static inline void *kvrealloc(void *p, size_t oldsize, size_t newsize, > + gfp_t flags) > +{ > + void *newp; > + > + if (oldsize >= newsize) > + return p; > + newp = kvmalloc(newsize, flags); > + memcpy(newp, p, oldsize); > + kvfree(p); > + return newp; > +} Why make this an inline function instead of putting it in mm/util.c?