• Home
  • Raw
  • Download

Lines Matching refs:inode

101 static struct inode *bpf_get_inode(struct super_block *sb,  in bpf_get_inode()
102 const struct inode *dir, in bpf_get_inode()
105 struct inode *inode; in bpf_get_inode() local
116 inode = new_inode(sb); in bpf_get_inode()
117 if (!inode) in bpf_get_inode()
120 inode->i_ino = get_next_ino(); in bpf_get_inode()
121 inode->i_atime = current_time(inode); in bpf_get_inode()
122 inode->i_mtime = inode->i_atime; in bpf_get_inode()
123 inode->i_ctime = inode->i_atime; in bpf_get_inode()
125 inode_init_owner(&init_user_ns, inode, dir, mode); in bpf_get_inode()
127 return inode; in bpf_get_inode()
130 static int bpf_inode_type(const struct inode *inode, enum bpf_type *type) in bpf_inode_type() argument
133 if (inode->i_op == &bpf_prog_iops) in bpf_inode_type()
135 else if (inode->i_op == &bpf_map_iops) in bpf_inode_type()
137 else if (inode->i_op == &bpf_link_iops) in bpf_inode_type()
145 static void bpf_dentry_finalize(struct dentry *dentry, struct inode *inode, in bpf_dentry_finalize() argument
146 struct inode *dir) in bpf_dentry_finalize()
148 d_instantiate(dentry, inode); in bpf_dentry_finalize()
155 static int bpf_mkdir(struct user_namespace *mnt_userns, struct inode *dir, in bpf_mkdir()
158 struct inode *inode; in bpf_mkdir() local
160 inode = bpf_get_inode(dir->i_sb, dir, mode | S_IFDIR); in bpf_mkdir()
161 if (IS_ERR(inode)) in bpf_mkdir()
162 return PTR_ERR(inode); in bpf_mkdir()
164 inode->i_op = &bpf_dir_iops; in bpf_mkdir()
165 inode->i_fop = &simple_dir_operations; in bpf_mkdir()
167 inc_nlink(inode); in bpf_mkdir()
170 bpf_dentry_finalize(dentry, inode, dir); in bpf_mkdir()
274 static int bpffs_map_open(struct inode *inode, struct file *file) in bpffs_map_open() argument
276 struct bpf_map *map = inode->i_private; in bpffs_map_open()
297 static int bpffs_map_release(struct inode *inode, struct file *file) in bpffs_map_release() argument
303 return seq_release(inode, file); in bpffs_map_release()
322 static int bpffs_obj_open(struct inode *inode, struct file *file) in bpffs_obj_open() argument
335 struct inode *dir = dentry->d_parent->d_inode; in bpf_mkobj_ops()
336 struct inode *inode = bpf_get_inode(dir->i_sb, dir, mode); in bpf_mkobj_ops() local
337 if (IS_ERR(inode)) in bpf_mkobj_ops()
338 return PTR_ERR(inode); in bpf_mkobj_ops()
340 inode->i_op = iops; in bpf_mkobj_ops()
341 inode->i_fop = fops; in bpf_mkobj_ops()
342 inode->i_private = raw; in bpf_mkobj_ops()
344 bpf_dentry_finalize(dentry, inode, dir); in bpf_mkobj_ops()
373 bpf_lookup(struct inode *dir, struct dentry *dentry, unsigned flags) in bpf_lookup()
385 static int bpf_symlink(struct user_namespace *mnt_userns, struct inode *dir, in bpf_symlink()
389 struct inode *inode; in bpf_symlink() local
394 inode = bpf_get_inode(dir->i_sb, dir, S_IRWXUGO | S_IFLNK); in bpf_symlink()
395 if (IS_ERR(inode)) { in bpf_symlink()
397 return PTR_ERR(inode); in bpf_symlink()
400 inode->i_op = &simple_symlink_inode_operations; in bpf_symlink()
401 inode->i_link = link; in bpf_symlink()
403 bpf_dentry_finalize(dentry, inode, dir); in bpf_symlink()
442 struct inode *dir; in bpf_obj_do_pin()
501 struct inode *inode; in bpf_obj_do_get() local
510 inode = d_backing_inode(path.dentry); in bpf_obj_do_get()
515 ret = bpf_inode_type(inode, type); in bpf_obj_do_get()
519 raw = bpf_any_get(inode->i_private, *type); in bpf_obj_do_get()
559 static struct bpf_prog *__get_prog_inode(struct inode *inode, enum bpf_prog_type type) in __get_prog_inode() argument
562 int ret = inode_permission(&init_user_ns, inode, MAY_READ); in __get_prog_inode()
566 if (inode->i_op == &bpf_map_iops) in __get_prog_inode()
568 if (inode->i_op == &bpf_link_iops) in __get_prog_inode()
570 if (inode->i_op != &bpf_prog_iops) in __get_prog_inode()
573 prog = inode->i_private; in __get_prog_inode()
613 static void bpf_free_inode(struct inode *inode) in bpf_free_inode() argument
617 if (S_ISLNK(inode->i_mode)) in bpf_free_inode()
618 kfree(inode->i_link); in bpf_free_inode()
619 if (!bpf_inode_type(inode, &type)) in bpf_free_inode()
620 bpf_any_put(inode->i_private, type); in bpf_free_inode()
621 free_inode_nonrcu(inode); in bpf_free_inode()
747 struct inode *inode; in bpf_fill_super() local
756 inode = sb->s_root->d_inode; in bpf_fill_super()
757 inode->i_op = &bpf_dir_iops; in bpf_fill_super()
758 inode->i_mode &= ~S_IALLUGO; in bpf_fill_super()
760 inode->i_mode |= S_ISVTX | opts->mode; in bpf_fill_super()