Lines Matching full:ni

19 static inline bool al_is_valid_le(const struct ntfs_inode *ni,  in al_is_valid_le()  argument
22 if (!le || !ni->attr_list.le || !ni->attr_list.size) in al_is_valid_le()
25 return PtrOffset(ni->attr_list.le, le) + le16_to_cpu(le->size) <= in al_is_valid_le()
26 ni->attr_list.size; in al_is_valid_le()
29 void al_destroy(struct ntfs_inode *ni) in al_destroy() argument
31 run_close(&ni->attr_list.run); in al_destroy()
32 kvfree(ni->attr_list.le); in al_destroy()
33 ni->attr_list.le = NULL; in al_destroy()
34 ni->attr_list.size = 0; in al_destroy()
35 ni->attr_list.dirty = false; in al_destroy()
44 int ntfs_load_attr_list(struct ntfs_inode *ni, struct ATTRIB *attr) in ntfs_load_attr_list() argument
50 if (ni->attr_list.size) in ntfs_load_attr_list()
70 run_init(&ni->attr_list.run); in ntfs_load_attr_list()
77 err = run_unpack_ex(&ni->attr_list.run, ni->mi.sbi, ni->mi.rno, in ntfs_load_attr_list()
100 err = ntfs_read_run_nb(ni->mi.sbi, &ni->attr_list.run, 0, le, in ntfs_load_attr_list()
106 ni->attr_list.size = lsize; in ntfs_load_attr_list()
107 ni->attr_list.le = le; in ntfs_load_attr_list()
112 ni->attr_list.le = le; in ntfs_load_attr_list()
113 al_destroy(ni); in ntfs_load_attr_list()
125 struct ATTR_LIST_ENTRY *al_enumerate(struct ntfs_inode *ni, in al_enumerate() argument
133 le = ni->attr_list.le; in al_enumerate()
144 off = PtrOffset(ni->attr_list.le, le); in al_enumerate()
145 if (off + le_min_size > ni->attr_list.size) { in al_enumerate()
153 if (sz < le_min_size || off + sz > ni->attr_list.size || in al_enumerate()
168 struct ATTR_LIST_ENTRY *al_find_le(struct ntfs_inode *ni, in al_find_le() argument
174 return al_find_ex(ni, le, attr->type, attr_name(attr), attr->name_len, in al_find_le()
185 struct ATTR_LIST_ENTRY *al_find_ex(struct ntfs_inode *ni, in al_find_ex() argument
193 while ((le = al_enumerate(ni, le))) { in al_find_ex()
213 name_len, ni->mi.sbi->upcase, in al_find_ex()
242 static struct ATTR_LIST_ENTRY *al_find_le_to_insert(struct ntfs_inode *ni, in al_find_le_to_insert() argument
251 while ((le = al_enumerate(ni, prev = le))) { in al_find_le_to_insert()
265 name_len, ni->mi.sbi->upcase, in al_find_le_to_insert()
278 return prev ? Add2Ptr(prev, le16_to_cpu(prev->size)) : ni->attr_list.le; in al_find_le_to_insert()
286 int al_add_le(struct ntfs_inode *ni, enum ATTR_TYPE type, const __le16 *name, in al_add_le() argument
297 typeof(ni->attr_list) *al = &ni->attr_list; in al_add_le()
309 le = al_find_le_to_insert(ni, type, name, name_len, svcn); in al_add_le()
339 err = attr_set_size(ni, ATTR_LIST, NULL, 0, &al->run, new_size, in al_add_le()
351 err = ntfs_sb_write_run(ni->mi.sbi, &al->run, 0, al->le, in al_add_le()
364 bool al_remove_le(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le) in al_remove_le() argument
368 typeof(ni->attr_list) *al = &ni->attr_list; in al_remove_le()
370 if (!al_is_valid_le(ni, le)) in al_remove_le()
385 int al_update(struct ntfs_inode *ni, int sync) in al_update() argument
389 typeof(ni->attr_list) *al = &ni->attr_list; in al_update()
398 err = attr_set_size(ni, ATTR_LIST, NULL, 0, &al->run, al->size, NULL, in al_update()
406 err = ntfs_sb_write_run(ni->mi.sbi, &al->run, 0, al->le, in al_update()
414 ni->mi.dirty = true; in al_update()