Lines Matching refs:ino
123 static char *inode_name(struct inode *ino) in inode_name() argument
128 dentry = d_find_alias(ino); in inode_name()
274 unsigned long long next, ino; in hostfs_readdir() local
287 while ((name = read_dir(dir, &next, &ino, &len, &type)) != NULL) { in hostfs_readdir()
288 if (!dir_emit(ctx, name, len, ino, type)) in hostfs_readdir()
296 static int hostfs_open(struct inode *ino, struct file *file) in hostfs_open() argument
304 if ((mode & HOSTFS_I(ino)->mode) == mode) in hostfs_open()
307 mode |= HOSTFS_I(ino)->mode; in hostfs_open()
326 mutex_lock(&HOSTFS_I(ino)->open_mutex); in hostfs_open()
328 if ((mode & HOSTFS_I(ino)->mode) == mode) { in hostfs_open()
329 mutex_unlock(&HOSTFS_I(ino)->open_mutex); in hostfs_open()
333 if ((mode | HOSTFS_I(ino)->mode) != mode) { in hostfs_open()
334 mode |= HOSTFS_I(ino)->mode; in hostfs_open()
335 mutex_unlock(&HOSTFS_I(ino)->open_mutex); in hostfs_open()
339 if (HOSTFS_I(ino)->fd == -1) { in hostfs_open()
340 HOSTFS_I(ino)->fd = fd; in hostfs_open()
342 err = replace_file(fd, HOSTFS_I(ino)->fd); in hostfs_open()
345 mutex_unlock(&HOSTFS_I(ino)->open_mutex); in hostfs_open()
349 HOSTFS_I(ino)->mode = mode; in hostfs_open()
350 mutex_unlock(&HOSTFS_I(ino)->open_mutex); in hostfs_open()
500 static int hostfs_inode_update(struct inode *ino, const struct hostfs_stat *st) in hostfs_inode_update() argument
502 set_nlink(ino, st->nlink); in hostfs_inode_update()
503 i_uid_write(ino, st->uid); in hostfs_inode_update()
504 i_gid_write(ino, st->gid); in hostfs_inode_update()
505 inode_set_atime_to_ts(ino, (struct timespec64){ in hostfs_inode_update()
509 inode_set_mtime_to_ts(ino, (struct timespec64){ in hostfs_inode_update()
513 inode_set_ctime(ino, st->ctime.tv_sec, st->ctime.tv_nsec); in hostfs_inode_update()
514 ino->i_size = st->size; in hostfs_inode_update()
515 ino->i_blocks = st->blocks; in hostfs_inode_update()
519 static int hostfs_inode_set(struct inode *ino, void *data) in hostfs_inode_set() argument
530 ino->i_op = &hostfs_link_iops; in hostfs_inode_set()
533 ino->i_op = &hostfs_dir_iops; in hostfs_inode_set()
534 ino->i_fop = &hostfs_dir_fops; in hostfs_inode_set()
540 init_special_inode(ino, st->mode & S_IFMT, rdev); in hostfs_inode_set()
541 ino->i_op = &hostfs_iops; in hostfs_inode_set()
544 ino->i_op = &hostfs_iops; in hostfs_inode_set()
545 ino->i_fop = &hostfs_file_fops; in hostfs_inode_set()
546 ino->i_mapping->a_ops = &hostfs_aops; in hostfs_inode_set()
552 HOSTFS_I(ino)->dev = dev; in hostfs_inode_set()
553 HOSTFS_I(ino)->btime = st->btime; in hostfs_inode_set()
554 ino->i_ino = st->ino; in hostfs_inode_set()
555 ino->i_mode = st->mode; in hostfs_inode_set()
556 return hostfs_inode_update(ino, st); in hostfs_inode_set()
564 return inode->i_ino == st->ino && HOSTFS_I(inode)->dev == dev && in hostfs_inode_test()
579 inode = iget5_locked(sb, st.ino, hostfs_inode_test, hostfs_inode_set, in hostfs_iget()
623 static struct dentry *hostfs_lookup(struct inode *ino, struct dentry *dentry, in hostfs_lookup() argument
633 inode = hostfs_iget(ino->i_sb, name); in hostfs_lookup()
641 static int hostfs_link(struct dentry *to, struct inode *ino, in hostfs_link() argument
660 static int hostfs_unlink(struct inode *ino, struct dentry *dentry) in hostfs_unlink() argument
676 static int hostfs_symlink(struct mnt_idmap *idmap, struct inode *ino, in hostfs_symlink() argument
689 static struct dentry *hostfs_mkdir(struct mnt_idmap *idmap, struct inode *ino, in hostfs_mkdir() argument
710 static int hostfs_rmdir(struct inode *ino, struct dentry *dentry) in hostfs_rmdir() argument
778 struct inode *ino, int desired) in hostfs_permission() argument
789 name = inode_name(ino); in hostfs_permission()
793 if (S_ISCHR(ino->i_mode) || S_ISBLK(ino->i_mode) || in hostfs_permission()
794 S_ISFIFO(ino->i_mode) || S_ISSOCK(ino->i_mode)) in hostfs_permission()
800 err = generic_permission(&nop_mnt_idmap, ino, desired); in hostfs_permission()