@@ -75,7 +75,7 @@ struct ATTR_STD_INFO *ni_std(struct ntfs_inode *ni)
7575{
7676 const struct ATTRIB * attr ;
7777
78- attr = mi_find_attr (& ni -> mi , NULL , ATTR_STD , NULL , 0 , NULL );
78+ attr = mi_find_attr (ni , & ni -> mi , NULL , ATTR_STD , NULL , 0 , NULL );
7979 return attr ? resident_data_ex (attr , sizeof (struct ATTR_STD_INFO )) :
8080 NULL ;
8181}
@@ -89,7 +89,7 @@ struct ATTR_STD_INFO5 *ni_std5(struct ntfs_inode *ni)
8989{
9090 const struct ATTRIB * attr ;
9191
92- attr = mi_find_attr (& ni -> mi , NULL , ATTR_STD , NULL , 0 , NULL );
92+ attr = mi_find_attr (ni , & ni -> mi , NULL , ATTR_STD , NULL , 0 , NULL );
9393
9494 return attr ? resident_data_ex (attr , sizeof (struct ATTR_STD_INFO5 )) :
9595 NULL ;
@@ -201,7 +201,8 @@ struct ATTRIB *ni_find_attr(struct ntfs_inode *ni, struct ATTRIB *attr,
201201 * mi = & ni -> mi ;
202202
203203 /* Look for required attribute in primary record. */
204- return mi_find_attr (& ni -> mi , attr , type , name , name_len , NULL );
204+ return mi_find_attr (ni , & ni -> mi , attr , type , name , name_len ,
205+ NULL );
205206 }
206207
207208 /* First look for list entry of required type. */
@@ -217,7 +218,7 @@ struct ATTRIB *ni_find_attr(struct ntfs_inode *ni, struct ATTRIB *attr,
217218 return NULL ;
218219
219220 /* Look for required attribute. */
220- attr = mi_find_attr (m , NULL , type , name , name_len , & le -> id );
221+ attr = mi_find_attr (ni , m , NULL , type , name , name_len , & le -> id );
221222
222223 if (!attr )
223224 goto out ;
@@ -259,7 +260,7 @@ struct ATTRIB *ni_enum_attr_ex(struct ntfs_inode *ni, struct ATTRIB *attr,
259260 if (mi )
260261 * mi = & ni -> mi ;
261262 /* Enum attributes in primary record. */
262- return mi_enum_attr (& ni -> mi , attr );
263+ return mi_enum_attr (ni , & ni -> mi , attr );
263264 }
264265
265266 /* Get next list entry. */
@@ -275,7 +276,7 @@ struct ATTRIB *ni_enum_attr_ex(struct ntfs_inode *ni, struct ATTRIB *attr,
275276 * mi = mi2 ;
276277
277278 /* Find attribute in loaded record. */
278- return rec_find_attr_le (mi2 , le2 );
279+ return rec_find_attr_le (ni , mi2 , le2 );
279280}
280281
281282/*
@@ -293,7 +294,8 @@ struct ATTRIB *ni_load_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
293294 if (!ni -> attr_list .size ) {
294295 if (pmi )
295296 * pmi = & ni -> mi ;
296- return mi_find_attr (& ni -> mi , NULL , type , name , name_len , NULL );
297+ return mi_find_attr (ni , & ni -> mi , NULL , type , name , name_len ,
298+ NULL );
297299 }
298300
299301 le = al_find_ex (ni , NULL , type , name , name_len , NULL );
@@ -319,7 +321,7 @@ struct ATTRIB *ni_load_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
319321 if (pmi )
320322 * pmi = mi ;
321323
322- attr = mi_find_attr (mi , NULL , type , name , name_len , & le -> id );
324+ attr = mi_find_attr (ni , mi , NULL , type , name , name_len , & le -> id );
323325 if (!attr )
324326 return NULL ;
325327
@@ -398,7 +400,8 @@ int ni_remove_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
398400 int diff ;
399401
400402 if (base_only || type == ATTR_LIST || !ni -> attr_list .size ) {
401- attr = mi_find_attr (& ni -> mi , NULL , type , name , name_len , id );
403+ attr = mi_find_attr (ni , & ni -> mi , NULL , type , name , name_len ,
404+ id );
402405 if (!attr )
403406 return - ENOENT ;
404407
@@ -437,7 +440,7 @@ int ni_remove_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
437440
438441 al_remove_le (ni , le );
439442
440- attr = mi_find_attr (mi , NULL , type , name , name_len , id );
443+ attr = mi_find_attr (ni , mi , NULL , type , name , name_len , id );
441444 if (!attr )
442445 return - ENOENT ;
443446
@@ -485,7 +488,7 @@ ni_ins_new_attr(struct ntfs_inode *ni, struct mft_inode *mi,
485488 name = le -> name ;
486489 }
487490
488- attr = mi_insert_attr (mi , type , name , name_len , asize , name_off );
491+ attr = mi_insert_attr (ni , mi , type , name , name_len , asize , name_off );
489492 if (!attr ) {
490493 if (le_added )
491494 al_remove_le (ni , le );
@@ -673,7 +676,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni)
673676 if (err )
674677 return err ;
675678
676- attr_list = mi_find_attr (& ni -> mi , NULL , ATTR_LIST , NULL , 0 , NULL );
679+ attr_list = mi_find_attr (ni , & ni -> mi , NULL , ATTR_LIST , NULL , 0 , NULL );
677680 if (!attr_list )
678681 return 0 ;
679682
@@ -695,7 +698,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni)
695698 if (!mi )
696699 return 0 ;
697700
698- attr = mi_find_attr (mi , NULL , le -> type , le_name (le ),
701+ attr = mi_find_attr (ni , mi , NULL , le -> type , le_name (le ),
699702 le -> name_len , & le -> id );
700703 if (!attr )
701704 return 0 ;
@@ -731,7 +734,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni)
731734 goto out ;
732735 }
733736
734- attr = mi_find_attr (mi , NULL , le -> type , le_name (le ),
737+ attr = mi_find_attr (ni , mi , NULL , le -> type , le_name (le ),
735738 le -> name_len , & le -> id );
736739 if (!attr ) {
737740 /* Should never happened, 'cause already checked. */
@@ -740,7 +743,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni)
740743 asize = le32_to_cpu (attr -> size );
741744
742745 /* Insert into primary record. */
743- attr_ins = mi_insert_attr (& ni -> mi , le -> type , le_name (le ),
746+ attr_ins = mi_insert_attr (ni , & ni -> mi , le -> type , le_name (le ),
744747 le -> name_len , asize ,
745748 le16_to_cpu (attr -> name_off ));
746749 if (!attr_ins ) {
@@ -768,7 +771,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni)
768771 if (!mi )
769772 continue ;
770773
771- attr = mi_find_attr (mi , NULL , le -> type , le_name (le ),
774+ attr = mi_find_attr (ni , mi , NULL , le -> type , le_name (le ),
772775 le -> name_len , & le -> id );
773776 if (!attr )
774777 continue ;
@@ -831,7 +834,7 @@ int ni_create_attr_list(struct ntfs_inode *ni)
831834 free_b = 0 ;
832835 attr = NULL ;
833836
834- for (; (attr = mi_enum_attr (& ni -> mi , attr )); le = Add2Ptr (le , sz )) {
837+ for (; (attr = mi_enum_attr (ni , & ni -> mi , attr )); le = Add2Ptr (le , sz )) {
835838 sz = le_size (attr -> name_len );
836839 le -> type = attr -> type ;
837840 le -> size = cpu_to_le16 (sz );
@@ -886,7 +889,7 @@ int ni_create_attr_list(struct ntfs_inode *ni)
886889 u32 asize = le32_to_cpu (b -> size );
887890 u16 name_off = le16_to_cpu (b -> name_off );
888891
889- attr = mi_insert_attr (mi , b -> type , Add2Ptr (b , name_off ),
892+ attr = mi_insert_attr (ni , mi , b -> type , Add2Ptr (b , name_off ),
890893 b -> name_len , asize , name_off );
891894 if (!attr )
892895 goto out ;
@@ -909,7 +912,7 @@ int ni_create_attr_list(struct ntfs_inode *ni)
909912 goto out ;
910913 }
911914
912- attr = mi_insert_attr (& ni -> mi , ATTR_LIST , NULL , 0 ,
915+ attr = mi_insert_attr (ni , & ni -> mi , ATTR_LIST , NULL , 0 ,
913916 lsize + SIZEOF_RESIDENT , SIZEOF_RESIDENT );
914917 if (!attr )
915918 goto out ;
@@ -993,13 +996,13 @@ static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le,
993996 mi = rb_entry (node , struct mft_inode , node );
994997
995998 if (is_mft_data &&
996- (mi_enum_attr (mi , NULL ) ||
999+ (mi_enum_attr (ni , mi , NULL ) ||
9971000 vbo <= ((u64 )mi -> rno << sbi -> record_bits ))) {
9981001 /* We can't accept this record 'cause MFT's bootstrapping. */
9991002 continue ;
10001003 }
10011004 if (is_mft &&
1002- mi_find_attr (mi , NULL , ATTR_DATA , NULL , 0 , NULL )) {
1005+ mi_find_attr (ni , mi , NULL , ATTR_DATA , NULL , 0 , NULL )) {
10031006 /*
10041007 * This child record already has a ATTR_DATA.
10051008 * So it can't accept any other records.
@@ -1008,7 +1011,7 @@ static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le,
10081011 }
10091012
10101013 if ((type != ATTR_NAME || name_len ) &&
1011- mi_find_attr (mi , NULL , type , name , name_len , NULL )) {
1014+ mi_find_attr (ni , mi , NULL , type , name , name_len , NULL )) {
10121015 /* Only indexed attributes can share same record. */
10131016 continue ;
10141017 }
@@ -1157,7 +1160,7 @@ static int ni_insert_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
11571160 /* Estimate the result of moving all possible attributes away. */
11581161 attr = NULL ;
11591162
1160- while ((attr = mi_enum_attr (& ni -> mi , attr ))) {
1163+ while ((attr = mi_enum_attr (ni , & ni -> mi , attr ))) {
11611164 if (attr -> type == ATTR_STD )
11621165 continue ;
11631166 if (attr -> type == ATTR_LIST )
@@ -1175,7 +1178,7 @@ static int ni_insert_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
11751178 attr = NULL ;
11761179
11771180 for (;;) {
1178- attr = mi_enum_attr (& ni -> mi , attr );
1181+ attr = mi_enum_attr (ni , & ni -> mi , attr );
11791182 if (!attr ) {
11801183 /* We should never be here 'cause we have already check this case. */
11811184 err = - EINVAL ;
@@ -1259,7 +1262,7 @@ static int ni_expand_mft_list(struct ntfs_inode *ni)
12591262 for (node = rb_first (& ni -> mi_tree ); node ; node = rb_next (node )) {
12601263 mi = rb_entry (node , struct mft_inode , node );
12611264
1262- attr = mi_enum_attr (mi , NULL );
1265+ attr = mi_enum_attr (ni , mi , NULL );
12631266
12641267 if (!attr ) {
12651268 mft_min = mi -> rno ;
@@ -1280,7 +1283,7 @@ static int ni_expand_mft_list(struct ntfs_inode *ni)
12801283 ni_remove_mi (ni , mi_new );
12811284 }
12821285
1283- attr = mi_find_attr (& ni -> mi , NULL , ATTR_DATA , NULL , 0 , NULL );
1286+ attr = mi_find_attr (ni , & ni -> mi , NULL , ATTR_DATA , NULL , 0 , NULL );
12841287 if (!attr ) {
12851288 err = - EINVAL ;
12861289 goto out ;
@@ -1397,7 +1400,7 @@ int ni_expand_list(struct ntfs_inode *ni)
13971400 continue ;
13981401
13991402 /* Find attribute in primary record. */
1400- attr = rec_find_attr_le (& ni -> mi , le );
1403+ attr = rec_find_attr_le (ni , & ni -> mi , le );
14011404 if (!attr ) {
14021405 err = - EINVAL ;
14031406 goto out ;
@@ -3344,7 +3347,7 @@ int ni_write_inode(struct inode *inode, int sync, const char *hint)
33443347 if (!mi -> dirty )
33453348 continue ;
33463349
3347- is_empty = !mi_enum_attr (mi , NULL );
3350+ is_empty = !mi_enum_attr (ni , mi , NULL );
33483351
33493352 if (is_empty )
33503353 clear_rec_inuse (mi -> mrec );
0 commit comments