Lines Matching refs:ni
219 sbi->objid.ni = ntfs_i(inode2); in ntfs_extend_init()
234 sbi->reparse.ni = ntfs_i(inode2); in ntfs_extend_init()
251 int ntfs_loadlog_and_replay(struct ntfs_inode *ni, struct ntfs_sb_info *sbi) in ntfs_loadlog_and_replay() argument
260 if (ni->vfs_inode.i_size >= 0x100000000ull) { in ntfs_loadlog_and_replay()
294 sbi->mft.ni = ntfs_i(inode); in ntfs_loadlog_and_replay()
297 err = ni_load_all_mi(sbi->mft.ni); in ntfs_loadlog_and_replay()
299 err = log_replay(ni, &initialized); in ntfs_loadlog_and_replay()
302 sbi->mft.ni = NULL; in ntfs_loadlog_and_replay()
316 err = ntfs_bio_fill_1(sbi, &ni->file.run); in ntfs_loadlog_and_replay()
472 struct ntfs_inode *ni = sbi->mft.ni; in ntfs_extend_mft() local
482 down_write(&ni->file.run_lock); in ntfs_extend_mft()
483 err = attr_set_size(ni, ATTR_DATA, NULL, 0, &ni->file.run, in ntfs_extend_mft()
487 up_write(&ni->file.run_lock); in ntfs_extend_mft()
493 ni->mi.dirty = true; in ntfs_extend_mft()
498 err = attr_set_size(ni, ATTR_BITMAP, NULL, 0, &sbi->mft.bitmap.run, in ntfs_extend_mft()
507 up_write(&ni->file.run_lock); in ntfs_extend_mft()
519 err = _ni_write_inode(&ni->vfs_inode, 0); in ntfs_extend_mft()
528 struct ntfs_inode *ni, struct mft_inode **mi) in ntfs_look_free_mft() argument
584 struct ntfs_inode *ni; in ntfs_look_free_mft() local
604 ni = ntfs_i(i); in ntfs_look_free_mft()
606 mrec = ni->mi.mrec; in ntfs_look_free_mft()
614 if (!ni_std(ni)) in ntfs_look_free_mft()
617 if (ni_find_attr(ni, NULL, NULL, ATTR_NAME, in ntfs_look_free_mft()
686 if (ni && !ni_add_subrecord(ni, *rno, mi)) { in ntfs_look_free_mft()
747 struct ntfs_inode *ni; in ntfs_clear_mft_tail() local
753 ni = sbi->mft.ni; in ntfs_clear_mft_tail()
754 run = &ni->file.run; in ntfs_clear_mft_tail()
756 down_read(&ni->file.run_lock); in ntfs_clear_mft_tail()
773 up_read(&ni->file.run_lock); in ntfs_clear_mft_tail()
789 struct ntfs_inode *ni = sbi->mft.ni; in ntfs_refresh_zone() local
798 if (!run_lookup_entry(&ni->file.run, vcn - 1, &lcn, &len, NULL)) in ntfs_refresh_zone()
901 struct ntfs_inode *ni; in ntfs_set_state() local
916 ni = sbi->volume.ni; in ntfs_set_state()
917 if (!ni) in ntfs_set_state()
920 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_DIRTY); in ntfs_set_state()
922 attr = ni_find_attr(ni, NULL, NULL, ATTR_VOL_INFO, NULL, 0, NULL, &mi); in ntfs_set_state()
952 ni_unlock(ni); in ntfs_set_state()
956 mark_inode_dirty(&ni->vfs_inode); in ntfs_set_state()
965 err = sync_inode_metadata(&ni->vfs_inode, 0); in ntfs_set_state()
967 err = filemap_fdatawrite(ni->vfs_inode.i_mapping); in ntfs_set_state()
1640 struct ntfs_inode *ni; in ntfs_new_inode() local
1645 ni = ntfs_i(inode); in ntfs_new_inode()
1647 err = mi_format_new(&ni->mi, sbi, rno, dir ? RECORD_FLAG_DIR : 0, in ntfs_new_inode()
1661 ni = ERR_PTR(err); in ntfs_new_inode()
1663 return ni; in ntfs_new_inode()
1815 struct ntfs_inode *ni; in ntfs_security_init() local
1841 ni = ntfs_i(inode); in ntfs_security_init()
1845 attr = ni_find_attr(ni, NULL, &le, ATTR_ROOT, SDH_NAME, in ntfs_security_init()
1864 attr = ni_find_attr(ni, attr, &le, ATTR_ROOT, SII_NAME, in ntfs_security_init()
1903 err = indx_find_raw(indx_sii, ni, root_sii, &ne, &off, fnd_sii); in ntfs_security_init()
1916 sbi->security.ni = ni; in ntfs_security_init()
1934 struct ntfs_inode *ni = sbi->security.ni; in ntfs_get_security_by_id() local
1945 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_SECURITY); in ntfs_get_security_by_id()
1953 root_sii = indx_get_root(indx, ni, NULL, NULL); in ntfs_get_security_by_id()
1960 err = indx_find(indx, ni, root_sii, &security_id, sizeof(security_id), in ntfs_get_security_by_id()
1988 err = ntfs_read_run_nb(sbi, &ni->file.run, in ntfs_get_security_by_id()
1999 err = ntfs_read_run_nb(sbi, &ni->file.run, in ntfs_get_security_by_id()
2012 ni_unlock(ni); in ntfs_get_security_by_id()
2033 struct ntfs_inode *ni = sbi->security.ni; in ntfs_insert_security() local
2064 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_SECURITY); in ntfs_insert_security()
2072 root_sdh = indx_get_root(indx_sdh, ni, NULL, NULL); in ntfs_insert_security()
2078 root_sii = indx_get_root(indx_sii, ni, NULL, NULL); in ntfs_insert_security()
2088 err = indx_find(indx_sdh, ni, root_sdh, &hash_key, sizeof(hash_key), in ntfs_insert_security()
2096 err = ntfs_read_run_nb(sbi, &ni->file.run, in ntfs_insert_security()
2112 err = indx_find_sort(indx_sdh, ni, root_sdh, in ntfs_insert_security()
2152 err = ntfs_sb_write_run(sbi, &ni->file.run, sbi->security.next_off, in ntfs_insert_security()
2161 if (new_sds_size > ni->vfs_inode.i_size) { in ntfs_insert_security()
2162 err = attr_set_size(ni, ATTR_DATA, SDS_NAME, in ntfs_insert_security()
2163 ARRAY_SIZE(SDS_NAME), &ni->file.run, in ntfs_insert_security()
2170 err = ntfs_sb_write_run(sbi, &ni->file.run, mirr_off, d_security, in ntfs_insert_security()
2187 err = indx_insert_entry(indx_sii, ni, &sii_e.de, NULL, NULL, 0); in ntfs_insert_security()
2207 err = indx_insert_entry(indx_sdh, ni, &sdh_e.de, (void *)(size_t)1, in ntfs_insert_security()
2222 mark_inode_dirty(&ni->vfs_inode); in ntfs_insert_security()
2223 ni_unlock(ni); in ntfs_insert_security()
2235 struct ntfs_inode *ni = sbi->reparse.ni; in ntfs_reparse_init() local
2241 if (!ni) in ntfs_reparse_init()
2245 attr = ni_find_attr(ni, NULL, &le, ATTR_ROOT, SR_NAME, in ntfs_reparse_init()
2273 struct ntfs_inode *ni = sbi->objid.ni; in ntfs_objid_init() local
2279 if (!ni) in ntfs_objid_init()
2283 attr = ni_find_attr(ni, NULL, &le, ATTR_ROOT, SO_NAME, in ntfs_objid_init()
2308 struct ntfs_inode *ni = sbi->objid.ni; in ntfs_objid_remove() local
2311 if (!ni) in ntfs_objid_remove()
2314 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_OBJID); in ntfs_objid_remove()
2316 err = indx_delete_entry(indx, ni, guid, sizeof(*guid), NULL); in ntfs_objid_remove()
2318 mark_inode_dirty(&ni->vfs_inode); in ntfs_objid_remove()
2319 ni_unlock(ni); in ntfs_objid_remove()
2328 struct ntfs_inode *ni = sbi->reparse.ni; in ntfs_insert_reparse() local
2332 if (!ni) in ntfs_insert_reparse()
2344 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_REPARSE); in ntfs_insert_reparse()
2346 err = indx_insert_entry(indx, ni, &re.de, NULL, NULL, 0); in ntfs_insert_reparse()
2348 mark_inode_dirty(&ni->vfs_inode); in ntfs_insert_reparse()
2349 ni_unlock(ni); in ntfs_insert_reparse()
2358 struct ntfs_inode *ni = sbi->reparse.ni; in ntfs_remove_reparse() local
2365 if (!ni) in ntfs_remove_reparse()
2371 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_REPARSE); in ntfs_remove_reparse()
2374 err = indx_delete_entry(indx, ni, &rkey, sizeof(rkey), NULL); in ntfs_remove_reparse()
2384 root_r = indx_get_root(indx, ni, NULL, NULL); in ntfs_remove_reparse()
2391 err = indx_find(indx, ni, root_r, &rkey, sizeof(rkey), (void *)1, &diff, in ntfs_remove_reparse()
2406 err = indx_delete_entry(indx, ni, &rkey, sizeof(rkey), NULL); in ntfs_remove_reparse()
2414 mark_inode_dirty(&ni->vfs_inode); in ntfs_remove_reparse()
2415 ni_unlock(ni); in ntfs_remove_reparse()