aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMarc-AndrĂ© Lureau <[email protected]>2018-01-31 16:19:25 -0800
committerLinus Torvalds <[email protected]>2018-01-31 17:18:39 -0800
commitff62a34210441103108d435ae8a00a777c4dcb99 (patch)
tree02df0de924782bd15978220e80180b04b669c358 /include/linux
parentda14c1e524a56d62b846f73ae44fd722d63747b6 (diff)
hugetlb: implement memfd sealing
Implements memfd sealing, similar to shmem: - WRITE: deny fallocate(PUNCH_HOLE). mmap() write is denied in memfd_add_seals(). write() doesn't exist for hugetlbfs. - SHRINK: added similar check as shmem_setattr() - GROW: added similar check as shmem_setattr() & shmem_fallocate() Except write() operation that doesn't exist with hugetlbfs, that should make sealing as close as it can be to shmem support. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Marc-AndrĂ© Lureau <[email protected]> Reviewed-by: Mike Kravetz <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Michal Hocko <[email protected]> Cc: David Herrmann <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hugetlb.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index d02301e3f232..944e6e8bd572 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -273,6 +273,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
struct hugetlbfs_inode_info {
struct shared_policy policy;
struct inode vfs_inode;
+ unsigned int seals;
};
static inline struct hugetlbfs_inode_info *HUGETLBFS_I(struct inode *inode)