@@ -75,7 +75,7 @@ struct ATTR_STD_INFO *ni_std(struct ntfs_inode *ni)
75
75
{
76
76
const struct ATTRIB * attr ;
77
77
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 );
79
79
return attr ? resident_data_ex (attr , sizeof (struct ATTR_STD_INFO )) :
80
80
NULL ;
81
81
}
@@ -89,7 +89,7 @@ struct ATTR_STD_INFO5 *ni_std5(struct ntfs_inode *ni)
89
89
{
90
90
const struct ATTRIB * attr ;
91
91
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 );
93
93
94
94
return attr ? resident_data_ex (attr , sizeof (struct ATTR_STD_INFO5 )) :
95
95
NULL ;
@@ -201,7 +201,8 @@ struct ATTRIB *ni_find_attr(struct ntfs_inode *ni, struct ATTRIB *attr,
201
201
* mi = & ni -> mi ;
202
202
203
203
/* 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 );
205
206
}
206
207
207
208
/* First look for list entry of required type. */
@@ -217,7 +218,7 @@ struct ATTRIB *ni_find_attr(struct ntfs_inode *ni, struct ATTRIB *attr,
217
218
return NULL ;
218
219
219
220
/* 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 );
221
222
222
223
if (!attr )
223
224
goto out ;
@@ -259,7 +260,7 @@ struct ATTRIB *ni_enum_attr_ex(struct ntfs_inode *ni, struct ATTRIB *attr,
259
260
if (mi )
260
261
* mi = & ni -> mi ;
261
262
/* Enum attributes in primary record. */
262
- return mi_enum_attr (& ni -> mi , attr );
263
+ return mi_enum_attr (ni , & ni -> mi , attr );
263
264
}
264
265
265
266
/* Get next list entry. */
@@ -275,7 +276,7 @@ struct ATTRIB *ni_enum_attr_ex(struct ntfs_inode *ni, struct ATTRIB *attr,
275
276
* mi = mi2 ;
276
277
277
278
/* Find attribute in loaded record. */
278
- return rec_find_attr_le (mi2 , le2 );
279
+ return rec_find_attr_le (ni , mi2 , le2 );
279
280
}
280
281
281
282
/*
@@ -293,7 +294,8 @@ struct ATTRIB *ni_load_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
293
294
if (!ni -> attr_list .size ) {
294
295
if (pmi )
295
296
* 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 );
297
299
}
298
300
299
301
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,
319
321
if (pmi )
320
322
* pmi = mi ;
321
323
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 );
323
325
if (!attr )
324
326
return NULL ;
325
327
@@ -398,7 +400,8 @@ int ni_remove_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
398
400
int diff ;
399
401
400
402
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 );
402
405
if (!attr )
403
406
return - ENOENT ;
404
407
@@ -437,7 +440,7 @@ int ni_remove_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
437
440
438
441
al_remove_le (ni , le );
439
442
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 );
441
444
if (!attr )
442
445
return - ENOENT ;
443
446
@@ -485,7 +488,7 @@ ni_ins_new_attr(struct ntfs_inode *ni, struct mft_inode *mi,
485
488
name = le -> name ;
486
489
}
487
490
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 );
489
492
if (!attr ) {
490
493
if (le_added )
491
494
al_remove_le (ni , le );
@@ -673,7 +676,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni)
673
676
if (err )
674
677
return err ;
675
678
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 );
677
680
if (!attr_list )
678
681
return 0 ;
679
682
@@ -695,7 +698,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni)
695
698
if (!mi )
696
699
return 0 ;
697
700
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 ),
699
702
le -> name_len , & le -> id );
700
703
if (!attr )
701
704
return 0 ;
@@ -731,7 +734,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni)
731
734
goto out ;
732
735
}
733
736
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 ),
735
738
le -> name_len , & le -> id );
736
739
if (!attr ) {
737
740
/* Should never happened, 'cause already checked. */
@@ -740,7 +743,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni)
740
743
asize = le32_to_cpu (attr -> size );
741
744
742
745
/* 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 ),
744
747
le -> name_len , asize ,
745
748
le16_to_cpu (attr -> name_off ));
746
749
if (!attr_ins ) {
@@ -768,7 +771,7 @@ static int ni_try_remove_attr_list(struct ntfs_inode *ni)
768
771
if (!mi )
769
772
continue ;
770
773
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 ),
772
775
le -> name_len , & le -> id );
773
776
if (!attr )
774
777
continue ;
@@ -831,7 +834,7 @@ int ni_create_attr_list(struct ntfs_inode *ni)
831
834
free_b = 0 ;
832
835
attr = NULL ;
833
836
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 )) {
835
838
sz = le_size (attr -> name_len );
836
839
le -> type = attr -> type ;
837
840
le -> size = cpu_to_le16 (sz );
@@ -886,7 +889,7 @@ int ni_create_attr_list(struct ntfs_inode *ni)
886
889
u32 asize = le32_to_cpu (b -> size );
887
890
u16 name_off = le16_to_cpu (b -> name_off );
888
891
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 ),
890
893
b -> name_len , asize , name_off );
891
894
if (!attr )
892
895
goto out ;
@@ -909,7 +912,7 @@ int ni_create_attr_list(struct ntfs_inode *ni)
909
912
goto out ;
910
913
}
911
914
912
- attr = mi_insert_attr (& ni -> mi , ATTR_LIST , NULL , 0 ,
915
+ attr = mi_insert_attr (ni , & ni -> mi , ATTR_LIST , NULL , 0 ,
913
916
lsize + SIZEOF_RESIDENT , SIZEOF_RESIDENT );
914
917
if (!attr )
915
918
goto out ;
@@ -993,13 +996,13 @@ static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le,
993
996
mi = rb_entry (node , struct mft_inode , node );
994
997
995
998
if (is_mft_data &&
996
- (mi_enum_attr (mi , NULL ) ||
999
+ (mi_enum_attr (ni , mi , NULL ) ||
997
1000
vbo <= ((u64 )mi -> rno << sbi -> record_bits ))) {
998
1001
/* We can't accept this record 'cause MFT's bootstrapping. */
999
1002
continue ;
1000
1003
}
1001
1004
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 )) {
1003
1006
/*
1004
1007
* This child record already has a ATTR_DATA.
1005
1008
* 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,
1008
1011
}
1009
1012
1010
1013
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 )) {
1012
1015
/* Only indexed attributes can share same record. */
1013
1016
continue ;
1014
1017
}
@@ -1157,7 +1160,7 @@ static int ni_insert_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
1157
1160
/* Estimate the result of moving all possible attributes away. */
1158
1161
attr = NULL ;
1159
1162
1160
- while ((attr = mi_enum_attr (& ni -> mi , attr ))) {
1163
+ while ((attr = mi_enum_attr (ni , & ni -> mi , attr ))) {
1161
1164
if (attr -> type == ATTR_STD )
1162
1165
continue ;
1163
1166
if (attr -> type == ATTR_LIST )
@@ -1175,7 +1178,7 @@ static int ni_insert_attr(struct ntfs_inode *ni, enum ATTR_TYPE type,
1175
1178
attr = NULL ;
1176
1179
1177
1180
for (;;) {
1178
- attr = mi_enum_attr (& ni -> mi , attr );
1181
+ attr = mi_enum_attr (ni , & ni -> mi , attr );
1179
1182
if (!attr ) {
1180
1183
/* We should never be here 'cause we have already check this case. */
1181
1184
err = - EINVAL ;
@@ -1259,7 +1262,7 @@ static int ni_expand_mft_list(struct ntfs_inode *ni)
1259
1262
for (node = rb_first (& ni -> mi_tree ); node ; node = rb_next (node )) {
1260
1263
mi = rb_entry (node , struct mft_inode , node );
1261
1264
1262
- attr = mi_enum_attr (mi , NULL );
1265
+ attr = mi_enum_attr (ni , mi , NULL );
1263
1266
1264
1267
if (!attr ) {
1265
1268
mft_min = mi -> rno ;
@@ -1280,7 +1283,7 @@ static int ni_expand_mft_list(struct ntfs_inode *ni)
1280
1283
ni_remove_mi (ni , mi_new );
1281
1284
}
1282
1285
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 );
1284
1287
if (!attr ) {
1285
1288
err = - EINVAL ;
1286
1289
goto out ;
@@ -1397,7 +1400,7 @@ int ni_expand_list(struct ntfs_inode *ni)
1397
1400
continue ;
1398
1401
1399
1402
/* Find attribute in primary record. */
1400
- attr = rec_find_attr_le (& ni -> mi , le );
1403
+ attr = rec_find_attr_le (ni , & ni -> mi , le );
1401
1404
if (!attr ) {
1402
1405
err = - EINVAL ;
1403
1406
goto out ;
@@ -3343,7 +3346,7 @@ int ni_write_inode(struct inode *inode, int sync, const char *hint)
3343
3346
if (!mi -> dirty )
3344
3347
continue ;
3345
3348
3346
- is_empty = !mi_enum_attr (mi , NULL );
3349
+ is_empty = !mi_enum_attr (ni , mi , NULL );
3347
3350
3348
3351
if (is_empty )
3349
3352
clear_rec_inuse (mi -> mrec );
0 commit comments