[PATCH v8 3/6] mm/gup: Introduce memfd_pin_folios() for pinning memfd folios (v8)
Matthew Wilcox
willy at infradead.org
Sat Dec 16 06:41:34 UTC 2023
On Fri, Dec 15, 2023 at 10:05:33PM -0800, Vivek Kasireddy wrote:
> +++ b/include/linux/memfd.h
> @@ -6,11 +6,16 @@
>
> #ifdef CONFIG_MEMFD_CREATE
> extern long memfd_fcntl(struct file *file, unsigned int cmd, unsigned int arg);
> +extern struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx);
You don't need the 'extern' for functions.
> #else
> static inline long memfd_fcntl(struct file *f, unsigned int c, unsigned int a)
> {
> return -EINVAL;
> }
> +static inline struct page *memfd_alloc_folio(struct file *memfd, pgoff_t idx)
> +{
> + return ERR_PTR(-EINVAL);
> +}
> #endif
Different return types depending on the CONFIG selected ...
More information about the dri-devel
mailing list