Lines Matching refs:ni
161 #define ntfs_real_allowed_access(scx, ni, type) ntfs_allowed_access(scx, ni, type) argument
164 #define ntfs_allowed_access(scx, ni, type) \ argument
166 ? 1 : ntfs_allowed_access(scx, ni, type))
169 #define set_archive(ni) (ni)->flags |= FILE_ATTR_ARCHIVE argument
179 #define CALL_REPARSE_PLUGIN(ni, op_name, ...) \ argument
181 ops = select_reparse_plugin(ctx, ni, &reparse), \
184 ops->op_name(ni, reparse, __VA_ARGS__) \
313 static void ntfs_fuse_update_times(ntfs_inode *ni, ntfs_time_update_flags mask) in ntfs_fuse_update_times() argument
318 (sle64_to_cpu(ni->last_access_time) in ntfs_fuse_update_times()
319 >= sle64_to_cpu(ni->last_data_change_time)) && in ntfs_fuse_update_times()
320 (sle64_to_cpu(ni->last_access_time) in ntfs_fuse_update_times()
321 >= sle64_to_cpu(ni->last_mft_change_time))) in ntfs_fuse_update_times()
323 ntfs_inode_update_times(ni, mask); in ntfs_fuse_update_times()
414 ntfs_inode *ni, mode_t accesstype) in ntfs_allowed_dir_access() argument
427 if (ni) in ntfs_allowed_dir_access()
428 ni2 = ni; in ntfs_allowed_dir_access()
435 if (!ni) in ntfs_allowed_dir_access()
529 ntfs_inode *ni;
539 ni = ntfs_pathname_to_inode(ctx->vol, NULL, path);
540 if (!ni) {
546 crtime->tv_sec = ni->creation_time;
548 if (ntfs_inode_close(ni))
558 ntfs_inode *ni;
563 ni = ntfs_pathname_to_inode(ctx->vol, NULL, path);
564 if (!ni)
568 ni->creation_time = tv->tv_sec;
569 ntfs_fuse_update_times(ni, NTFS_UPDATE_CTIME);
572 if (ntfs_inode_close(ni))
579 ntfs_inode *ni;
584 ni = ntfs_pathname_to_inode(ctx->vol, NULL, path);
585 if (!ni)
593 if (ntfs_inode_close(ni))
600 ntfs_inode *ni;
605 ni = ntfs_pathname_to_inode(ctx->vol, NULL, path);
606 if (!ni)
610 ni->last_mft_change_time = tv->tv_sec;
611 ntfs_fuse_update_times(ni, 0);
614 if (ntfs_inode_close(ni))
652 static int junction_getstat(ntfs_inode *ni, in junction_getstat() argument
660 target = ntfs_make_symlink(ni, ctx->abs_mnt_point); in junction_getstat()
671 stbuf->st_blocks = (ni->allocated_size + 511) >> 9; in junction_getstat()
681 static int wsl_getstat(ntfs_inode *ni, const REPARSE_POINT *reparse, in wsl_getstat() argument
687 res = ntfs_reparse_check_wsl(ni, reparse); in wsl_getstat()
698 res = ntfs_ea_check_wsldev(ni, &rdev); in wsl_getstat()
703 res = ntfs_ea_check_wsldev(ni, &rdev); in wsl_getstat()
748 ntfs_inode *ni, struct stat *stbuf) in ntfs_fuse_getstat() argument
756 stbuf->st_nlink = le16_to_cpu(ni->mrec->link_count); in ntfs_fuse_getstat()
758 && !(ni->flags & FILE_ATTR_REPARSE_POINT)) in ntfs_fuse_getstat()
759 stbuf->st_nlink = ntfs_dir_link_cnt(ni); in ntfs_fuse_getstat()
760 if ((ni->mrec->flags & MFT_RECORD_IS_DIRECTORY) in ntfs_fuse_getstat()
761 || (ni->flags & FILE_ATTR_REPARSE_POINT)) { in ntfs_fuse_getstat()
762 if (ni->flags & FILE_ATTR_REPARSE_POINT) { in ntfs_fuse_getstat()
767 res = CALL_REPARSE_PLUGIN(ni, getattr, stbuf); in ntfs_fuse_getstat()
773 (ni->allocated_size + 511) >> 9; in ntfs_fuse_getstat()
782 target = ntfs_make_symlink(ni, ctx->abs_mnt_point); in ntfs_fuse_getstat()
794 (ni->allocated_size + 511) >> 9; in ntfs_fuse_getstat()
796 le16_to_cpu(ni->mrec->link_count); in ntfs_fuse_getstat()
808 if (!test_nino_flag(ni, KnownSize)) { in ntfs_fuse_getstat()
809 na = ntfs_attr_open(ni, AT_INDEX_ALLOCATION, in ntfs_fuse_getstat()
812 ni->data_size = na->data_size; in ntfs_fuse_getstat()
813 ni->allocated_size = na->allocated_size; in ntfs_fuse_getstat()
814 set_nino_flag(ni, KnownSize); in ntfs_fuse_getstat()
818 stbuf->st_size = ni->data_size; in ntfs_fuse_getstat()
819 stbuf->st_blocks = ni->allocated_size >> 9; in ntfs_fuse_getstat()
826 stbuf->st_size = ni->data_size; in ntfs_fuse_getstat()
834 && (ni->flags & FILE_ATTR_ENCRYPTED) in ntfs_fuse_getstat()
835 && ni->data_size) in ntfs_fuse_getstat()
836 stbuf->st_size = ((ni->data_size + 511) & ~511) + 2; in ntfs_fuse_getstat()
842 stbuf->st_blocks = (ni->allocated_size + 511) >> 9; in ntfs_fuse_getstat()
843 if (ni->flags & FILE_ATTR_SYSTEM) { in ntfs_fuse_getstat()
844 na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); in ntfs_fuse_getstat()
846 stbuf->st_ino = ni->mft_no; in ntfs_fuse_getstat()
850 if (!(ni->flags & FILE_ATTR_HIDDEN)) { in ntfs_fuse_getstat()
933 if (ntfs_get_owner_mode(scx,ni,stbuf) < 0) in ntfs_fuse_getstat()
942 stbuf->st_ino = ni->mft_no; in ntfs_fuse_getstat()
944 stbuf->st_atimespec = ntfs2timespec(ni->last_access_time); in ntfs_fuse_getstat()
945 stbuf->st_ctimespec = ntfs2timespec(ni->last_mft_change_time); in ntfs_fuse_getstat()
946 stbuf->st_mtimespec = ntfs2timespec(ni->last_data_change_time); in ntfs_fuse_getstat()
948 stbuf->st_atim = ntfs2timespec(ni->last_access_time); in ntfs_fuse_getstat()
949 stbuf->st_ctim = ntfs2timespec(ni->last_mft_change_time); in ntfs_fuse_getstat()
950 stbuf->st_mtim = ntfs2timespec(ni->last_data_change_time); in ntfs_fuse_getstat()
955 ts = ntfs2timespec(ni->last_access_time); in ntfs_fuse_getstat()
958 ts = ntfs2timespec(ni->last_mft_change_time); in ntfs_fuse_getstat()
961 ts = ntfs2timespec(ni->last_data_change_time); in ntfs_fuse_getstat()
970 ts = ntfs2timespec(ni->last_access_time); in ntfs_fuse_getstat()
972 ts = ntfs2timespec(ni->last_mft_change_time); in ntfs_fuse_getstat()
974 ts = ntfs2timespec(ni->last_data_change_time); in ntfs_fuse_getstat()
986 ntfs_inode *ni; in ntfs_fuse_getattr() local
990 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_getattr()
991 if (!ni) in ntfs_fuse_getattr()
995 res = ntfs_fuse_getstat(&security, ni, &stbuf); in ntfs_fuse_getattr()
996 if (ntfs_inode_close(ni)) in ntfs_fuse_getattr()
1008 ntfs_inode *ni; in ntfs_fuse_fillstat() local
1012 ni = ntfs_inode_open(ctx->vol, pentry->ino); in ntfs_fuse_fillstat()
1013 if (ni) { in ntfs_fuse_fillstat()
1014 if (!ntfs_fuse_getstat(scx, ni, &pentry->attr)) { in ntfs_fuse_fillstat()
1020 if (ntfs_inode_close(ni)) in ntfs_fuse_fillstat()
1081 static int junction_readlink(ntfs_inode *ni, in junction_readlink() argument
1090 *pbuf = ntfs_make_symlink(ni, ctx->abs_mnt_point); in junction_readlink()
1119 ntfs_inode *ni = NULL; in ntfs_fuse_readlink() local
1126 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_readlink()
1127 if (!ni) { in ntfs_fuse_readlink()
1134 if (ni->flags & FILE_ATTR_REPARSE_POINT) { in ntfs_fuse_readlink()
1141 res = CALL_REPARSE_PLUGIN(ni, readlink, &buf); in ntfs_fuse_readlink()
1148 buf = ntfs_make_symlink(ni, ctx->abs_mnt_point); in ntfs_fuse_readlink()
1153 reparse = ntfs_get_reparse_point(ni); in ntfs_fuse_readlink()
1174 if (!(ni->flags & FILE_ATTR_SYSTEM)) { in ntfs_fuse_readlink()
1178 na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); in ntfs_fuse_readlink()
1219 if (ntfs_inode_close(ni)) in ntfs_fuse_readlink()
1253 ntfs_inode *ni; in ntfs_fuse_filler() local
1279 ni = ntfs_inode_open(ctx->vol, mref); in ntfs_fuse_filler()
1280 if (ni && (ni->flags & FILE_ATTR_REPARSE_POINT)) { in ntfs_fuse_filler()
1285 res = CALL_REPARSE_PLUGIN(ni, getattr, &st); in ntfs_fuse_filler()
1291 if (ni) in ntfs_fuse_filler()
1292 ntfs_inode_close(ni); in ntfs_fuse_filler()
1380 ntfs_inode *ni; in ntfs_fuse_opendir() local
1385 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_opendir()
1386 if (ni) { in ntfs_fuse_opendir()
1395 if (!ntfs_allowed_access(&security,ni,accesstype)) in ntfs_fuse_opendir()
1398 if (ni->flags & FILE_ATTR_REPARSE_POINT) { in ntfs_fuse_opendir()
1404 res = CALL_REPARSE_PLUGIN(ni, opendir, fi); in ntfs_fuse_opendir()
1409 if (ntfs_inode_close(ni)) in ntfs_fuse_opendir()
1443 ntfs_inode *ni; in ntfs_fuse_releasedir() local
1464 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_releasedir()
1465 if (ni) { in ntfs_fuse_releasedir()
1466 if (ni->flags & FILE_ATTR_REPARSE_POINT) { in ntfs_fuse_releasedir()
1469 res = CALL_REPARSE_PLUGIN(ni, release, in ntfs_fuse_releasedir()
1472 if (ntfs_inode_close(ni) && !res) in ntfs_fuse_releasedir()
1494 ntfs_inode *ni; in ntfs_fuse_readdir() local
1523 ni = ntfs_inode_open(ctx->vol,INODE(ino)); in ntfs_fuse_readdir()
1524 if (!ni) in ntfs_fuse_readdir()
1527 if (ni->flags in ntfs_fuse_readdir()
1535 err = CALL_REPARSE_PLUGIN(ni, in ntfs_fuse_readdir()
1543 if (ntfs_readdir(ni, &pos, fill, in ntfs_fuse_readdir()
1549 ntfs_fuse_update_times(ni, in ntfs_fuse_readdir()
1551 if (ntfs_inode_close(ni)) in ntfs_fuse_readdir()
1604 ntfs_inode *ni; in ntfs_fuse_open() local
1614 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_open()
1615 if (ni) { in ntfs_fuse_open()
1616 if (!(ni->flags & FILE_ATTR_REPARSE_POINT)) { in ntfs_fuse_open()
1617 na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); in ntfs_fuse_open()
1634 ni,accesstype)) in ntfs_fuse_open()
1638 if (ni->flags & FILE_ATTR_REPARSE_POINT) { in ntfs_fuse_open()
1644 res = CALL_REPARSE_PLUGIN(ni, open, fi); in ntfs_fuse_open()
1662 && (ni->flags & FILE_ATTR_ENCRYPTED)) in ntfs_fuse_open()
1674 if (ntfs_inode_close(ni)) in ntfs_fuse_open()
1705 ntfs_inode *ni = NULL; in ntfs_fuse_read() local
1722 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_read()
1723 if (!ni) { in ntfs_fuse_read()
1727 if (ni->flags & FILE_ATTR_REPARSE_POINT) { in ntfs_fuse_read()
1734 res = CALL_REPARSE_PLUGIN(ni, read, buf, size, offset, &of->fi); in ntfs_fuse_read()
1743 na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); in ntfs_fuse_read()
1767 "offset %lld: %lld <> %lld", (long long)ni->mft_no, in ntfs_fuse_read()
1782 ntfs_fuse_update_times(ni, NTFS_UPDATE_ATIME); in ntfs_fuse_read()
1786 if (ntfs_inode_close(ni)) in ntfs_fuse_read()
1799 ntfs_inode *ni = NULL; in ntfs_fuse_write() local
1803 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_write()
1804 if (!ni) { in ntfs_fuse_write()
1808 if (ni->flags & FILE_ATTR_REPARSE_POINT) { in ntfs_fuse_write()
1815 res = CALL_REPARSE_PLUGIN(ni, write, buf, size, offset, in ntfs_fuse_write()
1825 na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); in ntfs_fuse_write()
1847 - sle64_to_cpu(ni->last_data_change_time)) > ctx->dmtime)) in ntfs_fuse_write()
1848 ntfs_fuse_update_times(ni, NTFS_UPDATE_MCTIME); in ntfs_fuse_write()
1853 set_archive(ni); in ntfs_fuse_write()
1854 if (ntfs_inode_close(ni)) in ntfs_fuse_write()
1866 ntfs_inode *ni; in ntfs_fuse_chmod() local
1873 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_chmod()
1874 if (!ni) in ntfs_fuse_chmod()
1879 if (ntfs_set_mode(scx, ni, mode)) in ntfs_fuse_chmod()
1882 ntfs_fuse_update_times(ni, in ntfs_fuse_chmod()
1889 res = ntfs_fuse_getstat(scx, ni, stbuf); in ntfs_fuse_chmod()
1891 NInoSetDirty(ni); in ntfs_fuse_chmod()
1893 res = ntfs_fuse_getstat(scx, ni, stbuf); in ntfs_fuse_chmod()
1894 if (ntfs_inode_close(ni)) in ntfs_fuse_chmod()
1904 ntfs_inode *ni; in ntfs_fuse_chown() local
1914 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_chown()
1915 if (!ni) in ntfs_fuse_chown()
1922 if (ntfs_set_owner(scx, ni, uid, gid)) in ntfs_fuse_chown()
1925 ntfs_fuse_update_times(ni, in ntfs_fuse_chown()
1932 res = ntfs_fuse_getstat(scx, ni, stbuf); in ntfs_fuse_chown()
1935 res = ntfs_fuse_getstat(scx, ni, stbuf); in ntfs_fuse_chown()
1936 if (ntfs_inode_close(ni)) in ntfs_fuse_chown()
1946 ntfs_inode *ni; in ntfs_fuse_chownmod() local
1956 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_chownmod()
1957 if (!ni) in ntfs_fuse_chownmod()
1962 if (ntfs_set_ownmod(scx, ni, uid, gid, mode)) in ntfs_fuse_chownmod()
1965 ntfs_fuse_update_times(ni, in ntfs_fuse_chownmod()
1972 res = ntfs_fuse_getstat(scx, ni, stbuf); in ntfs_fuse_chownmod()
1975 res = ntfs_fuse_getstat(scx, ni, stbuf); in ntfs_fuse_chownmod()
1976 if (ntfs_inode_close(ni)) in ntfs_fuse_chownmod()
1991 ntfs_inode *ni = NULL; in ntfs_fuse_trunc() local
1996 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_trunc()
1997 if (!ni) in ntfs_fuse_trunc()
2005 if (!(ni->flags & FILE_ATTR_REPARSE_POINT)) { in ntfs_fuse_trunc()
2006 na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); in ntfs_fuse_trunc()
2017 && !ntfs_allowed_access(scx, ni, S_IWRITE)) { in ntfs_fuse_trunc()
2022 if (ni->flags & FILE_ATTR_REPARSE_POINT) { in ntfs_fuse_trunc()
2027 res = CALL_REPARSE_PLUGIN(ni, truncate, size); in ntfs_fuse_trunc()
2029 set_archive(ni); in ntfs_fuse_trunc()
2051 set_archive(ni); in ntfs_fuse_trunc()
2056 ntfs_fuse_update_times(ni, NTFS_UPDATE_MCTIME); in ntfs_fuse_trunc()
2057 res = ntfs_fuse_getstat(scx, ni, stbuf); in ntfs_fuse_trunc()
2062 if (ntfs_inode_close(ni)) in ntfs_fuse_trunc()
2072 ntfs_inode *ni; in ntfs_fuse_utimens() local
2075 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_utimens()
2076 if (!ni) in ntfs_fuse_utimens()
2082 if (ntfs_allowed_as_owner(scx, ni) in ntfs_fuse_utimens()
2085 && ntfs_allowed_access(scx, ni, S_IWRITE))) { in ntfs_fuse_utimens()
2094 ni->last_access_time in ntfs_fuse_utimens()
2097 ni->last_access_time in ntfs_fuse_utimens()
2100 ni->last_access_time.tv_sec in ntfs_fuse_utimens()
2103 ni->last_access_time.tv_nsec in ntfs_fuse_utimens()
2113 ni->last_data_change_time in ntfs_fuse_utimens()
2116 ni->last_data_change_time in ntfs_fuse_utimens()
2119 ni->last_data_change_time.tv_sec in ntfs_fuse_utimens()
2122 ni->last_data_change_time.tv_nsec in ntfs_fuse_utimens()
2127 ntfs_inode_update_times(ni, mask); in ntfs_fuse_utimens()
2134 res = ntfs_fuse_getstat(scx, ni, stbuf); in ntfs_fuse_utimens()
2135 if (ntfs_inode_close(ni)) in ntfs_fuse_utimens()
2145 ntfs_inode *ni; in ntfs_fuse_utime() local
2154 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_utime()
2155 if (!ni) in ntfs_fuse_utime()
2159 ownerok = ntfs_allowed_as_owner(scx, ni); in ntfs_fuse_utime()
2169 && ntfs_allowed_access(scx, ni, S_IWRITE); in ntfs_fuse_utime()
2179 ni->last_access_time = timespec2ntfs(actime); in ntfs_fuse_utime()
2180 ni->last_data_change_time = timespec2ntfs(modtime); in ntfs_fuse_utime()
2181 ntfs_fuse_update_times(ni, NTFS_UPDATE_CTIME); in ntfs_fuse_utime()
2186 && ntfs_allowed_access(scx, ni, S_IWRITE); in ntfs_fuse_utime()
2190 ntfs_inode_update_times(ni, NTFS_UPDATE_AMCTIME); in ntfs_fuse_utime()
2198 ni->last_access_time = timespec2ntfs(actime); in ntfs_fuse_utime()
2199 ni->last_data_change_time = timespec2ntfs(modtime); in ntfs_fuse_utime()
2200 ntfs_fuse_update_times(ni, NTFS_UPDATE_CTIME); in ntfs_fuse_utime()
2202 ntfs_inode_update_times(ni, NTFS_UPDATE_AMCTIME); in ntfs_fuse_utime()
2205 res = ntfs_fuse_getstat(scx, ni, stbuf); in ntfs_fuse_utime()
2206 if (ntfs_inode_close(ni)) in ntfs_fuse_utime()
2217 ntfs_inode *ni; in ntfs_fuse_setattr() local
2229 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_setattr()
2230 if (!ni) in ntfs_fuse_setattr()
2233 res = ntfs_fuse_getstat(&security, ni, &stbuf); in ntfs_fuse_setattr()
2234 if (ntfs_inode_close(ni)) in ntfs_fuse_setattr()
2304 ntfs_inode *ni; in ntfs_fuse_access() local
2314 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_access()
2315 if (!ni) { in ntfs_fuse_access()
2324 ni, mode)) in ntfs_fuse_access()
2327 if (ntfs_inode_close(ni)) in ntfs_fuse_access()
2345 ntfs_inode *dir_ni = NULL, *ni; in ntfs_fuse_create() local
2424 ni = (*ops->create)(dir_ni, reparse, in ntfs_fuse_create()
2427 ni = (ntfs_inode*)NULL; in ntfs_fuse_create()
2432 ni = (ntfs_inode*)NULL; in ntfs_fuse_create()
2439 ni = ntfs_create_device(dir_ni, securid, in ntfs_fuse_create()
2450 ni = ntfs_create_symlink(dir_ni, in ntfs_fuse_create()
2456 ni = ntfs_create(dir_ni, securid, uname, in ntfs_fuse_create()
2461 if (ni) { in ntfs_fuse_create()
2469 && ntfs_set_inherited_posix(&security, ni, in ntfs_fuse_create()
2475 && ntfs_set_owner_mode(&security, ni, in ntfs_fuse_create()
2481 set_archive(ni); in ntfs_fuse_create()
2483 if (fi && (ni->flags & FILE_ATTR_COMPRESSED)) { in ntfs_fuse_create()
2490 && (ni->flags & FILE_ATTR_ENCRYPTED)) in ntfs_fuse_create()
2495 ntfs_inode_update_mbsname(dir_ni, name, ni->mft_no); in ntfs_fuse_create()
2496 NInoSetDirty(ni); in ntfs_fuse_create()
2497 e->ino = ni->mft_no; in ntfs_fuse_create()
2501 res = ntfs_fuse_getstat(&security, ni, &e->attr); in ntfs_fuse_create()
2506 if (ntfs_inode_close_in_dir(ni, dir_ni)) in ntfs_fuse_create()
2588 ntfs_inode *dir_ni = NULL, *ni; in ntfs_fuse_newlink() local
2593 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_newlink()
2594 if (!ni) { in ntfs_fuse_newlink()
2600 if (e && (ni->mrec->flags & MFT_RECORD_IS_DIRECTORY)) { in ntfs_fuse_newlink()
2636 ni, uname, uname_len); in ntfs_fuse_newlink()
2644 if (ntfs_link(ni, dir_ni, uname, uname_len)) { in ntfs_fuse_newlink()
2649 ntfs_inode_update_mbsname(dir_ni, newname, ni->mft_no); in ntfs_fuse_newlink()
2651 e->ino = ni->mft_no; in ntfs_fuse_newlink()
2655 res = ntfs_fuse_getstat(&security, ni, &e->attr); in ntfs_fuse_newlink()
2657 set_archive(ni); in ntfs_fuse_newlink()
2658 ntfs_fuse_update_times(ni, NTFS_UPDATE_CTIME); in ntfs_fuse_newlink()
2668 if (ntfs_inode_close(ni)) in ntfs_fuse_newlink()
2692 ntfs_inode *dir_ni = NULL, *ni = NULL; in ntfs_fuse_rm() local
2736 ni = ntfs_inode_open(ctx->vol, ino); in ntfs_fuse_rm()
2737 if (!ni) { in ntfs_fuse_rm()
2744 isdir = ni->mrec->flags & MFT_RECORD_IS_DIRECTORY; in ntfs_fuse_rm()
2747 if (ni->flags & FILE_ATTR_REPARSE_POINT) { in ntfs_fuse_rm()
2757 res = CALL_REPARSE_PLUGIN(ni, getattr, &st); in ntfs_fuse_rm()
2778 && !ntfs_allowed_dir_access(&security, dir_ni, ino, ni, in ntfs_fuse_rm()
2804 if (ni) { in ntfs_fuse_rm()
2805 if (ntfs_inode_close(ni)) { in ntfs_fuse_rm()
2809 ni = (ntfs_inode*)NULL; in ntfs_fuse_rm()
2850 if (!ni) { in ntfs_fuse_rm()
2851 ni = ntfs_inode_open(ctx->vol, ino); in ntfs_fuse_rm()
2852 if (!ni) { in ntfs_fuse_rm()
2863 ni, uname, uname_len); in ntfs_fuse_rm()
2868 if (ntfs_delete(ctx->vol, (char*)NULL, ni, dir_ni, in ntfs_fuse_rm()
2872 ni = dir_ni = NULL; in ntfs_fuse_rm()
2874 if (ntfs_inode_close(ni) && !res) in ntfs_fuse_rm()
3015 ntfs_inode *ni; in ntfs_fuse_rename() local
3036 ni = ntfs_inode_open(ctx->vol, INODE(xino)); in ntfs_fuse_rename()
3037 if (!ni) in ntfs_fuse_rename()
3040 ret = ntfs_check_empty_dir(ni); in ntfs_fuse_rename()
3043 ntfs_inode_close(ni); in ntfs_fuse_rename()
3047 if (ntfs_inode_close(ni)) { in ntfs_fuse_rename()
3075 ntfs_inode *ni = NULL; in ntfs_fuse_release() local
3089 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_release()
3090 if (!ni) { in ntfs_fuse_release()
3094 if (ni->flags & FILE_ATTR_REPARSE_POINT) { in ntfs_fuse_release()
3099 res = CALL_REPARSE_PLUGIN(ni, release, &of->fi); in ntfs_fuse_release()
3109 na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); in ntfs_fuse_release()
3125 ntfs_inode_update_times(ni,NTFS_UPDATE_MCTIME); in ntfs_fuse_release()
3129 if (ntfs_inode_close(ni)) in ntfs_fuse_release()
3198 ntfs_inode *ni; in ntfs_fuse_ioctl() local
3206 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_ioctl()
3207 if (!ni) { in ntfs_fuse_ioctl()
3227 ret = ntfs_ioctl(ni, (unsigned int)cmd, arg, flags, buf); in ntfs_fuse_ioctl()
3228 if (ntfs_inode_close (ni)) in ntfs_fuse_ioctl()
3244 ntfs_inode *ni; in ntfs_fuse_bmap() local
3256 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_bmap()
3257 if (!ni) { in ntfs_fuse_bmap()
3262 na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); in ntfs_fuse_bmap()
3285 if (ntfs_inode_close(ni)) in ntfs_fuse_bmap()
3322 ntfs_inode *ni; in ntfs_check_access_xattr() local
3327 ni = (ntfs_inode*)NULL; in ntfs_check_access_xattr()
3355 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_check_access_xattr()
3357 if (ni && (acctype != S_IEXEC)) { in ntfs_check_access_xattr()
3360 if (ni->mft_no == FILE_root) { in ntfs_check_access_xattr()
3364 ni, acctype)) in ntfs_check_access_xattr()
3367 dir_ni = ntfs_dir_parent_inode(ni); in ntfs_check_access_xattr()
3378 ntfs_inode_close(ni); in ntfs_check_access_xattr()
3379 ni = (ntfs_inode*)NULL; in ntfs_check_access_xattr()
3383 return (ni); in ntfs_check_access_xattr()
3466 ntfs_inode *ni; in ntfs_fuse_listxattr() local
3476 ni = ntfs_inode_open(ctx->vol, INODE(ino)); in ntfs_fuse_listxattr()
3477 if (!ni) { in ntfs_fuse_listxattr()
3482 if (!user_xattrs_allowed(ctx, ni)) in ntfs_fuse_listxattr()
3486 if (!ntfs_allowed_access(&security,ni,S_IREAD)) { in ntfs_fuse_listxattr()
3491 actx = ntfs_attr_get_search_ctx(ni, NULL); in ntfs_fuse_listxattr()
3506 ret = ntfs_fuse_listxattr_common(ni, actx, list, size, in ntfs_fuse_listxattr()
3516 if (ntfs_inode_close(ni)) in ntfs_fuse_listxattr()
3541 ntfs_inode *ni; local
3574 ni = ntfs_check_access_xattr(req, &security, ino,
3576 if (ni) {
3577 if (ntfs_allowed_access(&security,ni,S_IREAD)) {
3579 dir_ni = ntfs_dir_parent_inode(ni);
3583 attr, ni, dir_ni, value, size);
3588 if (ntfs_inode_close(ni))
3597 ni = ntfs_inode_open(ctx->vol, INODE(ino));
3598 if (ni) {
3602 dir_ni = ntfs_dir_parent_inode(ni);
3606 attr, ni, dir_ni, value, size);
3609 if (ntfs_inode_close(ni))
3644 ni = ntfs_inode_open(ctx->vol, INODE(ino));
3645 if (!ni) {
3650 if (!user_xattrs_allowed(ctx, ni)) {
3656 if (!ntfs_allowed_access(&security, ni, S_IREAD)) {
3666 na = ntfs_attr_open(ni, AT_DATA, lename, lename_len);
3694 if (ntfs_inode_close(ni))
3723 ntfs_inode *ni; local
3754 ni = ntfs_check_access_xattr(req,&security,ino,attr,TRUE);
3755 if (ni) {
3756 if (ntfs_allowed_as_owner(&security, ni)) {
3758 dir_ni = ntfs_dir_parent_inode(ni);
3762 attr, ni, dir_ni, value, size, flags);
3770 ntfs_fuse_update_times(ni,
3772 if (ntfs_inode_close(ni))
3780 ni = ntfs_check_access_xattr(req, &security,
3783 ni = ntfs_inode_open(ctx->vol, INODE(ino));
3784 if (ni) {
3790 || ntfs_allowed_as_owner(&security, ni)) {
3792 dir_ni = ntfs_dir_parent_inode(ni);
3796 attr, ni, dir_ni, value, size, flags);
3804 ntfs_fuse_update_times(ni,
3806 if (ntfs_inode_close(ni))
3850 ni = ntfs_inode_open(ctx->vol, INODE(ino));
3851 if (!ni) {
3865 if (!ntfs_allowed_as_owner(&security, ni)) {
3872 if (!user_xattrs_allowed(ctx, ni)) {
3876 if (!ntfs_allowed_access(&security,ni,S_IWRITE)) {
3885 && !user_xattrs_allowed(ctx, ni)) {
3897 na = ntfs_attr_open(ni, AT_DATA, lename, lename_len);
3907 if (ntfs_attr_add(ni, AT_DATA, lename, lename_len, NULL, 0)) {
3911 if (!(ni->flags & FILE_ATTR_ARCHIVE)) {
3912 set_archive(ni);
3913 NInoFileNameSetDirty(ni);
3915 na = ntfs_attr_open(ni, AT_DATA, lename, lename_len);
3946 && (ni->flags & FILE_ATTR_ENCRYPTED)) {
3952 ntfs_fuse_update_times(ni, NTFS_UPDATE_CTIME);
3953 if (!(ni->flags & FILE_ATTR_ARCHIVE)) {
3954 set_archive(ni);
3955 NInoFileNameSetDirty(ni);
3962 if (ntfs_inode_close(ni))
3973 ntfs_inode *ni; local
4000 ni = ntfs_check_access_xattr(req, &security, ino,
4002 if (ni) {
4003 if (ntfs_allowed_as_owner(&security, ni)) {
4005 dir_ni = ntfs_dir_parent_inode(ni);
4009 attr, ni, dir_ni);
4017 ntfs_fuse_update_times(ni,
4019 if (ntfs_inode_close(ni))
4027 ni = ntfs_check_access_xattr(req, &security,
4030 ni = ntfs_inode_open(ctx->vol, INODE(ino));
4031 if (ni) {
4037 || ntfs_allowed_as_owner(&security, ni)) {
4039 dir_ni = ntfs_dir_parent_inode(ni);
4043 attr, ni, dir_ni);
4051 ntfs_fuse_update_times(ni,
4053 if (ntfs_inode_close(ni))
4100 ni = ntfs_inode_open(ctx->vol, INODE(ino));
4101 if (!ni) {
4115 if (!ntfs_allowed_as_owner(&security, ni)) {
4122 if (!user_xattrs_allowed(ctx, ni)) {
4126 if (!ntfs_allowed_access(&security,ni,S_IWRITE)) {
4135 && !user_xattrs_allowed(ctx, ni)) {
4145 if (ntfs_attr_remove(ni, AT_DATA, lename, lename_len)) {
4151 ntfs_fuse_update_times(ni, NTFS_UPDATE_CTIME);
4152 if (!(ni->flags & FILE_ATTR_ARCHIVE)) {
4153 set_archive(ni);
4154 NInoFileNameSetDirty(ni);
4159 if (ntfs_inode_close(ni))