#include <linux/string.h>
#include <linux/mm.h>
#include <linux/file.h>
#include <linux/fdtable.h>
#include <linux/fsnotify.h>
#include <linux/module.h>
#include <linux/tty.h>
#include <linux/namei.h>
#include <linux/backing-dev.h>
#include <linux/capability.h>
#include <linux/securebits.h>
#include <linux/security.h>
#include <linux/mount.h>
#include <linux/fcntl.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/fs.h>
#include <linux/personality.h>
#include <linux/pagemap.h>
#include <linux/syscalls.h>
#include <linux/rcupdate.h>
#include <linux/audit.h>
#include <linux/falloc.h>
#include <linux/fs_struct.h>
#include <linux/dnotify.h>
#include <linux/compat.h>
#include <linux/mnt_idmapping.h>
#include <linux/filelock.h>
#include "internal.h"
int do_truncate(struct mnt_idmap *idmap, struct dentry *dentry,
loff_t length, unsigned int time_attrs, struct file *filp)
{ … }
long vfs_truncate(const struct path *path, loff_t length)
{ … }
EXPORT_SYMBOL_GPL(…);
long do_sys_truncate(const char __user *pathname, loff_t length)
{ … }
SYSCALL_DEFINE2(truncate, const char __user *, path, long, length)
{ … }
#ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE2(truncate, const char __user *, path, compat_off_t, length)
{ … }
#endif
long do_ftruncate(struct file *file, loff_t length, int small)
{ … }
long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
{ … }
SYSCALL_DEFINE2(ftruncate, unsigned int, fd, off_t, length)
{ … }
#ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE2(ftruncate, unsigned int, fd, compat_off_t, length)
{ … }
#endif
#if BITS_PER_LONG == 32
SYSCALL_DEFINE2(truncate64, const char __user *, path, loff_t, length)
{
return do_sys_truncate(path, length);
}
SYSCALL_DEFINE2(ftruncate64, unsigned int, fd, loff_t, length)
{
return do_sys_ftruncate(fd, length, 0);
}
#endif
#if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_TRUNCATE64)
COMPAT_SYSCALL_DEFINE3(truncate64, const char __user *, pathname,
compat_arg_u64_dual(length))
{
return ksys_truncate(pathname, compat_arg_u64_glue(length));
}
#endif
#if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_FTRUNCATE64)
COMPAT_SYSCALL_DEFINE3(ftruncate64, unsigned int, fd,
compat_arg_u64_dual(length))
{
return ksys_ftruncate(fd, compat_arg_u64_glue(length));
}
#endif
int vfs_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
{ … }
EXPORT_SYMBOL_GPL(…);
int ksys_fallocate(int fd, int mode, loff_t offset, loff_t len)
{ … }
SYSCALL_DEFINE4(fallocate, int, fd, int, mode, loff_t, offset, loff_t, len)
{ … }
#if defined(CONFIG_COMPAT) && defined(__ARCH_WANT_COMPAT_FALLOCATE)
COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, compat_arg_u64_dual(offset),
compat_arg_u64_dual(len))
{
return ksys_fallocate(fd, mode, compat_arg_u64_glue(offset),
compat_arg_u64_glue(len));
}
#endif
static bool access_need_override_creds(int flags)
{ … }
static const struct cred *access_override_creds(void)
{ … }
static long do_faccessat(int dfd, const char __user *filename, int mode, int flags)
{ … }
SYSCALL_DEFINE3(faccessat, int, dfd, const char __user *, filename, int, mode)
{ … }
SYSCALL_DEFINE4(faccessat2, int, dfd, const char __user *, filename, int, mode,
int, flags)
{ … }
SYSCALL_DEFINE2(access, const char __user *, filename, int, mode)
{ … }
SYSCALL_DEFINE1(chdir, const char __user *, filename)
{ … }
SYSCALL_DEFINE1(fchdir, unsigned int, fd)
{ … }
SYSCALL_DEFINE1(chroot, const char __user *, filename)
{ … }
int chmod_common(const struct path *path, umode_t mode)
{ … }
int vfs_fchmod(struct file *file, umode_t mode)
{ … }
SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode)
{ … }
static int do_fchmodat(int dfd, const char __user *filename, umode_t mode,
unsigned int flags)
{ … }
SYSCALL_DEFINE4(fchmodat2, int, dfd, const char __user *, filename,
umode_t, mode, unsigned int, flags)
{ … }
SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename,
umode_t, mode)
{ … }
SYSCALL_DEFINE2(chmod, const char __user *, filename, umode_t, mode)
{ … }
static inline bool setattr_vfsuid(struct iattr *attr, kuid_t kuid)
{ … }
static inline bool setattr_vfsgid(struct iattr *attr, kgid_t kgid)
{ … }
int chown_common(const struct path *path, uid_t user, gid_t group)
{ … }
int do_fchownat(int dfd, const char __user *filename, uid_t user, gid_t group,
int flag)
{ … }
SYSCALL_DEFINE5(fchownat, int, dfd, const char __user *, filename, uid_t, user,
gid_t, group, int, flag)
{ … }
SYSCALL_DEFINE3(chown, const char __user *, filename, uid_t, user, gid_t, group)
{ … }
SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group)
{ … }
int vfs_fchown(struct file *file, uid_t user, gid_t group)
{ … }
int ksys_fchown(unsigned int fd, uid_t user, gid_t group)
{ … }
SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group)
{ … }
static inline int file_get_write_access(struct file *f)
{ … }
static int do_dentry_open(struct file *f,
int (*open)(struct inode *, struct file *))
{ … }
int finish_open(struct file *file, struct dentry *dentry,
int (*open)(struct inode *, struct file *))
{ … }
EXPORT_SYMBOL(…);
int finish_no_open(struct file *file, struct dentry *dentry)
{ … }
EXPORT_SYMBOL(…);
char *file_path(struct file *filp, char *buf, int buflen)
{ … }
EXPORT_SYMBOL(…);
int vfs_open(const struct path *path, struct file *file)
{ … }
struct file *dentry_open(const struct path *path, int flags,
const struct cred *cred)
{ … }
EXPORT_SYMBOL(…);
struct file *dentry_create(const struct path *path, int flags, umode_t mode,
const struct cred *cred)
{ … }
EXPORT_SYMBOL(…);
struct file *kernel_file_open(const struct path *path, int flags,
const struct cred *cred)
{ … }
EXPORT_SYMBOL_GPL(…);
#define WILL_CREATE(flags) …
#define O_PATH_FLAGS …
inline struct open_how build_open_how(int flags, umode_t mode)
{ … }
inline int build_open_flags(const struct open_how *how, struct open_flags *op)
{ … }
struct file *file_open_name(struct filename *name, int flags, umode_t mode)
{ … }
struct file *filp_open(const char *filename, int flags, umode_t mode)
{ … }
EXPORT_SYMBOL(…);
struct file *file_open_root(const struct path *root,
const char *filename, int flags, umode_t mode)
{ … }
EXPORT_SYMBOL(…);
static long do_sys_openat2(int dfd, const char __user *filename,
struct open_how *how)
{ … }
long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{ … }
SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode)
{ … }
SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags,
umode_t, mode)
{ … }
SYSCALL_DEFINE4(openat2, int, dfd, const char __user *, filename,
struct open_how __user *, how, size_t, usize)
{ … }
#ifdef CONFIG_COMPAT
COMPAT_SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode)
{ … }
COMPAT_SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, umode_t, mode)
{ … }
#endif
#ifndef __alpha__
SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode)
{ … }
#endif
static int filp_flush(struct file *filp, fl_owner_t id)
{ … }
int filp_close(struct file *filp, fl_owner_t id)
{ … }
EXPORT_SYMBOL(…);
SYSCALL_DEFINE1(close, unsigned int, fd)
{ … }
SYSCALL_DEFINE3(close_range, unsigned int, fd, unsigned int, max_fd,
unsigned int, flags)
{ … }
SYSCALL_DEFINE0(…)
{ …
int generic_file_open(struct inode * inode, struct file * filp)
{ … }
EXPORT_SYMBOL(…);
int nonseekable_open(struct inode *inode, struct file *filp)
{ … }
EXPORT_SYMBOL(…);
int stream_open(struct inode *inode, struct file *filp)
{ … }
EXPORT_SYMBOL(…);