Lines Matching refs:ino
309 ext2_ino_t ino; member
340 static int __translate_error(ext2_filsys fs, errcode_t err, ext2_ino_t ino,
342 #define translate_error(fs, ino, err) __translate_error((fs), (err), (ino), \ argument
472 static int update_ctime(ext2_filsys fs, ext2_ino_t ino, in update_ctime() argument
490 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_ctime()
493 return translate_error(fs, ino, err); in update_ctime()
498 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_ctime()
501 return translate_error(fs, ino, err); in update_ctime()
506 static int update_atime(ext2_filsys fs, ext2_ino_t ino) in update_atime() argument
515 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_atime()
518 return translate_error(fs, ino, err); in update_atime()
532 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_atime()
535 return translate_error(fs, ino, err); in update_atime()
540 static int update_mtime(ext2_filsys fs, ext2_ino_t ino, in update_mtime() argument
556 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_mtime()
559 return translate_error(fs, ino, err); in update_mtime()
566 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in update_mtime()
569 return translate_error(fs, ino, err); in update_mtime()
632 static int check_inum_access(ext2_filsys fs, ext2_ino_t ino, mode_t mask) in check_inum_access() argument
644 err = ext2fs_read_inode(fs, ino, &inode); in check_inum_access()
646 return translate_error(fs, ino, err); in check_inum_access()
650 "uid=%d gid=%d\n", ino, in check_inum_access()
758 static int stat_inode(ext2_filsys fs, ext2_ino_t ino, struct stat *statbuf) in stat_inode() argument
767 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in stat_inode()
770 return translate_error(fs, ino, err); in stat_inode()
774 statbuf->st_ino = ino; in stat_inode()
805 ext2_ino_t ino; in op_getattr() local
813 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_getattr()
818 ret = stat_inode(fs, ino, statbuf); in op_getattr()
830 ext2_ino_t ino; in op_readlink() local
840 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_readlink()
841 if (err || ino == 0) { in op_readlink()
846 err = ext2fs_read_inode(fs, ino, &inode); in op_readlink()
848 ret = translate_error(fs, ino, err); in op_readlink()
865 err = ext2fs_file_open(fs, ino, 0, &file); in op_readlink()
867 ret = translate_error(fs, ino, err); in op_readlink()
874 ret = translate_error(fs, ino, err); in op_readlink()
883 ret = translate_error(fs, ino, err); in op_readlink()
890 ret = update_atime(fs, ino); in op_readlink()
1210 static int remove_inode(struct fuse2fs *ff, ext2_ino_t ino) in remove_inode() argument
1218 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in remove_inode()
1221 ret = translate_error(fs, ino, err); in remove_inode()
1224 dbg_printf("%s: put ino=%d links=%d\n", __func__, ino, in remove_inode()
1238 ret = update_ctime(fs, ino, &inode); in remove_inode()
1246 err = ext2fs_free_ext_attr(fs, ino, &inode); in remove_inode()
1251 err = ext2fs_punch(fs, ino, (struct ext2_inode *)&inode, NULL, in remove_inode()
1254 ret = translate_error(fs, ino, err); in remove_inode()
1259 ext2fs_inode_alloc_stats2(fs, ino, -1, in remove_inode()
1263 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in remove_inode()
1266 ret = translate_error(fs, ino, err); in remove_inode()
1276 ext2_ino_t ino; in __op_unlink() local
1280 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in __op_unlink()
1290 ret = remove_inode(ff, ino); in __op_unlink()
1777 ext2_ino_t parent, ino; in op_link() local
1817 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, src, &ino); in op_link()
1818 if (err || ino == 0) { in op_link()
1824 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_link()
1827 ret = translate_error(fs, ino, err); in op_link()
1832 ret = update_ctime(fs, ino, &inode); in op_link()
1836 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_link()
1839 ret = translate_error(fs, ino, err); in op_link()
1843 dbg_printf("%s: linking ino=%d/name=%s to dir=%d\n", __func__, ino, in op_link()
1845 err = ext2fs_link(fs, parent, node_name, ino, in op_link()
1854 err = ext2fs_link(fs, parent, node_name, ino, in op_link()
1879 ext2_ino_t ino; in op_chmod() local
1886 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_chmod()
1891 dbg_printf("%s: path=%s mode=0%o ino=%d\n", __func__, path, mode, ino); in op_chmod()
1894 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_chmod()
1897 ret = translate_error(fs, ino, err); in op_chmod()
1916 ret = update_ctime(fs, ino, &inode); in op_chmod()
1920 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_chmod()
1923 ret = translate_error(fs, ino, err); in op_chmod()
1938 ext2_ino_t ino; in op_chown() local
1945 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_chown()
1951 path, owner, group, ino); in op_chown()
1954 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_chown()
1957 ret = translate_error(fs, ino, err); in op_chown()
1986 ret = update_ctime(fs, ino, &inode); in op_chown()
1990 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_chown()
1993 ret = translate_error(fs, ino, err); in op_chown()
2008 ext2_ino_t ino; in op_truncate() local
2015 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_truncate()
2016 if (err || ino == 0) { in op_truncate()
2020 dbg_printf("%s: ino=%d len=%jd\n", __func__, ino, len); in op_truncate()
2022 ret = check_inum_access(fs, ino, W_OK); in op_truncate()
2026 err = ext2fs_file_open(fs, ino, EXT2_FILE_WRITE, &file); in op_truncate()
2028 ret = translate_error(fs, ino, err); in op_truncate()
2034 ret = translate_error(fs, ino, err); in op_truncate()
2043 ret = translate_error(fs, ino, err); in op_truncate()
2047 ret = update_mtime(fs, ino, NULL); in op_truncate()
2109 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &file->ino); in __op_open()
2110 if (err || file->ino == 0) { in __op_open()
2114 dbg_printf("%s: ino=%d\n", __func__, file->ino); in __op_open()
2116 ret = check_inum_access(fs, file->ino, check); in __op_open()
2128 ret = check_inum_access(fs, file->ino, X_OK); in __op_open()
2172 dbg_printf("%s: ino=%d off=%jd len=%jd\n", __func__, fh->ino, offset, in op_read()
2175 err = ext2fs_file_open(fs, fh->ino, fh->open_flags, &efp); in op_read()
2177 ret = translate_error(fs, fh->ino, err); in op_read()
2183 ret = translate_error(fs, fh->ino, err); in op_read()
2189 ret = translate_error(fs, fh->ino, err); in op_read()
2198 ret = translate_error(fs, fh->ino, err); in op_read()
2203 ret = update_atime(fs, fh->ino); in op_read()
2229 dbg_printf("%s: ino=%d off=%jd len=%jd\n", __func__, fh->ino, offset, in op_write()
2242 err = ext2fs_file_open(fs, fh->ino, fh->open_flags, &efp); in op_write()
2244 ret = translate_error(fs, fh->ino, err); in op_write()
2250 ret = translate_error(fs, fh->ino, err); in op_write()
2256 ret = translate_error(fs, fh->ino, err); in op_write()
2263 ret = translate_error(fs, fh->ino, err); in op_write()
2272 ret = translate_error(fs, fh->ino, err); in op_write()
2276 ret = update_mtime(fs, fh->ino, NULL); in op_write()
2299 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in op_release()
2304 ret = translate_error(fs, fh->ino, err); in op_release()
2329 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in op_fsync()
2335 ret = translate_error(fs, fh->ino, err); in op_fsync()
2424 ext2_ino_t ino; in op_getxattr() local
2436 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_getxattr()
2437 if (err || ino == 0) { in op_getxattr()
2441 dbg_printf("%s: ino=%d\n", __func__, ino); in op_getxattr()
2443 ret = check_inum_access(fs, ino, R_OK); in op_getxattr()
2447 err = ext2fs_xattrs_open(fs, ino, &h); in op_getxattr()
2449 ret = translate_error(fs, ino, err); in op_getxattr()
2455 ret = translate_error(fs, ino, err); in op_getxattr()
2461 ret = translate_error(fs, ino, err); in op_getxattr()
2490 ret = translate_error(fs, ino, err); in op_getxattr()
2525 ext2_ino_t ino; in op_listxattr() local
2537 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_listxattr()
2538 if (err || ino == 0) { in op_listxattr()
2539 ret = translate_error(fs, ino, err); in op_listxattr()
2542 dbg_printf("%s: ino=%d\n", __func__, ino); in op_listxattr()
2544 ret = check_inum_access(fs, ino, R_OK); in op_listxattr()
2548 err = ext2fs_xattrs_open(fs, ino, &h); in op_listxattr()
2550 ret = translate_error(fs, ino, err); in op_listxattr()
2556 ret = translate_error(fs, ino, err); in op_listxattr()
2564 ret = translate_error(fs, ino, err); in op_listxattr()
2580 ret = translate_error(fs, ino, err); in op_listxattr()
2587 ret = translate_error(fs, ino, err); in op_listxattr()
2605 ext2_ino_t ino; in op_setxattr() local
2617 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_setxattr()
2618 if (err || ino == 0) { in op_setxattr()
2622 dbg_printf("%s: ino=%d\n", __func__, ino); in op_setxattr()
2624 ret = check_inum_access(fs, ino, W_OK); in op_setxattr()
2631 err = ext2fs_xattrs_open(fs, ino, &h); in op_setxattr()
2633 ret = translate_error(fs, ino, err); in op_setxattr()
2639 ret = translate_error(fs, ino, err); in op_setxattr()
2655 ret = translate_error(fs, ino, err); in op_setxattr()
2659 ret = update_ctime(fs, ino, NULL); in op_setxattr()
2666 ret = translate_error(fs, ino, err); in op_setxattr()
2679 ext2_ino_t ino; in op_removexattr() local
2696 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_removexattr()
2697 if (err || ino == 0) { in op_removexattr()
2701 dbg_printf("%s: ino=%d\n", __func__, ino); in op_removexattr()
2703 ret = check_inum_access(fs, ino, W_OK); in op_removexattr()
2707 err = ext2fs_xattrs_open(fs, ino, &h); in op_removexattr()
2709 ret = translate_error(fs, ino, err); in op_removexattr()
2715 ret = translate_error(fs, ino, err); in op_removexattr()
2721 ret = translate_error(fs, ino, err); in op_removexattr()
2725 ret = update_ctime(fs, ino, NULL); in op_removexattr()
2729 ret = translate_error(fs, ino, err); in op_removexattr()
2778 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in op_readdir()
2782 err = ext2fs_dir_iterate2(fs, fh->ino, 0, NULL, op_readdir_iter, &i); in op_readdir()
2784 ret = translate_error(fs, fh->ino, err); in op_readdir()
2789 ret = update_atime(fs, fh->ino); in op_readdir()
2804 ext2_ino_t ino; in op_access() local
2811 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_access()
2812 if (err || ino == 0) { in op_access()
2817 ret = check_inum_access(fs, ino, mask); in op_access()
2967 dbg_printf("%s: ino=%d len=%jd\n", __func__, fh->ino, len); in op_ftruncate()
2974 err = ext2fs_file_open(fs, fh->ino, fh->open_flags, &efp); in op_ftruncate()
2976 ret = translate_error(fs, fh->ino, err); in op_ftruncate()
2982 ret = translate_error(fs, fh->ino, err); in op_ftruncate()
2991 ret = translate_error(fs, fh->ino, err); in op_ftruncate()
2995 ret = update_mtime(fs, fh->ino, NULL); in op_ftruncate()
3018 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in op_fgetattr()
3020 ret = stat_inode(fs, fh->ino, statbuf); in op_fgetattr()
3033 ext2_ino_t ino; in op_utimens() local
3040 err = ext2fs_namei(fs, EXT2_ROOT_INO, EXT2_ROOT_INO, path, &ino); in op_utimens()
3045 dbg_printf("%s: ino=%d\n", __func__, ino); in op_utimens()
3047 ret = check_inum_access(fs, ino, W_OK); in op_utimens()
3052 err = ext2fs_read_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_utimens()
3055 ret = translate_error(fs, ino, err); in op_utimens()
3073 ret = update_ctime(fs, ino, &inode); in op_utimens()
3077 err = ext2fs_write_inode_full(fs, ino, (struct ext2_inode *)&inode, in op_utimens()
3080 ret = translate_error(fs, ino, err); in op_utimens()
3097 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in ioctl_getflags()
3099 err = ext2fs_read_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in ioctl_getflags()
3102 return translate_error(fs, fh->ino, err); in ioctl_getflags()
3124 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in ioctl_setflags()
3126 err = ext2fs_read_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in ioctl_setflags()
3129 return translate_error(fs, fh->ino, err); in ioctl_setflags()
3140 ret = update_ctime(fs, fh->ino, &inode); in ioctl_setflags()
3144 err = ext2fs_write_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in ioctl_setflags()
3147 return translate_error(fs, fh->ino, err); in ioctl_setflags()
3159 dbg_printf("%s: ino=%d\n", __func__, fh->ino); in ioctl_getversion()
3161 err = ext2fs_read_inode_full(fs, fh->ino, (struct ext2_inode *)&inode, in ioctl_getversion()
3164 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()
3896 static int __translate_error(ext2_filsys fs, errcode_t err, ext2_ino_t ino, in __translate_error() argument
3969 if (ino) in __translate_error()
3972 error_message(err), ino, file, line); in __translate_error()
3982 fs->super->s_last_error_ino = ino; in __translate_error()
3989 fs->super->s_first_error_ino = ino; in __translate_error()