Re: [RFC PATCH 3/8] mm: Use get_unmapped_area_vmflags()

From: kirill.shutemov@xxxxxxxxxxxxxxx
Date: Sat Feb 17 2024 - 07:35:38 EST


On Fri, Feb 16, 2024 at 10:15:05PM +0000, Edgecombe, Rick P wrote:
> On Fri, 2024-02-16 at 14:56 +0200, Kirill A. Shutemov wrote:
> > > +unsigned long
> > > +get_unmapped_area(struct file *file, unsigned long addr, unsigned
> > > long len,
> > > +               unsigned long pgoff, unsigned long flags)
> > > +{
> > > +       return __get_unmapped_area(file, addr, len, pgoff, flags,
> > > 0);
> > > +}
> > >   EXPORT_SYMBOL(get_unmapped_area);
> >
> > Any reason it is not a static inline function in the header file?
>
> get_unmapped_area() doesn't seem to be referenced from any modules. I
> don't think it needs to be exported actually. Maybe it used to be?
>
> It could be a static inline it seems. Why are you thinking it would be
> better?

That's just what I would do for legacy interface wrapper for new function
interface. And save a function call for caller (it shouldn't matter in
this case, but still).

> I think maybe get_unmapped_area() should stay as is, static-inline
> wise, but remove the export, and the newly added __get_unmapped_area()
> should be made static. Does it sound reasonable?

Up to you.

--
Kiryl Shutsemau / Kirill A. Shutemov