Lines Matching defs:int
130 getname_flags(const char __user *filename, int flags, int *empty)
134 int len;
209 getname_uflags(const char __user *filename, int uflags)
211 int flags = (uflags & AT_EMPTY_PATH) ? LOOKUP_EMPTY : 0;
226 int len = strlen(filename) + 1;
294 static int check_acl(struct mnt_idmap *idmap,
295 struct inode *inode, int mask)
314 int error = posix_acl_permission(idmap, inode, acl, mask);
339 static int acl_permission_check(struct mnt_idmap *idmap,
340 struct inode *inode, int mask)
342 unsigned int mode = inode->i_mode;
355 int error = check_acl(idmap, inode, mask);
400 int generic_permission(struct mnt_idmap *idmap, struct inode *inode,
401 int mask)
403 int ret;
457 static inline int do_inode_permission(struct mnt_idmap *idmap,
458 struct inode *inode, int mask)
480 static int sb_permission(struct super_block *sb, struct inode *inode, int mask)
504 int inode_permission(struct mnt_idmap *idmap,
505 struct inode *inode, int mask)
507 int retval;
573 unsigned int flags, state;
575 int last_type;
577 int total_link_count;
587 int dfd;
596 static void __set_nameidata(struct nameidata *p, int dfd, struct filename *name)
610 static inline void set_nameidata(struct nameidata *p, int dfd, struct filename *name,
666 int i = nd->depth;
685 int i;
704 int res = __legitimize_mnt(path->mnt, mseq);
726 int i;
812 int res;
859 static inline int d_revalidate(struct dentry *dentry, unsigned int flags)
877 static int complete_walk(struct nameidata *nd)
880 int status;
932 static int set_root(struct nameidata *nd)
959 static int nd_jump_root(struct nameidata *nd)
969 int error = set_root(nd);
995 int nd_jump_link(const struct path *path)
997 int error = -ELOOP;
1031 static int sysctl_protected_symlinks __read_mostly;
1032 static int sysctl_protected_hardlinks __read_mostly;
1033 static int sysctl_protected_fifos __read_mostly;
1034 static int sysctl_protected_regular __read_mostly;
1041 .maxlen = sizeof(int),
1050 .maxlen = sizeof(int),
1059 .maxlen = sizeof(int),
1068 .maxlen = sizeof(int),
1077 static int __init init_fs_namei_sysctls(void)
1102 static inline int may_follow_link(struct nameidata *nd, const struct inode *inode)
1188 int may_linkat(struct mnt_idmap *idmap, const struct path *link)
1238 static int may_create_in_sticky(struct mnt_idmap *idmap,
1274 int follow_up(struct path *path)
1347 static int follow_automount(struct path *path, int *count, unsigned lookup_flags)
1379 static int __traverse_mounts(struct path *path, unsigned flags, bool *jumped,
1380 int *count, unsigned lookup_flags)
1384 int ret = 0;
1432 static inline int traverse_mounts(struct path *path, bool *jumped,
1433 int *count, unsigned lookup_flags)
1447 int follow_down_one(struct path *path)
1468 int follow_down(struct path *path, unsigned int flags)
1472 int ret = traverse_mounts(path, &jumped, NULL, flags);
1487 unsigned int flags = dentry->d_flags;
1501 int res = dentry->d_op->d_manage(path, true);
1528 static inline int handle_mounts(struct nameidata *nd, struct dentry *dentry,
1532 int ret;
1537 unsigned int seq = nd->next_seq;
1568 unsigned int flags)
1572 int error = d_revalidate(dentry, flags);
1592 unsigned int flags)
1621 int status = 1;
1669 unsigned int flags)
1683 int error = d_revalidate(dentry, flags);
1706 unsigned int flags)
1716 static inline int may_lookup(struct mnt_idmap *idmap,
1720 int err = inode_permission(idmap, nd->inode, MAY_EXEC|MAY_NOT_BLOCK);
1727 static int reserve_stack(struct nameidata *nd, struct path *link)
1756 struct inode *inode, int flags)
1760 int error = reserve_stack(nd, link);
1835 static const char *step_into(struct nameidata *nd, int flags,
1840 int err = handle_mounts(nd, dentry, &path);
1947 static const char *handle_dots(struct nameidata *nd, int type)
1985 static const char *walk_component(struct nameidata *nd, int flags)
2077 static inline unsigned int fold_hash(unsigned long x, unsigned long y)
2102 static inline unsigned int fold_hash(unsigned long x, unsigned long y)
2117 unsigned int full_name_hash(const void *salt, const char *name, unsigned int len)
2194 unsigned int full_name_hash(const void *salt, const char *name, unsigned int len)
2247 static int link_path_walk(const char *name, struct nameidata *nd)
2249 int depth = 0; // depth <= nd->depth
2250 int err;
2268 int type;
2352 int error;
2462 static int handle_lookup_down(struct nameidata *nd)
2471 static int path_lookupat(struct nameidata *nd, unsigned flags, struct path *path)
2474 int err;
2504 int filename_lookup(int dfd, struct filename *name, unsigned flags,
2507 int retval;
2526 static int path_parentat(struct nameidata *nd, unsigned flags,
2530 int err = link_path_walk(s, nd);
2543 static int __filename_parentat(int dfd, struct filename *name,
2544 unsigned int flags, struct path *parent,
2545 struct qstr *last, int *type,
2548 int retval;
2568 static int filename_parentat(int dfd, struct filename *name,
2569 unsigned int flags, struct path *parent,
2570 struct qstr *last, int *type)
2580 int type, error;
2607 int kern_path(const char *name, unsigned int flags, struct path *path)
2610 int ret = filename_lookup(AT_FDCWD, filename, flags, path, NULL);
2627 int vfs_path_parent_lookup(struct filename *filename, unsigned int flags,
2628 struct path *parent, struct qstr *last, int *type,
2644 int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
2645 const char *name, unsigned int flags,
2650 int ret;
2660 static int lookup_one_common(struct mnt_idmap *idmap,
2661 const char *name, struct dentry *base, int len,
2676 unsigned int c = *(const unsigned char *)name++;
2685 int err = base->d_op->d_hash(base, this);
2707 struct dentry *try_lookup_one_len(const char *name, struct dentry *base, int len)
2710 int err;
2733 struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
2737 int err;
2763 struct dentry *base, int len)
2767 int err;
2795 int len)
2798 int err;
2834 struct dentry *base, int len)
2859 struct dentry *base, int len)
2874 struct dentry *base, int len)
2881 int path_pts(struct path *path)
2907 int user_path_at_empty(int dfd, const char __user *name, unsigned flags,
2908 struct path *path, int *empty)
2911 int ret = filename_lookup(dfd, filename, flags, path, NULL);
2918 int __check_sticky(struct mnt_idmap *idmap, struct inode *dir,
2951 static int may_delete(struct mnt_idmap *idmap, struct inode *dir,
2955 int error;
3003 static inline int may_create(struct mnt_idmap *idmap,
3176 int vfs_create(struct mnt_idmap *idmap, struct inode *dir,
3179 int error;
3199 int vfs_mkobj(struct dentry *dentry, umode_t mode,
3200 int (*f)(struct dentry *, umode_t, void *),
3204 int error = may_create(&nop_mnt_idmap, dir, dentry);
3226 static int may_open(struct mnt_idmap *idmap, const struct path *path,
3227 int acc_mode, int flag)
3231 int error;
3283 static int handle_truncate(struct mnt_idmap *idmap, struct file *filp)
3287 int error = get_write_access(inode);
3301 static inline int open_to_namei_flags(int flag)
3308 static int may_o_create(struct mnt_idmap *idmap,
3312 int error = security_path_mknod(dir, dentry, mode, 0);
3342 int open_flag, umode_t mode)
3346 int error;
3402 int open_flag = op->open_flag;
3404 int error, create_error = 0;
3510 int open_flag = op->open_flag;
3590 static int do_open(struct nameidata *nd,
3594 int open_flag = op->open_flag;
3596 int acc_mode;
3597 int error;
3663 static int vfs_tmpfile(struct mnt_idmap *idmap,
3670 int error;
3671 int open_flag = file->f_flags;
3717 umode_t mode, int open_flag,
3721 int error;
3736 static int do_tmpfile(struct nameidata *nd, unsigned flags,
3741 int error = path_lookupat(nd, flags | LOOKUP_DIRECTORY, &path);
3759 static int do_o_path(struct nameidata *nd, unsigned flags, struct file *file)
3762 int error = path_lookupat(nd, flags, &path);
3775 int error;
3810 struct file *do_filp_open(int dfd, struct filename *pathname,
3814 int flags = op->lookup_flags;
3833 int flags = op->lookup_flags;
3853 static struct dentry *filename_create(int dfd, struct filename *name,
3854 struct path *path, unsigned int lookup_flags)
3859 unsigned int reval_flag = lookup_flags & LOOKUP_REVAL;
3860 unsigned int create_flags = LOOKUP_CREATE | LOOKUP_EXCL;
3861 int type;
3862 int err2;
3863 int error;
3921 struct dentry *kern_path_create(int dfd, const char *pathname,
3922 struct path *path, unsigned int lookup_flags)
3941 inline struct dentry *user_path_create(int dfd, const char __user *pathname,
3942 struct path *path, unsigned int lookup_flags)
3968 int vfs_mknod(struct mnt_idmap *idmap, struct inode *dir,
3972 int error = may_create(idmap, dir, dentry);
4000 static int may_mknod(umode_t mode)
4017 static int do_mknodat(int dfd, struct filename *name, umode_t mode,
4018 unsigned int dev)
4023 int error;
4024 unsigned int lookup_flags = 0;
4068 SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
4069 unsigned int, dev)
4094 int vfs_mkdir(struct mnt_idmap *idmap, struct inode *dir,
4097 int error;
4122 int do_mkdirat(int dfd, struct filename *name, umode_t mode)
4126 int error;
4127 unsigned int lookup_flags = LOOKUP_DIRECTORY;
4151 SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode)
4175 int vfs_rmdir(struct mnt_idmap *idmap, struct inode *dir,
4178 int error = may_delete(idmap, dir, dentry, 1);
4216 int do_rmdir(int dfd, struct filename *name)
4218 int error;
4222 int type;
4223 unsigned int lookup_flags = 0;
4304 int vfs_unlink(struct mnt_idmap *idmap, struct inode *dir,
4308 int error = may_delete(idmap, dir, dentry, 0);
4355 int do_unlinkat(int dfd, struct filename *name)
4357 int error;
4361 int type;
4364 unsigned int lookup_flags = 0;
4429 SYSCALL_DEFINE3(unlinkat, int, dfd, const char __user *, pathname, int, flag)
4459 int vfs_symlink(struct mnt_idmap *idmap, struct inode *dir,
4462 int error;
4482 int do_symlinkat(struct filename *from, int newdfd, struct filename *to)
4484 int error;
4487 unsigned int lookup_flags = 0;
4515 int, newdfd, const char __user *, newname)
4551 int vfs_link(struct dentry *old_dentry, struct mnt_idmap *idmap,
4557 int error;
4623 int do_linkat(int olddfd, struct filename *old, int newdfd,
4624 struct filename *new, int flags)
4630 int how = 0;
4631 int error;
4695 SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
4696 int, newdfd, const char __user *, newname, int, flags)
4753 int vfs_rename(struct renamedata *rd)
4755 int error;
4760 unsigned int flags = rd->flags;
4913 int do_renameat2(int olddfd, struct filename *from, int newdfd,
4914 struct filename *to, unsigned int flags)
4921 int old_type, new_type;
4923 unsigned int lookup_flags = 0, target_flags = LOOKUP_RENAME_TARGET;
4925 int error = -EINVAL;
5057 SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
5058 int, newdfd, const char __user *, newname, unsigned int, flags)
5064 SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
5065 int, newdfd, const char __user *, newname)
5077 int readlink_copy(char __user *buffer, int buflen, const char *link)
5079 int len = PTR_ERR(link);
5102 int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen)
5107 int res;
5194 int page_readlink(struct dentry *dentry, char __user *buffer, int buflen)
5197 int res = readlink_copy(buffer, buflen,
5205 int page_symlink(struct inode *inode, const char *symname, int len)
5212 int err;
5213 unsigned int flags;