Lines Matching refs:ino
309 ext2_ino_t ino; member
338 static int __translate_error(ext2_filsys fs, errcode_t err, ext2_ino_t ino,
340 #define translate_error(fs, ino, err) __translate_error((fs), (err), (ino), \ argument
470 static int update_ctime(ext2_filsys fs, ext2_ino_t ino, in update_ctime() argument
488 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_ctime()
491 return translate_error(fs, ino, err); in update_ctime()
496 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_ctime()
499 return translate_error(fs, ino, err); in update_ctime()
504 static int update_atime(ext2_filsys fs, ext2_ino_t ino) in update_atime() argument
513 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_atime()
516 return translate_error(fs, ino, err); in update_atime()
530 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_atime()
533 return translate_error(fs, ino, err); in update_atime()
538 static int update_mtime(ext2_filsys fs, ext2_ino_t ino, in update_mtime() argument
554 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_mtime()
557 return translate_error(fs, ino, err); in update_mtime()
564 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_mtime()
567 return translate_error(fs, ino, err); in update_mtime()
630 static int check_inum_access(ext2_filsys fs, ext2_ino_t ino, mode_t mask) in check_inum_access() argument
641 err = ext2fs_read_inode(fs, ino, &inode); in check_inum_access()
643 return translate_error(fs, ino, err); in check_inum_access()
647 "uid=%d gid=%d\n", ino, in check_inum_access()
772 static int stat_inode(ext2_filsys fs, ext2_ino_t ino, struct stat *statbuf) in stat_inode() argument
781 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in stat_inode()
784 return translate_error(fs, ino, err); in stat_inode()
788 statbuf->st_ino = ino; in stat_inode()
818 ext2_ino_t ino; in op_getattr() local
826 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_getattr()
831 ret = stat_inode(fs, ino, statbuf); in op_getattr()
843 ext2_ino_t ino; in op_readlink() local
853 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_readlink()
854 if (err || ino == 0) { in op_readlink()
859 err = ext2fs_read_inode(fs, ino, &inode); in op_readlink()
861 ret = translate_error(fs, ino, err); in op_readlink()
878 err = ext2fs_file_open(fs, ino, 0, &file); in op_readlink()
880 ret = translate_error(fs, ino, err); in op_readlink()
887 ret = translate_error(fs, ino, err); in op_readlink()
896 ret = translate_error(fs, ino, err); in op_readlink()
903 ret = update_atime(fs, ino); in op_readlink()
1219 static int remove_inode(struct fuse2fs *ff, ext2_ino_t ino) in remove_inode() argument
1227 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in remove_inode()
1230 ret = translate_error(fs, ino, err); in remove_inode()
1233 dbg_printf("%s: put ino=%d links=%d\n", __func__, ino, in remove_inode()
1247 ret = update_ctime(fs, ino, &inode); in remove_inode()
1255 err = ext2fs_free_ext_attr(fs, ino, &inode); in remove_inode()
1260 err = ext2fs_punch(fs, ino, (struct ext2_inode *)&inode, NULL, in remove_inode()
1263 ret = translate_error(fs, ino, err); in remove_inode()
1268 ext2fs_inode_alloc_stats2(fs, ino, -1, in remove_inode()
1272 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in remove_inode()
1275 ret = translate_error(fs, ino, err); in remove_inode()
1285 ext2_ino_t ino; in __op_unlink() local
1289 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in __op_unlink()
1299 ret = remove_inode(ff, ino); in __op_unlink()
1784 ext2_ino_t parent, ino; in op_link() local
1824 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, src, &ino); in op_link()
1825 if (err || ino == 0) { in op_link()
1831 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_link()
1834 ret = translate_error(fs, ino, err); in op_link()
1839 ret = update_ctime(fs, ino, &inode); in op_link()
1843 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_link()
1846 ret = translate_error(fs, ino, err); in op_link()
1850 dbg_printf("%s: linking ino=%d/name=%s to dir=%d\n", __func__, ino, in op_link()
1852 err = ext2fs_link(fs, parent, node_name, ino, in op_link()
1861 err = ext2fs_link(fs, parent, node_name, ino, in op_link()
1886 ext2_ino_t ino; in op_chmod() local
1893 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_chmod()
1898 dbg_printf("%s: path=%s mode=0%o ino=%d\n", __func__, path, mode, ino); in op_chmod()
1901 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_chmod()
1904 ret = translate_error(fs, ino, err); in op_chmod()
1923 ret = update_ctime(fs, ino, &inode); in op_chmod()
1927 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_chmod()
1930 ret = translate_error(fs, ino, err); in op_chmod()
1945 ext2_ino_t ino; in op_chown() local
1952 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_chown()
1958 path, owner, group, ino); in op_chown()
1961 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_chown()
1964 ret = translate_error(fs, ino, err); in op_chown()
1990 ret = update_ctime(fs, ino, &inode); in op_chown()
1994 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_chown()
1997 ret = translate_error(fs, ino, err); in op_chown()
2012 ext2_ino_t ino; in op_truncate() local
2019 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_truncate()
2020 if (err || ino == 0) { in op_truncate()
2024 dbg_printf("%s: ino=%d len=%jd\n", __func__, ino, len); in op_truncate()
2026 ret = check_inum_access(fs, ino, W_OK); in op_truncate()
2030 err = ext2fs_file_open(fs, ino, EXT2_FILE_WRITE, &file); in op_truncate()
2032 ret = translate_error(fs, ino, err); in op_truncate()
2038 ret = translate_error(fs, ino, err); in op_truncate()
2047 ret = translate_error(fs, ino, err); in op_truncate()
2051 ret = update_mtime(fs, ino, NULL); in op_truncate()
2113 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &file->ino); in __op_open()
2114 if (err || file->ino == 0) { in __op_open()
2118 dbg_printf("%s: ino=%d\n", __func__, file->ino); in __op_open()
2120 ret = check_inum_access(fs, file->ino, check); in __op_open()
2132 ret = check_inum_access(fs, file->ino, X_OK); in __op_open()
2176 dbg_printf("%s: ino=%d off=%jd len=%jd\n", __func__, fh->ino, offset, in op_read()
2179 err = ext2fs_file_open(fs, fh->ino, fh->open_flags, &efp); in op_read()
2181 ret = translate_error(fs, fh->ino, err); in op_read()
2187 ret = translate_error(fs, fh->ino, err); in op_read()
2193 ret = translate_error(fs, fh->ino, err); in op_read()
2202 ret = translate_error(fs, fh->ino, err); in op_read()
2207 ret = update_atime(fs, fh->ino); in op_read()
2233 dbg_printf("%s: ino=%d off=%jd len=%jd\n", __func__, fh->ino, offset, in op_write()
2246 err = ext2fs_file_open(fs, fh->ino, fh->open_flags, &efp); in op_write()
2248 ret = translate_error(fs, fh->ino, err); in op_write()
2254 ret = translate_error(fs, fh->ino, err); in op_write()
2260 ret = translate_error(fs, fh->ino, err); in op_write()
2267 ret = translate_error(fs, fh->ino, err); in op_write()
2276 ret = translate_error(fs, fh->ino, err); in op_write()
2280 ret = update_mtime(fs, fh->ino, NULL); in op_write()
2303 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in op_release()
2308 ret = translate_error(fs, fh->ino, err); in op_release()
2333 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in op_fsync()
2339 ret = translate_error(fs, fh->ino, err); in op_fsync()
2428 ext2_ino_t ino; in op_getxattr() local
2440 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_getxattr()
2441 if (err || ino == 0) { in op_getxattr()
2445 dbg_printf("%s: ino=%d\n", __func__, ino); in op_getxattr()
2447 ret = check_inum_access(fs, ino, R_OK); in op_getxattr()
2451 err = ext2fs_xattrs_open(fs, ino, &h); in op_getxattr()
2453 ret = translate_error(fs, ino, err); in op_getxattr()
2459 ret = translate_error(fs, ino, err); in op_getxattr()
2465 ret = translate_error(fs, ino, err); in op_getxattr()
2494 ret = translate_error(fs, ino, err); in op_getxattr()
2529 ext2_ino_t ino; in op_listxattr() local
2541 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_listxattr()
2542 if (err || ino == 0) { in op_listxattr()
2543 ret = translate_error(fs, ino, err); in op_listxattr()
2546 dbg_printf("%s: ino=%d\n", __func__, ino); in op_listxattr()
2548 ret = check_inum_access(fs, ino, R_OK); in op_listxattr()
2552 err = ext2fs_xattrs_open(fs, ino, &h); in op_listxattr()
2554 ret = translate_error(fs, ino, err); in op_listxattr()
2560 ret = translate_error(fs, ino, err); in op_listxattr()
2568 ret = translate_error(fs, ino, err); in op_listxattr()
2584 ret = translate_error(fs, ino, err); in op_listxattr()
2591 ret = translate_error(fs, ino, err); in op_listxattr()
2609 ext2_ino_t ino; in op_setxattr() local
2621 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_setxattr()
2622 if (err || ino == 0) { in op_setxattr()
2626 dbg_printf("%s: ino=%d\n", __func__, ino); in op_setxattr()
2628 ret = check_inum_access(fs, ino, W_OK); in op_setxattr()
2635 err = ext2fs_xattrs_open(fs, ino, &h); in op_setxattr()
2637 ret = translate_error(fs, ino, err); in op_setxattr()
2643 ret = translate_error(fs, ino, err); in op_setxattr()
2659 ret = translate_error(fs, ino, err); in op_setxattr()
2663 ret = update_ctime(fs, ino, NULL); in op_setxattr()
2670 ret = translate_error(fs, ino, err); in op_setxattr()
2683 ext2_ino_t ino; in op_removexattr() local
2700 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_removexattr()
2701 if (err || ino == 0) { in op_removexattr()
2705 dbg_printf("%s: ino=%d\n", __func__, ino); in op_removexattr()
2707 ret = check_inum_access(fs, ino, W_OK); in op_removexattr()
2711 err = ext2fs_xattrs_open(fs, ino, &h); in op_removexattr()
2713 ret = translate_error(fs, ino, err); in op_removexattr()
2719 ret = translate_error(fs, ino, err); in op_removexattr()
2725 ret = translate_error(fs, ino, err); in op_removexattr()
2729 ret = update_ctime(fs, ino, NULL); in op_removexattr()
2733 ret = translate_error(fs, ino, err); in op_removexattr()
2782 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in op_readdir()
2786 err = ext2fs_dir_iterate2(fs, fh->ino, 0, NULL, op_readdir_iter, &i); in op_readdir()
2788 ret = translate_error(fs, fh->ino, err); in op_readdir()
2793 ret = update_atime(fs, fh->ino); in op_readdir()
2808 ext2_ino_t ino; in op_access() local
2815 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_access()
2816 if (err || ino == 0) { in op_access()
2821 ret = check_inum_access(fs, ino, mask); in op_access()
2969 dbg_printf("%s: ino=%d len=%jd\n", __func__, fh->ino, len); in op_ftruncate()
2976 err = ext2fs_file_open(fs, fh->ino, fh->open_flags, &efp); in op_ftruncate()
2978 ret = translate_error(fs, fh->ino, err); in op_ftruncate()
2984 ret = translate_error(fs, fh->ino, err); in op_ftruncate()
2993 ret = translate_error(fs, fh->ino, err); in op_ftruncate()
2997 ret = update_mtime(fs, fh->ino, NULL); in op_ftruncate()
3020 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in op_fgetattr()
3022 ret = stat_inode(fs, fh->ino, statbuf); in op_fgetattr()
3035 ext2_ino_t ino; in op_utimens() local
3042 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_utimens()
3047 dbg_printf("%s: ino=%d\n", __func__, ino); in op_utimens()
3049 ret = check_inum_access(fs, ino, W_OK); in op_utimens()
3054 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_utimens()
3057 ret = translate_error(fs, ino, err); in op_utimens()
3075 ret = update_ctime(fs, ino, &inode); in op_utimens()
3079 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_utimens()
3082 ret = translate_error(fs, ino, err); in op_utimens()
3099 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in ioctl_getflags()
3101 err = ext2fs_read_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in ioctl_getflags()
3104 return translate_error(fs, fh->ino, err); in ioctl_getflags()
3125 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in ioctl_setflags()
3127 err = ext2fs_read_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in ioctl_setflags()
3130 return translate_error(fs, fh->ino, err); in ioctl_setflags()
3141 ret = update_ctime(fs, fh->ino, &inode); in ioctl_setflags()
3145 err = ext2fs_write_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in ioctl_setflags()
3148 return translate_error(fs, fh->ino, err); in ioctl_setflags()
3160 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in ioctl_getversion()
3162 err = ext2fs_read_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in ioctl_getversion()
3165 return translate_error(fs, fh->ino, err); in ioctl_getversion()
3181 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in ioctl_setversion()
3183 err = ext2fs_read_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in ioctl_setversion()
3186 return translate_error(fs, fh->ino, err); in ioctl_setversion()
3193 ret = update_ctime(fs, fh->ino, &inode); in ioctl_setversion()
3197 err = ext2fs_write_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in ioctl_setversion()
3200 return translate_error(fs, fh->ino, err); in ioctl_setversion()
3238 return translate_error(fs, fh->ino, err); in ioctl_fitrim()
3244 return translate_error(fs, fh->ino, err); in ioctl_fitrim()
3248 return translate_error(fs, fh->ino, err); in ioctl_fitrim()
3311 ext2_ino_t ino; in op_bmap() local
3318 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_bmap()
3323 dbg_printf("%s: ino=%d blk=%"PRIu64"\n", __func__, ino, *idx); in op_bmap()
3325 err = ext2fs_bmap2(fs, ino, NULL, NULL, 0, *idx, 0, (blk64_t *)idx); in op_bmap()
3327 ret = translate_error(fs, ino, err); in op_bmap()
3358 fh->ino, mode, offset / fs->blocksize, end); in fallocate_helper()
3363 err = ext2fs_read_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in fallocate_helper()
3372 err = ext2fs_fallocate(fs, flags, fh->ino, in fallocate_helper()
3376 return translate_error(fs, fh->ino, err); in fallocate_helper()
3385 return translate_error(fs, fh->ino, err); in fallocate_helper()
3389 err = update_mtime(fs, fh->ino, &inode); in fallocate_helper()
3393 err = ext2fs_write_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in fallocate_helper()
3396 return translate_error(fs, fh->ino, err); in fallocate_helper()
3401 static errcode_t clean_block_middle(ext2_filsys fs, ext2_ino_t ino, in clean_block_middle() argument
3420 err = ext2fs_bmap2(fs, ino, (struct ext2_inode *)inode, *buf, 0, in clean_block_middle()
3436 static errcode_t clean_block_edge(ext2_filsys fs, ext2_ino_t ino, in clean_block_edge() argument
3455 err = ext2fs_bmap2(fs, ino, (struct ext2_inode *)inode, *buf, 0, in clean_block_edge()
3500 fh->ino, mode, start, end); in punch_helper()
3503 err = ext2fs_read_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in punch_helper()
3506 return translate_error(fs, fh->ino, err); in punch_helper()
3510 err = clean_block_middle(fs, fh->ino, &inode, offset, in punch_helper()
3513 err = clean_block_edge(fs, fh->ino, &inode, offset, 0, &buf); in punch_helper()
3515 err = clean_block_edge(fs, fh->ino, &inode, in punch_helper()
3521 return translate_error(fs, fh->ino, err); in punch_helper()
3525 err = ext2fs_punch(fs, fh->ino, (struct ext2_inode *)&inode, in punch_helper()
3528 return translate_error(fs, fh->ino, err); in punch_helper()
3531 err = update_mtime(fs, fh->ino, &inode); in punch_helper()
3535 err = ext2fs_write_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in punch_helper()
3538 return translate_error(fs, fh->ino, err); in punch_helper()
3876 static int __translate_error(ext2_filsys fs, errcode_t err, ext2_ino_t ino, in __translate_error() argument
3949 if (ino) in __translate_error()
3952 error_message(err), ino, file, line); in __translate_error()
3962 fs->super->s_last_error_ino = ino; in __translate_error()
3969 fs->super->s_first_error_ino = ino; in __translate_error()