lkml.org 
[lkml]   [2018]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 3/3] mm: restructure memfd code
From
Date
On 04/15/2018 12:21 PM, Mike Kravetz wrote:
> With the addition of memfd hugetlbfs support, we now have the situation
> where memfd depends on TMPFS -or- HUGETLBFS. Previously, memfd was only
> supported on tmpfs, so it made sense that the code resided in shmem.c.
> In the current code, memfd is only functional if TMPFS is defined. If
> HUGETLFS is defined and TMPFS is not defined, then memfd functionality
> will not be available for hugetlbfs. This does not cause BUGs, just a
> lack of potentially desired functionality.
>
> Code is restructured in the following way:
> - include/linux/memfd.h is a new file containing memfd specific
> definitions previously contained in shmem_fs.h.
> - mm/memfd.c is a new file containing memfd specific code previously
> contained in shmem.c.
> - memfd specific code is removed from shmem_fs.h and shmem.c.
> - A new config option MEMFD_CREATE is added that is defined if TMPFS
> or HUGETLBFS is defined.
>
> No functional changes are made to the code: restructuring only.
>
> Signed-off-by: Mike Kravetz <mike.kravetz@oracle.com>
> ---
> fs/Kconfig | 3 +
> fs/fcntl.c | 2 +-
> include/linux/memfd.h | 16 +++
> include/linux/shmem_fs.h | 13 --
> mm/Makefile | 1 +
> mm/memfd.c | 345 +++++++++++++++++++++++++++++++++++++++++++++++
> mm/shmem.c | 324 --------------------------------------------
> 7 files changed, 366 insertions(+), 338 deletions(-)
> create mode 100644 include/linux/memfd.h
> create mode 100644 mm/memfd.c

Reviewed-by: Khalid Aziz <khalid.aziz@oracle.com>

\
 
 \ /
  Last update: 2018-04-18 01:44    [W:0.081 / U:1.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site