Skip to content

Commit e9d586a

Browse files
elmarcotorvalds
authored andcommitted
shmem: unexport shmem_add_seals()/shmem_get_seals()
Patch series "memfd: add sealing to hugetlb-backed memory", v3. Recently, Mike Kravetz added hugetlbfs support to memfd. However, he didn't add sealing support. One of the reasons to use memfd is to have shared memory sealing when doing IPC or sharing memory with another process with some extra safety. qemu uses shared memory & hugetables with vhost-user (used by dpdk), so it is reasonable to use memfd now instead for convenience and security reasons. This patch (of 9): The functions are called through shmem_fcntl() only. And no danger in removing the EXPORTs as the routines only work with shmem file structs. 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]>
1 parent ab8928b commit e9d586a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

include/linux/shmem_fs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ extern void shmem_uncharge(struct inode *inode, long pages);
112112

113113
#ifdef CONFIG_TMPFS
114114

115-
extern int shmem_add_seals(struct file *file, unsigned int seals);
116-
extern int shmem_get_seals(struct file *file);
117115
extern long shmem_fcntl(struct file *file, unsigned int cmd, unsigned long arg);
118116

119117
#else

mm/shmem.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2722,7 +2722,7 @@ static int shmem_wait_for_pins(struct address_space *mapping)
27222722
F_SEAL_GROW | \
27232723
F_SEAL_WRITE)
27242724

2725-
int shmem_add_seals(struct file *file, unsigned int seals)
2725+
static int shmem_add_seals(struct file *file, unsigned int seals)
27262726
{
27272727
struct inode *inode = file_inode(file);
27282728
struct shmem_inode_info *info = SHMEM_I(inode);
@@ -2791,16 +2791,14 @@ int shmem_add_seals(struct file *file, unsigned int seals)
27912791
inode_unlock(inode);
27922792
return error;
27932793
}
2794-
EXPORT_SYMBOL_GPL(shmem_add_seals);
27952794

2796-
int shmem_get_seals(struct file *file)
2795+
static int shmem_get_seals(struct file *file)
27972796
{
27982797
if (file->f_op != &shmem_file_operations)
27992798
return -EINVAL;
28002799

28012800
return SHMEM_I(file_inode(file))->seals;
28022801
}
2803-
EXPORT_SYMBOL_GPL(shmem_get_seals);
28042802

28052803
long shmem_fcntl(struct file *file, unsigned int cmd, unsigned long arg)
28062804
{

0 commit comments

Comments
 (0)