@@ -303,6 +303,11 @@ static const struct xfs_item_ops xfs_efd_item_ops = {
303
303
.iop_intent = xfs_efd_item_intent ,
304
304
};
305
305
306
+ static inline struct xfs_extent_free_item * xefi_entry (const struct list_head * e )
307
+ {
308
+ return list_entry (e , struct xfs_extent_free_item , xefi_list );
309
+ }
310
+
306
311
/*
307
312
* Fill the EFD with all extents from the EFI when we need to roll the
308
313
* transaction and continue with a new EFI.
@@ -338,11 +343,8 @@ xfs_extent_free_diff_items(
338
343
const struct list_head * a ,
339
344
const struct list_head * b )
340
345
{
341
- struct xfs_extent_free_item * ra ;
342
- struct xfs_extent_free_item * rb ;
343
-
344
- ra = container_of (a , struct xfs_extent_free_item , xefi_list );
345
- rb = container_of (b , struct xfs_extent_free_item , xefi_list );
346
+ struct xfs_extent_free_item * ra = xefi_entry (a );
347
+ struct xfs_extent_free_item * rb = xefi_entry (b );
346
348
347
349
return ra -> xefi_pag -> pag_agno - rb -> xefi_pag -> pag_agno ;
348
350
}
@@ -444,15 +446,14 @@ xfs_extent_free_finish_item(
444
446
struct xfs_btree_cur * * state )
445
447
{
446
448
struct xfs_owner_info oinfo = { };
447
- struct xfs_extent_free_item * xefi ;
449
+ struct xfs_extent_free_item * xefi = xefi_entry ( item ) ;
448
450
struct xfs_efd_log_item * efdp = EFD_ITEM (done );
449
451
struct xfs_mount * mp = tp -> t_mountp ;
450
452
struct xfs_extent * extp ;
451
453
uint next_extent ;
452
454
xfs_agblock_t agbno ;
453
455
int error = 0 ;
454
456
455
- xefi = container_of (item , struct xfs_extent_free_item , xefi_list );
456
457
agbno = XFS_FSB_TO_AGBNO (mp , xefi -> xefi_startblock );
457
458
458
459
oinfo .oi_owner = xefi -> xefi_owner ;
@@ -504,9 +505,7 @@ STATIC void
504
505
xfs_extent_free_cancel_item (
505
506
struct list_head * item )
506
507
{
507
- struct xfs_extent_free_item * xefi ;
508
-
509
- xefi = container_of (item , struct xfs_extent_free_item , xefi_list );
508
+ struct xfs_extent_free_item * xefi = xefi_entry (item );
510
509
511
510
xfs_extent_free_put_group (xefi );
512
511
kmem_cache_free (xfs_extfree_item_cache , xefi );
@@ -526,14 +525,13 @@ xfs_agfl_free_finish_item(
526
525
struct xfs_owner_info oinfo = { };
527
526
struct xfs_mount * mp = tp -> t_mountp ;
528
527
struct xfs_efd_log_item * efdp = EFD_ITEM (done );
529
- struct xfs_extent_free_item * xefi ;
528
+ struct xfs_extent_free_item * xefi = xefi_entry ( item ) ;
530
529
struct xfs_extent * extp ;
531
530
struct xfs_buf * agbp ;
532
531
int error ;
533
532
xfs_agblock_t agbno ;
534
533
uint next_extent ;
535
534
536
- xefi = container_of (item , struct xfs_extent_free_item , xefi_list );
537
535
ASSERT (xefi -> xefi_blockcount == 1 );
538
536
agbno = XFS_FSB_TO_AGBNO (mp , xefi -> xefi_startblock );
539
537
oinfo .oi_owner = xefi -> xefi_owner ;
0 commit comments