#define pr_fmt(fmt) …
#include <linux/thread_info.h>
#include <asm/current.h>
#include <linux/falloc.h>
#include <linux/fs.h>
#include <linux/mount.h>
#include <linux/file.h>
#include <linux/kernel.h>
#include <linux/writeback.h>
#include <linux/pagemap.h>
#include <linux/highmem.h>
#include <linux/init.h>
#include <linux/string.h>
#include <linux/capability.h>
#include <linux/ctype.h>
#include <linux/backing-dev.h>
#include <linux/hugetlb.h>
#include <linux/pagevec.h>
#include <linux/fs_parser.h>
#include <linux/mman.h>
#include <linux/slab.h>
#include <linux/dnotify.h>
#include <linux/statfs.h>
#include <linux/security.h>
#include <linux/magic.h>
#include <linux/migrate.h>
#include <linux/uio.h>
#include <linux/uaccess.h>
#include <linux/sched/mm.h>
static const struct address_space_operations hugetlbfs_aops;
static const struct file_operations hugetlbfs_file_operations;
static const struct inode_operations hugetlbfs_dir_inode_operations;
static const struct inode_operations hugetlbfs_inode_operations;
enum hugetlbfs_size_type { … };
struct hugetlbfs_fs_context { … };
int sysctl_hugetlb_shm_group;
enum hugetlb_param { … };
static const struct fs_parameter_spec hugetlb_fs_parameters[] = …;
#define PGOFF_LOFFT_MAX …
static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma)
{ … }
static unsigned long
hugetlb_get_unmapped_area_bottomup(struct file *file, unsigned long addr,
unsigned long len, unsigned long pgoff, unsigned long flags)
{ … }
static unsigned long
hugetlb_get_unmapped_area_topdown(struct file *file, unsigned long addr,
unsigned long len, unsigned long pgoff, unsigned long flags)
{ … }
unsigned long
generic_hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
unsigned long len, unsigned long pgoff,
unsigned long flags)
{ … }
#ifndef HAVE_ARCH_HUGETLB_UNMAPPED_AREA
static unsigned long
hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
unsigned long len, unsigned long pgoff,
unsigned long flags)
{
return generic_hugetlb_get_unmapped_area(file, addr, len, pgoff, flags);
}
#endif
static size_t adjust_range_hwpoison(struct page *page, size_t offset, size_t bytes)
{ … }
static ssize_t hugetlbfs_read_iter(struct kiocb *iocb, struct iov_iter *to)
{ … }
static int hugetlbfs_write_begin(struct file *file,
struct address_space *mapping,
loff_t pos, unsigned len,
struct page **pagep, void **fsdata)
{ … }
static int hugetlbfs_write_end(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned copied,
struct page *page, void *fsdata)
{ … }
static void hugetlb_delete_from_page_cache(struct folio *folio)
{ … }
static bool hugetlb_vma_maps_page(struct vm_area_struct *vma,
unsigned long addr, struct page *page)
{ … }
static unsigned long vma_offset_start(struct vm_area_struct *vma, pgoff_t start)
{ … }
static unsigned long vma_offset_end(struct vm_area_struct *vma, pgoff_t end)
{ … }
static void hugetlb_unmap_file_folio(struct hstate *h,
struct address_space *mapping,
struct folio *folio, pgoff_t index)
{ … }
static void
hugetlb_vmdelete_list(struct rb_root_cached *root, pgoff_t start, pgoff_t end,
zap_flags_t zap_flags)
{ … }
static bool remove_inode_single_folio(struct hstate *h, struct inode *inode,
struct address_space *mapping,
struct folio *folio, pgoff_t index,
bool truncate_op)
{ … }
static void remove_inode_hugepages(struct inode *inode, loff_t lstart,
loff_t lend)
{ … }
static void hugetlbfs_evict_inode(struct inode *inode)
{ … }
static void hugetlb_vmtruncate(struct inode *inode, loff_t offset)
{ … }
static void hugetlbfs_zero_partial_page(struct hstate *h,
struct address_space *mapping,
loff_t start,
loff_t end)
{ … }
static long hugetlbfs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
{ … }
static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset,
loff_t len)
{ … }
static int hugetlbfs_setattr(struct mnt_idmap *idmap,
struct dentry *dentry, struct iattr *attr)
{ … }
static struct inode *hugetlbfs_get_root(struct super_block *sb,
struct hugetlbfs_fs_context *ctx)
{ … }
static struct lock_class_key hugetlbfs_i_mmap_rwsem_key;
static struct inode *hugetlbfs_get_inode(struct super_block *sb,
struct mnt_idmap *idmap,
struct inode *dir,
umode_t mode, dev_t dev)
{ … }
static int hugetlbfs_mknod(struct mnt_idmap *idmap, struct inode *dir,
struct dentry *dentry, umode_t mode, dev_t dev)
{ … }
static int hugetlbfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
struct dentry *dentry, umode_t mode)
{ … }
static int hugetlbfs_create(struct mnt_idmap *idmap,
struct inode *dir, struct dentry *dentry,
umode_t mode, bool excl)
{ … }
static int hugetlbfs_tmpfile(struct mnt_idmap *idmap,
struct inode *dir, struct file *file,
umode_t mode)
{ … }
static int hugetlbfs_symlink(struct mnt_idmap *idmap,
struct inode *dir, struct dentry *dentry,
const char *symname)
{ … }
#ifdef CONFIG_MIGRATION
static int hugetlbfs_migrate_folio(struct address_space *mapping,
struct folio *dst, struct folio *src,
enum migrate_mode mode)
{ … }
#else
#define hugetlbfs_migrate_folio …
#endif
static int hugetlbfs_error_remove_folio(struct address_space *mapping,
struct folio *folio)
{ … }
static int hugetlbfs_show_options(struct seq_file *m, struct dentry *root)
{ … }
static int hugetlbfs_statfs(struct dentry *dentry, struct kstatfs *buf)
{ … }
static void hugetlbfs_put_super(struct super_block *sb)
{ … }
static inline int hugetlbfs_dec_free_inodes(struct hugetlbfs_sb_info *sbinfo)
{ … }
static void hugetlbfs_inc_free_inodes(struct hugetlbfs_sb_info *sbinfo)
{ … }
static struct kmem_cache *hugetlbfs_inode_cachep;
static struct inode *hugetlbfs_alloc_inode(struct super_block *sb)
{ … }
static void hugetlbfs_free_inode(struct inode *inode)
{ … }
static void hugetlbfs_destroy_inode(struct inode *inode)
{ … }
static const struct address_space_operations hugetlbfs_aops = …;
static void init_once(void *foo)
{ … }
static const struct file_operations hugetlbfs_file_operations = …;
static const struct inode_operations hugetlbfs_dir_inode_operations = …;
static const struct inode_operations hugetlbfs_inode_operations = …;
static const struct super_operations hugetlbfs_ops = …;
static long
hugetlbfs_size_to_hpages(struct hstate *h, unsigned long long size_opt,
enum hugetlbfs_size_type val_type)
{ … }
static int hugetlbfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
{ … }
static int hugetlbfs_validate(struct fs_context *fc)
{ … }
static int
hugetlbfs_fill_super(struct super_block *sb, struct fs_context *fc)
{ … }
static int hugetlbfs_get_tree(struct fs_context *fc)
{ … }
static void hugetlbfs_fs_context_free(struct fs_context *fc)
{ … }
static const struct fs_context_operations hugetlbfs_fs_context_ops = …;
static int hugetlbfs_init_fs_context(struct fs_context *fc)
{ … }
static struct file_system_type hugetlbfs_fs_type = …;
static struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE];
static int can_do_hugetlb_shm(void)
{ … }
static int get_hstate_idx(int page_size_log)
{ … }
struct file *hugetlb_file_setup(const char *name, size_t size,
vm_flags_t acctflag, int creat_flags,
int page_size_log)
{ … }
static struct vfsmount *__init mount_one_hugetlbfs(struct hstate *h)
{ … }
static int __init init_hugetlbfs_fs(void)
{ … }
fs_initcall(…) …