@@ -230,7 +230,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
230
230
*/
231
231
bp = NULL ;
232
232
if (cursor -> blkno > 0 ) {
233
- error = xfs_da3_node_read (NULL , dp , cursor -> blkno , -1 ,
233
+ error = xfs_da3_node_read (context -> tp , dp , cursor -> blkno , -1 ,
234
234
& bp , XFS_ATTR_FORK );
235
235
if ((error != 0 ) && (error != - EFSCORRUPTED ))
236
236
return error ;
@@ -242,7 +242,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
242
242
case XFS_DA_NODE_MAGIC :
243
243
case XFS_DA3_NODE_MAGIC :
244
244
trace_xfs_attr_list_wrong_blk (context );
245
- xfs_trans_brelse (NULL , bp );
245
+ xfs_trans_brelse (context -> tp , bp );
246
246
bp = NULL ;
247
247
break ;
248
248
case XFS_ATTR_LEAF_MAGIC :
@@ -254,18 +254,18 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
254
254
if (cursor -> hashval > be32_to_cpu (
255
255
entries [leafhdr .count - 1 ].hashval )) {
256
256
trace_xfs_attr_list_wrong_blk (context );
257
- xfs_trans_brelse (NULL , bp );
257
+ xfs_trans_brelse (context -> tp , bp );
258
258
bp = NULL ;
259
259
} else if (cursor -> hashval <= be32_to_cpu (
260
260
entries [0 ].hashval )) {
261
261
trace_xfs_attr_list_wrong_blk (context );
262
- xfs_trans_brelse (NULL , bp );
262
+ xfs_trans_brelse (context -> tp , bp );
263
263
bp = NULL ;
264
264
}
265
265
break ;
266
266
default :
267
267
trace_xfs_attr_list_wrong_blk (context );
268
- xfs_trans_brelse (NULL , bp );
268
+ xfs_trans_brelse (context -> tp , bp );
269
269
bp = NULL ;
270
270
}
271
271
}
@@ -281,7 +281,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
281
281
for (;;) {
282
282
uint16_t magic ;
283
283
284
- error = xfs_da3_node_read (NULL , dp ,
284
+ error = xfs_da3_node_read (context -> tp , dp ,
285
285
cursor -> blkno , -1 , & bp ,
286
286
XFS_ATTR_FORK );
287
287
if (error )
@@ -297,7 +297,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
297
297
XFS_ERRLEVEL_LOW ,
298
298
context -> dp -> i_mount ,
299
299
node );
300
- xfs_trans_brelse (NULL , bp );
300
+ xfs_trans_brelse (context -> tp , bp );
301
301
return - EFSCORRUPTED ;
302
302
}
303
303
@@ -313,10 +313,10 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
313
313
}
314
314
}
315
315
if (i == nodehdr .count ) {
316
- xfs_trans_brelse (NULL , bp );
316
+ xfs_trans_brelse (context -> tp , bp );
317
317
return 0 ;
318
318
}
319
- xfs_trans_brelse (NULL , bp );
319
+ xfs_trans_brelse (context -> tp , bp );
320
320
}
321
321
}
322
322
ASSERT (bp != NULL );
@@ -333,12 +333,12 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
333
333
if (context -> seen_enough || leafhdr .forw == 0 )
334
334
break ;
335
335
cursor -> blkno = leafhdr .forw ;
336
- xfs_trans_brelse (NULL , bp );
337
- error = xfs_attr3_leaf_read (NULL , dp , cursor -> blkno , -1 , & bp );
336
+ xfs_trans_brelse (context -> tp , bp );
337
+ error = xfs_attr3_leaf_read (context -> tp , dp , cursor -> blkno , -1 , & bp );
338
338
if (error )
339
339
return error ;
340
340
}
341
- xfs_trans_brelse (NULL , bp );
341
+ xfs_trans_brelse (context -> tp , bp );
342
342
return 0 ;
343
343
}
344
344
@@ -448,15 +448,33 @@ xfs_attr_leaf_list(xfs_attr_list_context_t *context)
448
448
trace_xfs_attr_leaf_list (context );
449
449
450
450
context -> cursor -> blkno = 0 ;
451
- error = xfs_attr3_leaf_read (NULL , context -> dp , 0 , -1 , & bp );
451
+ error = xfs_attr3_leaf_read (context -> tp , context -> dp , 0 , -1 , & bp );
452
452
if (error )
453
453
return error ;
454
454
455
455
xfs_attr3_leaf_list_int (bp , context );
456
- xfs_trans_brelse (NULL , bp );
456
+ xfs_trans_brelse (context -> tp , bp );
457
457
return 0 ;
458
458
}
459
459
460
+ int
461
+ xfs_attr_list_int_ilocked (
462
+ struct xfs_attr_list_context * context )
463
+ {
464
+ struct xfs_inode * dp = context -> dp ;
465
+
466
+ /*
467
+ * Decide on what work routines to call based on the inode size.
468
+ */
469
+ if (!xfs_inode_hasattr (dp ))
470
+ return 0 ;
471
+ else if (dp -> i_d .di_aformat == XFS_DINODE_FMT_LOCAL )
472
+ return xfs_attr_shortform_list (context );
473
+ else if (xfs_bmap_one_block (dp , XFS_ATTR_FORK ))
474
+ return xfs_attr_leaf_list (context );
475
+ return xfs_attr_node_list (context );
476
+ }
477
+
460
478
int
461
479
xfs_attr_list_int (
462
480
xfs_attr_list_context_t * context )
@@ -470,19 +488,8 @@ xfs_attr_list_int(
470
488
if (XFS_FORCED_SHUTDOWN (dp -> i_mount ))
471
489
return - EIO ;
472
490
473
- /*
474
- * Decide on what work routines to call based on the inode size.
475
- */
476
491
lock_mode = xfs_ilock_attr_map_shared (dp );
477
- if (!xfs_inode_hasattr (dp )) {
478
- error = 0 ;
479
- } else if (dp -> i_d .di_aformat == XFS_DINODE_FMT_LOCAL ) {
480
- error = xfs_attr_shortform_list (context );
481
- } else if (xfs_bmap_one_block (dp , XFS_ATTR_FORK )) {
482
- error = xfs_attr_leaf_list (context );
483
- } else {
484
- error = xfs_attr_node_list (context );
485
- }
492
+ error = xfs_attr_list_int_ilocked (context );
486
493
xfs_iunlock (dp , lock_mode );
487
494
return error ;
488
495
}
0 commit comments