Lines Matching full:ni

244 			sbi->objid.ni = ntfs_i(inode2);  in ntfs_extend_init()
259 sbi->reparse.ni = ntfs_i(inode2); in ntfs_extend_init()
276 int ntfs_loadlog_and_replay(struct ntfs_inode *ni, struct ntfs_sb_info *sbi) in ntfs_loadlog_and_replay() argument
285 if (ni->vfs_inode.i_size >= 0x100000000ull) { in ntfs_loadlog_and_replay()
319 sbi->mft.ni = ntfs_i(inode); in ntfs_loadlog_and_replay()
322 err = ni_load_all_mi(sbi->mft.ni); in ntfs_loadlog_and_replay()
324 err = log_replay(ni, &initialized); in ntfs_loadlog_and_replay()
327 sbi->mft.ni = NULL; in ntfs_loadlog_and_replay()
341 err = ntfs_bio_fill_1(sbi, &ni->file.run); in ntfs_loadlog_and_replay()
501 struct ntfs_inode *ni = sbi->mft.ni; in ntfs_extend_mft() local
511 down_write(&ni->file.run_lock); in ntfs_extend_mft()
512 err = attr_set_size(ni, ATTR_DATA, NULL, 0, &ni->file.run, in ntfs_extend_mft()
516 up_write(&ni->file.run_lock); in ntfs_extend_mft()
522 ni->mi.dirty = true; in ntfs_extend_mft()
527 err = attr_set_size(ni, ATTR_BITMAP, NULL, 0, &sbi->mft.bitmap.run, in ntfs_extend_mft()
536 up_write(&ni->file.run_lock); in ntfs_extend_mft()
548 err = _ni_write_inode(&ni->vfs_inode, 0); in ntfs_extend_mft()
557 struct ntfs_inode *ni, struct mft_inode **mi) in ntfs_look_free_mft() argument
613 struct ntfs_inode *ni; in ntfs_look_free_mft() local
633 ni = ntfs_i(i); in ntfs_look_free_mft()
635 mrec = ni->mi.mrec; in ntfs_look_free_mft()
643 if (!ni_std(ni)) in ntfs_look_free_mft()
646 if (ni_find_attr(ni, NULL, NULL, ATTR_NAME, in ntfs_look_free_mft()
715 if (ni && !ni_add_subrecord(ni, *rno, mi)) { in ntfs_look_free_mft()
776 struct ntfs_inode *ni; in ntfs_clear_mft_tail() local
782 ni = sbi->mft.ni; in ntfs_clear_mft_tail()
783 run = &ni->file.run; in ntfs_clear_mft_tail()
785 down_read(&ni->file.run_lock); in ntfs_clear_mft_tail()
802 up_read(&ni->file.run_lock); in ntfs_clear_mft_tail()
811 * sbi->mft.ni->file.run_lock for write.
818 struct ntfs_inode *ni = sbi->mft.ni; in ntfs_refresh_zone() local
827 if (!run_lookup_entry(&ni->file.run, vcn - 1, &lcn, &len, NULL)) in ntfs_refresh_zone()
927 struct ntfs_inode *ni; in ntfs_set_state() local
943 ni = sbi->volume.ni; in ntfs_set_state()
944 if (!ni) in ntfs_set_state()
947 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_DIRTY); in ntfs_set_state()
949 attr = ni_find_attr(ni, NULL, NULL, ATTR_VOL_INFO, NULL, 0, NULL, &mi); in ntfs_set_state()
983 ni_unlock(ni); in ntfs_set_state()
987 mark_inode_dirty_sync(&ni->vfs_inode); in ntfs_set_state()
991 err = _ni_write_inode(&ni->vfs_inode, 1); in ntfs_set_state()
1689 struct ntfs_inode *ni; in ntfs_new_inode() local
1694 ni = ntfs_i(inode); in ntfs_new_inode()
1696 err = mi_format_new(&ni->mi, sbi, rno, flag, false); in ntfs_new_inode()
1710 ni = ERR_PTR(err); in ntfs_new_inode()
1712 return ni; in ntfs_new_inode()
1864 struct ntfs_inode *ni; in ntfs_security_init() local
1890 ni = ntfs_i(inode); in ntfs_security_init()
1894 attr = ni_find_attr(ni, NULL, &le, ATTR_ROOT, SDH_NAME, in ntfs_security_init()
1914 attr = ni_find_attr(ni, attr, &le, ATTR_ROOT, SII_NAME, in ntfs_security_init()
1954 err = indx_find_raw(indx_sii, ni, root_sii, &ne, &off, fnd_sii); in ntfs_security_init()
1967 sbi->security.ni = ni; in ntfs_security_init()
1985 struct ntfs_inode *ni = sbi->security.ni; in ntfs_get_security_by_id() local
1996 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_SECURITY); in ntfs_get_security_by_id()
2004 root_sii = indx_get_root(indx, ni, NULL, NULL); in ntfs_get_security_by_id()
2011 err = indx_find(indx, ni, root_sii, &security_id, sizeof(security_id), in ntfs_get_security_by_id()
2039 err = ntfs_read_run_nb(sbi, &ni->file.run, in ntfs_get_security_by_id()
2050 err = ntfs_read_run_nb(sbi, &ni->file.run, in ntfs_get_security_by_id()
2063 ni_unlock(ni); in ntfs_get_security_by_id()
2084 struct ntfs_inode *ni = sbi->security.ni; in ntfs_insert_security() local
2115 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_SECURITY); in ntfs_insert_security()
2123 root_sdh = indx_get_root(indx_sdh, ni, NULL, NULL); in ntfs_insert_security()
2129 root_sii = indx_get_root(indx_sii, ni, NULL, NULL); in ntfs_insert_security()
2139 err = indx_find(indx_sdh, ni, root_sdh, &hash_key, sizeof(hash_key), in ntfs_insert_security()
2147 err = ntfs_read_run_nb(sbi, &ni->file.run, in ntfs_insert_security()
2163 err = indx_find_sort(indx_sdh, ni, root_sdh, in ntfs_insert_security()
2183 //used = ni->vfs_inode.i_size & (SecurityDescriptorsBlockSize - 1); in ntfs_insert_security()
2187 * 0x40438 == ni->vfs_inode.i_size in ntfs_insert_security()
2203 err = ntfs_sb_write_run(sbi, &ni->file.run, sbi->security.next_off, in ntfs_insert_security()
2212 if (new_sds_size > ni->vfs_inode.i_size) { in ntfs_insert_security()
2213 err = attr_set_size(ni, ATTR_DATA, SDS_NAME, in ntfs_insert_security()
2214 ARRAY_SIZE(SDS_NAME), &ni->file.run, in ntfs_insert_security()
2221 err = ntfs_sb_write_run(sbi, &ni->file.run, mirr_off, d_security, in ntfs_insert_security()
2238 err = indx_insert_entry(indx_sii, ni, &sii_e.de, NULL, NULL, 0); in ntfs_insert_security()
2258 err = indx_insert_entry(indx_sdh, ni, &sdh_e.de, (void *)(size_t)1, in ntfs_insert_security()
2273 mark_inode_dirty(&ni->vfs_inode); in ntfs_insert_security()
2274 ni_unlock(ni); in ntfs_insert_security()
2286 struct ntfs_inode *ni = sbi->reparse.ni; in ntfs_reparse_init() local
2292 if (!ni) in ntfs_reparse_init()
2296 attr = ni_find_attr(ni, NULL, &le, ATTR_ROOT, SR_NAME, in ntfs_reparse_init()
2324 struct ntfs_inode *ni = sbi->objid.ni; in ntfs_objid_init() local
2330 if (!ni) in ntfs_objid_init()
2334 attr = ni_find_attr(ni, NULL, &le, ATTR_ROOT, SO_NAME, in ntfs_objid_init()
2359 struct ntfs_inode *ni = sbi->objid.ni; in ntfs_objid_remove() local
2362 if (!ni) in ntfs_objid_remove()
2365 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_OBJID); in ntfs_objid_remove()
2367 err = indx_delete_entry(indx, ni, guid, sizeof(*guid), NULL); in ntfs_objid_remove()
2369 mark_inode_dirty(&ni->vfs_inode); in ntfs_objid_remove()
2370 ni_unlock(ni); in ntfs_objid_remove()
2379 struct ntfs_inode *ni = sbi->reparse.ni; in ntfs_insert_reparse() local
2383 if (!ni) in ntfs_insert_reparse()
2395 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_REPARSE); in ntfs_insert_reparse()
2397 err = indx_insert_entry(indx, ni, &re.de, NULL, NULL, 0); in ntfs_insert_reparse()
2399 mark_inode_dirty(&ni->vfs_inode); in ntfs_insert_reparse()
2400 ni_unlock(ni); in ntfs_insert_reparse()
2409 struct ntfs_inode *ni = sbi->reparse.ni; in ntfs_remove_reparse() local
2416 if (!ni) in ntfs_remove_reparse()
2422 mutex_lock_nested(&ni->ni_lock, NTFS_INODE_MUTEX_REPARSE); in ntfs_remove_reparse()
2425 err = indx_delete_entry(indx, ni, &rkey, sizeof(rkey), NULL); in ntfs_remove_reparse()
2435 root_r = indx_get_root(indx, ni, NULL, NULL); in ntfs_remove_reparse()
2442 err = indx_find(indx, ni, root_r, &rkey, sizeof(rkey), (void *)1, &diff, in ntfs_remove_reparse()
2457 err = indx_delete_entry(indx, ni, &rkey, sizeof(rkey), NULL); in ntfs_remove_reparse()
2465 mark_inode_dirty(&ni->vfs_inode); in ntfs_remove_reparse()
2466 ni_unlock(ni); in ntfs_remove_reparse()
2654 struct ntfs_inode *ni = sbi->volume.ni; in ntfs_set_label() local
2673 ni_lock(ni); in ntfs_set_label()
2676 ni_remove_attr(ni, ATTR_LABEL, NULL, 0, false, NULL); in ntfs_set_label()
2678 err = ni_insert_resident(ni, uni_bytes, ATTR_LABEL, NULL, 0, &attr, in ntfs_set_label()
2691 mark_inode_dirty_sync(&ni->vfs_inode); in ntfs_set_label()
2694 ni_unlock(ni); in ntfs_set_label()
2697 err = _ni_write_inode(&ni->vfs_inode, 0); in ntfs_set_label()