#include <linux/string.h>
#include <linux/slab.h>
#include <linux/file.h>
#include <linux/fdtable.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/filelock.h>
#include <linux/security.h>
#include <linux/cred.h>
#include <linux/eventpoll.h>
#include <linux/rcupdate.h>
#include <linux/mount.h>
#include <linux/capability.h>
#include <linux/cdev.h>
#include <linux/fsnotify.h>
#include <linux/sysctl.h>
#include <linux/percpu_counter.h>
#include <linux/percpu.h>
#include <linux/task_work.h>
#include <linux/swap.h>
#include <linux/kmemleak.h>
#include <linux/atomic.h>
#include "internal.h"
static struct files_stat_struct files_stat = …;
static struct kmem_cache *filp_cachep __ro_after_init;
static struct percpu_counter nr_files __cacheline_aligned_in_smp;
struct backing_file { … };
static inline struct backing_file *backing_file(struct file *f)
{ … }
struct path *backing_file_user_path(struct file *f)
{ … }
EXPORT_SYMBOL_GPL(…);
static inline void file_free(struct file *f)
{ … }
static long get_nr_files(void)
{ … }
unsigned long get_max_files(void)
{ … }
EXPORT_SYMBOL_GPL(…);
#if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS)
static int proc_nr_files(const struct ctl_table *table, int write, void *buffer,
size_t *lenp, loff_t *ppos)
{ … }
static struct ctl_table fs_stat_sysctls[] = …;
static int __init init_fs_stat_sysctls(void)
{ … }
fs_initcall(init_fs_stat_sysctls);
#endif
static int init_file(struct file *f, int flags, const struct cred *cred)
{ … }
struct file *alloc_empty_file(int flags, const struct cred *cred)
{ … }
struct file *alloc_empty_file_noaccount(int flags, const struct cred *cred)
{ … }
struct file *alloc_empty_backing_file(int flags, const struct cred *cred)
{ … }
static void file_init_path(struct file *file, const struct path *path,
const struct file_operations *fop)
{ … }
static struct file *alloc_file(const struct path *path, int flags,
const struct file_operations *fop)
{ … }
static inline int alloc_path_pseudo(const char *name, struct inode *inode,
struct vfsmount *mnt, struct path *path)
{ … }
struct file *alloc_file_pseudo(struct inode *inode, struct vfsmount *mnt,
const char *name, int flags,
const struct file_operations *fops)
{ … }
EXPORT_SYMBOL(…);
struct file *alloc_file_pseudo_noaccount(struct inode *inode,
struct vfsmount *mnt, const char *name,
int flags,
const struct file_operations *fops)
{ … }
EXPORT_SYMBOL_GPL(…);
struct file *alloc_file_clone(struct file *base, int flags,
const struct file_operations *fops)
{ … }
static void __fput(struct file *file)
{ … }
static LLIST_HEAD(delayed_fput_list);
static void delayed_fput(struct work_struct *unused)
{ … }
static void ____fput(struct callback_head *work)
{ … }
void flush_delayed_fput(void)
{ … }
EXPORT_SYMBOL_GPL(…);
static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput);
void fput(struct file *file)
{ … }
void __fput_sync(struct file *file)
{ … }
EXPORT_SYMBOL(…);
EXPORT_SYMBOL(…);
void __init files_init(void)
{ … }
void __init files_maxfiles_init(void)
{ … }