#include <linux/mm.h>
#include <linux/file.h>
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/log2.h>
#include <linux/mount.h>
#include <linux/pseudo_fs.h>
#include <linux/magic.h>
#include <linux/pipe_fs_i.h>
#include <linux/uio.h>
#include <linux/highmem.h>
#include <linux/pagemap.h>
#include <linux/audit.h>
#include <linux/syscalls.h>
#include <linux/fcntl.h>
#include <linux/memcontrol.h>
#include <linux/watch_queue.h>
#include <linux/sysctl.h>
#include <linux/uaccess.h>
#include <asm/ioctls.h>
#include "internal.h"
#define PIPE_MIN_DEF_BUFFERS …
static unsigned int pipe_max_size = …;
static unsigned long pipe_user_pages_hard;
static unsigned long pipe_user_pages_soft = …;
#define cmp_int(l, r) …
#ifdef CONFIG_PROVE_LOCKING
static int pipe_lock_cmp_fn(const struct lockdep_map *a,
const struct lockdep_map *b)
{ … }
#endif
void pipe_lock(struct pipe_inode_info *pipe)
{ … }
EXPORT_SYMBOL(…);
void pipe_unlock(struct pipe_inode_info *pipe)
{ … }
EXPORT_SYMBOL(…);
void pipe_double_lock(struct pipe_inode_info *pipe1,
struct pipe_inode_info *pipe2)
{ … }
static void anon_pipe_buf_release(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{ … }
static bool anon_pipe_buf_try_steal(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{ … }
bool generic_pipe_buf_try_steal(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{ … }
EXPORT_SYMBOL(…);
bool generic_pipe_buf_get(struct pipe_inode_info *pipe, struct pipe_buffer *buf)
{ … }
EXPORT_SYMBOL(…);
void generic_pipe_buf_release(struct pipe_inode_info *pipe,
struct pipe_buffer *buf)
{ … }
EXPORT_SYMBOL(…);
static const struct pipe_buf_operations anon_pipe_buf_ops = …;
static inline bool pipe_readable(const struct pipe_inode_info *pipe)
{ … }
static inline unsigned int pipe_update_tail(struct pipe_inode_info *pipe,
struct pipe_buffer *buf,
unsigned int tail)
{ … }
static ssize_t
pipe_read(struct kiocb *iocb, struct iov_iter *to)
{ … }
static inline int is_packetized(struct file *file)
{ … }
static inline bool pipe_writable(const struct pipe_inode_info *pipe)
{ … }
static ssize_t
pipe_write(struct kiocb *iocb, struct iov_iter *from)
{ … }
static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{ … }
static __poll_t
pipe_poll(struct file *filp, poll_table *wait)
{ … }
static void put_pipe_info(struct inode *inode, struct pipe_inode_info *pipe)
{ … }
static int
pipe_release(struct inode *inode, struct file *file)
{ … }
static int
pipe_fasync(int fd, struct file *filp, int on)
{ … }
unsigned long account_pipe_buffers(struct user_struct *user,
unsigned long old, unsigned long new)
{ … }
bool too_many_pipe_buffers_soft(unsigned long user_bufs)
{ … }
bool too_many_pipe_buffers_hard(unsigned long user_bufs)
{ … }
bool pipe_is_unprivileged_user(void)
{ … }
struct pipe_inode_info *alloc_pipe_info(void)
{ … }
void free_pipe_info(struct pipe_inode_info *pipe)
{ … }
static struct vfsmount *pipe_mnt __ro_after_init;
static char *pipefs_dname(struct dentry *dentry, char *buffer, int buflen)
{ … }
static const struct dentry_operations pipefs_dentry_operations = …;
static struct inode * get_pipe_inode(void)
{ … }
int create_pipe_files(struct file **res, int flags)
{ … }
static int __do_pipe_flags(int *fd, struct file **files, int flags)
{ … }
int do_pipe_flags(int *fd, int flags)
{ … }
static int do_pipe2(int __user *fildes, int flags)
{ … }
SYSCALL_DEFINE2(pipe2, int __user *, fildes, int, flags)
{ … }
SYSCALL_DEFINE1(pipe, int __user *, fildes)
{ … }
void pipe_wait_readable(struct pipe_inode_info *pipe)
{ … }
void pipe_wait_writable(struct pipe_inode_info *pipe)
{ … }
static int wait_for_partner(struct pipe_inode_info *pipe, unsigned int *cnt)
{ … }
static void wake_up_partner(struct pipe_inode_info *pipe)
{ … }
static int fifo_open(struct inode *inode, struct file *filp)
{ … }
const struct file_operations pipefifo_fops = …;
unsigned int round_pipe_size(unsigned int size)
{ … }
int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots)
{ … }
static long pipe_set_size(struct pipe_inode_info *pipe, unsigned int arg)
{ … }
struct pipe_inode_info *get_pipe_info(struct file *file, bool for_splice)
{ … }
long pipe_fcntl(struct file *file, unsigned int cmd, unsigned int arg)
{ … }
static const struct super_operations pipefs_ops = …;
static int pipefs_init_fs_context(struct fs_context *fc)
{ … }
static struct file_system_type pipe_fs_type = …;
#ifdef CONFIG_SYSCTL
static int do_proc_dopipe_max_size_conv(unsigned long *lvalp,
unsigned int *valp,
int write, void *data)
{ … }
static int proc_dopipe_max_size(const struct ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{ … }
static struct ctl_table fs_pipe_sysctls[] = …;
#endif
static int __init init_pipe_fs(void)
{ … }
fs_initcall(init_pipe_fs);