1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-24 01:09:38 -05:00

xfs: fix confusing xfs_extent_item variable names

Change the name of all pointers to xfs_extent_item structures to "xefi"
to make the name consistent and because the current selections ("new"
and "free") mean other things in C.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
Darrick J. Wong 2023-02-01 10:16:02 -08:00
parent 72ba455599
commit 578c714b21
2 changed files with 51 additions and 51 deletions

View file

@ -2472,20 +2472,20 @@ xfs_defer_agfl_block(
struct xfs_owner_info *oinfo) struct xfs_owner_info *oinfo)
{ {
struct xfs_mount *mp = tp->t_mountp; struct xfs_mount *mp = tp->t_mountp;
struct xfs_extent_free_item *new; /* new element */ struct xfs_extent_free_item *xefi;
ASSERT(xfs_extfree_item_cache != NULL); ASSERT(xfs_extfree_item_cache != NULL);
ASSERT(oinfo != NULL); ASSERT(oinfo != NULL);
new = kmem_cache_zalloc(xfs_extfree_item_cache, xefi = kmem_cache_zalloc(xfs_extfree_item_cache,
GFP_KERNEL | __GFP_NOFAIL); GFP_KERNEL | __GFP_NOFAIL);
new->xefi_startblock = XFS_AGB_TO_FSB(mp, agno, agbno); xefi->xefi_startblock = XFS_AGB_TO_FSB(mp, agno, agbno);
new->xefi_blockcount = 1; xefi->xefi_blockcount = 1;
new->xefi_owner = oinfo->oi_owner; xefi->xefi_owner = oinfo->oi_owner;
trace_xfs_agfl_free_defer(mp, agno, 0, agbno, 1); trace_xfs_agfl_free_defer(mp, agno, 0, agbno, 1);
xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_AGFL_FREE, &new->xefi_list); xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_AGFL_FREE, &xefi->xefi_list);
} }
/* /*
@ -2500,7 +2500,7 @@ __xfs_free_extent_later(
const struct xfs_owner_info *oinfo, const struct xfs_owner_info *oinfo,
bool skip_discard) bool skip_discard)
{ {
struct xfs_extent_free_item *new; /* new element */ struct xfs_extent_free_item *xefi;
#ifdef DEBUG #ifdef DEBUG
struct xfs_mount *mp = tp->t_mountp; struct xfs_mount *mp = tp->t_mountp;
xfs_agnumber_t agno; xfs_agnumber_t agno;
@ -2519,27 +2519,27 @@ __xfs_free_extent_later(
#endif #endif
ASSERT(xfs_extfree_item_cache != NULL); ASSERT(xfs_extfree_item_cache != NULL);
new = kmem_cache_zalloc(xfs_extfree_item_cache, xefi = kmem_cache_zalloc(xfs_extfree_item_cache,
GFP_KERNEL | __GFP_NOFAIL); GFP_KERNEL | __GFP_NOFAIL);
new->xefi_startblock = bno; xefi->xefi_startblock = bno;
new->xefi_blockcount = (xfs_extlen_t)len; xefi->xefi_blockcount = (xfs_extlen_t)len;
if (skip_discard) if (skip_discard)
new->xefi_flags |= XFS_EFI_SKIP_DISCARD; xefi->xefi_flags |= XFS_EFI_SKIP_DISCARD;
if (oinfo) { if (oinfo) {
ASSERT(oinfo->oi_offset == 0); ASSERT(oinfo->oi_offset == 0);
if (oinfo->oi_flags & XFS_OWNER_INFO_ATTR_FORK) if (oinfo->oi_flags & XFS_OWNER_INFO_ATTR_FORK)
new->xefi_flags |= XFS_EFI_ATTR_FORK; xefi->xefi_flags |= XFS_EFI_ATTR_FORK;
if (oinfo->oi_flags & XFS_OWNER_INFO_BMBT_BLOCK) if (oinfo->oi_flags & XFS_OWNER_INFO_BMBT_BLOCK)
new->xefi_flags |= XFS_EFI_BMBT_BLOCK; xefi->xefi_flags |= XFS_EFI_BMBT_BLOCK;
new->xefi_owner = oinfo->oi_owner; xefi->xefi_owner = oinfo->oi_owner;
} else { } else {
new->xefi_owner = XFS_RMAP_OWN_NULL; xefi->xefi_owner = XFS_RMAP_OWN_NULL;
} }
trace_xfs_bmap_free_defer(tp->t_mountp, trace_xfs_bmap_free_defer(tp->t_mountp,
XFS_FSB_TO_AGNO(tp->t_mountp, bno), 0, XFS_FSB_TO_AGNO(tp->t_mountp, bno), 0,
XFS_FSB_TO_AGBNO(tp->t_mountp, bno), len); XFS_FSB_TO_AGBNO(tp->t_mountp, bno), len);
xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_FREE, &new->xefi_list); xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_FREE, &xefi->xefi_list);
} }
#ifdef DEBUG #ifdef DEBUG

View file

@ -345,30 +345,30 @@ static int
xfs_trans_free_extent( xfs_trans_free_extent(
struct xfs_trans *tp, struct xfs_trans *tp,
struct xfs_efd_log_item *efdp, struct xfs_efd_log_item *efdp,
struct xfs_extent_free_item *free) struct xfs_extent_free_item *xefi)
{ {
struct xfs_owner_info oinfo = { }; struct xfs_owner_info oinfo = { };
struct xfs_mount *mp = tp->t_mountp; struct xfs_mount *mp = tp->t_mountp;
struct xfs_extent *extp; struct xfs_extent *extp;
uint next_extent; uint next_extent;
xfs_agnumber_t agno = XFS_FSB_TO_AGNO(mp, xfs_agnumber_t agno = XFS_FSB_TO_AGNO(mp,
free->xefi_startblock); xefi->xefi_startblock);
xfs_agblock_t agbno = XFS_FSB_TO_AGBNO(mp, xfs_agblock_t agbno = XFS_FSB_TO_AGBNO(mp,
free->xefi_startblock); xefi->xefi_startblock);
int error; int error;
oinfo.oi_owner = free->xefi_owner; oinfo.oi_owner = xefi->xefi_owner;
if (free->xefi_flags & XFS_EFI_ATTR_FORK) if (xefi->xefi_flags & XFS_EFI_ATTR_FORK)
oinfo.oi_flags |= XFS_OWNER_INFO_ATTR_FORK; oinfo.oi_flags |= XFS_OWNER_INFO_ATTR_FORK;
if (free->xefi_flags & XFS_EFI_BMBT_BLOCK) if (xefi->xefi_flags & XFS_EFI_BMBT_BLOCK)
oinfo.oi_flags |= XFS_OWNER_INFO_BMBT_BLOCK; oinfo.oi_flags |= XFS_OWNER_INFO_BMBT_BLOCK;
trace_xfs_bmap_free_deferred(tp->t_mountp, agno, 0, agbno, trace_xfs_bmap_free_deferred(tp->t_mountp, agno, 0, agbno,
free->xefi_blockcount); xefi->xefi_blockcount);
error = __xfs_free_extent(tp, free->xefi_startblock, error = __xfs_free_extent(tp, xefi->xefi_startblock,
free->xefi_blockcount, &oinfo, XFS_AG_RESV_NONE, xefi->xefi_blockcount, &oinfo, XFS_AG_RESV_NONE,
free->xefi_flags & XFS_EFI_SKIP_DISCARD); xefi->xefi_flags & XFS_EFI_SKIP_DISCARD);
/* /*
* Mark the transaction dirty, even on error. This ensures the * Mark the transaction dirty, even on error. This ensures the
* transaction is aborted, which: * transaction is aborted, which:
@ -382,8 +382,8 @@ xfs_trans_free_extent(
next_extent = efdp->efd_next_extent; next_extent = efdp->efd_next_extent;
ASSERT(next_extent < efdp->efd_format.efd_nextents); ASSERT(next_extent < efdp->efd_format.efd_nextents);
extp = &(efdp->efd_format.efd_extents[next_extent]); extp = &(efdp->efd_format.efd_extents[next_extent]);
extp->ext_start = free->xefi_startblock; extp->ext_start = xefi->xefi_startblock;
extp->ext_len = free->xefi_blockcount; extp->ext_len = xefi->xefi_blockcount;
efdp->efd_next_extent++; efdp->efd_next_extent++;
return error; return error;
@ -411,7 +411,7 @@ STATIC void
xfs_extent_free_log_item( xfs_extent_free_log_item(
struct xfs_trans *tp, struct xfs_trans *tp,
struct xfs_efi_log_item *efip, struct xfs_efi_log_item *efip,
struct xfs_extent_free_item *free) struct xfs_extent_free_item *xefi)
{ {
uint next_extent; uint next_extent;
struct xfs_extent *extp; struct xfs_extent *extp;
@ -427,8 +427,8 @@ xfs_extent_free_log_item(
next_extent = atomic_inc_return(&efip->efi_next_extent) - 1; next_extent = atomic_inc_return(&efip->efi_next_extent) - 1;
ASSERT(next_extent < efip->efi_format.efi_nextents); ASSERT(next_extent < efip->efi_format.efi_nextents);
extp = &efip->efi_format.efi_extents[next_extent]; extp = &efip->efi_format.efi_extents[next_extent];
extp->ext_start = free->xefi_startblock; extp->ext_start = xefi->xefi_startblock;
extp->ext_len = free->xefi_blockcount; extp->ext_len = xefi->xefi_blockcount;
} }
static struct xfs_log_item * static struct xfs_log_item *
@ -440,15 +440,15 @@ xfs_extent_free_create_intent(
{ {
struct xfs_mount *mp = tp->t_mountp; struct xfs_mount *mp = tp->t_mountp;
struct xfs_efi_log_item *efip = xfs_efi_init(mp, count); struct xfs_efi_log_item *efip = xfs_efi_init(mp, count);
struct xfs_extent_free_item *free; struct xfs_extent_free_item *xefi;
ASSERT(count > 0); ASSERT(count > 0);
xfs_trans_add_item(tp, &efip->efi_item); xfs_trans_add_item(tp, &efip->efi_item);
if (sort) if (sort)
list_sort(mp, items, xfs_extent_free_diff_items); list_sort(mp, items, xfs_extent_free_diff_items);
list_for_each_entry(free, items, xefi_list) list_for_each_entry(xefi, items, xefi_list)
xfs_extent_free_log_item(tp, efip, free); xfs_extent_free_log_item(tp, efip, xefi);
return &efip->efi_item; return &efip->efi_item;
} }
@ -470,13 +470,13 @@ xfs_extent_free_finish_item(
struct list_head *item, struct list_head *item,
struct xfs_btree_cur **state) struct xfs_btree_cur **state)
{ {
struct xfs_extent_free_item *free; struct xfs_extent_free_item *xefi;
int error; int error;
free = container_of(item, struct xfs_extent_free_item, xefi_list); xefi = container_of(item, struct xfs_extent_free_item, xefi_list);
error = xfs_trans_free_extent(tp, EFD_ITEM(done), free); error = xfs_trans_free_extent(tp, EFD_ITEM(done), xefi);
kmem_cache_free(xfs_extfree_item_cache, free); kmem_cache_free(xfs_extfree_item_cache, xefi);
return error; return error;
} }
@ -493,10 +493,10 @@ STATIC void
xfs_extent_free_cancel_item( xfs_extent_free_cancel_item(
struct list_head *item) struct list_head *item)
{ {
struct xfs_extent_free_item *free; struct xfs_extent_free_item *xefi;
free = container_of(item, struct xfs_extent_free_item, xefi_list); xefi = container_of(item, struct xfs_extent_free_item, xefi_list);
kmem_cache_free(xfs_extfree_item_cache, free); kmem_cache_free(xfs_extfree_item_cache, xefi);
} }
const struct xfs_defer_op_type xfs_extent_free_defer_type = { const struct xfs_defer_op_type xfs_extent_free_defer_type = {
@ -522,7 +522,7 @@ xfs_agfl_free_finish_item(
struct xfs_owner_info oinfo = { }; struct xfs_owner_info oinfo = { };
struct xfs_mount *mp = tp->t_mountp; struct xfs_mount *mp = tp->t_mountp;
struct xfs_efd_log_item *efdp = EFD_ITEM(done); struct xfs_efd_log_item *efdp = EFD_ITEM(done);
struct xfs_extent_free_item *free; struct xfs_extent_free_item *xefi;
struct xfs_extent *extp; struct xfs_extent *extp;
struct xfs_buf *agbp; struct xfs_buf *agbp;
int error; int error;
@ -531,13 +531,13 @@ xfs_agfl_free_finish_item(
uint next_extent; uint next_extent;
struct xfs_perag *pag; struct xfs_perag *pag;
free = container_of(item, struct xfs_extent_free_item, xefi_list); xefi = container_of(item, struct xfs_extent_free_item, xefi_list);
ASSERT(free->xefi_blockcount == 1); ASSERT(xefi->xefi_blockcount == 1);
agno = XFS_FSB_TO_AGNO(mp, free->xefi_startblock); agno = XFS_FSB_TO_AGNO(mp, xefi->xefi_startblock);
agbno = XFS_FSB_TO_AGBNO(mp, free->xefi_startblock); agbno = XFS_FSB_TO_AGBNO(mp, xefi->xefi_startblock);
oinfo.oi_owner = free->xefi_owner; oinfo.oi_owner = xefi->xefi_owner;
trace_xfs_agfl_free_deferred(mp, agno, 0, agbno, free->xefi_blockcount); trace_xfs_agfl_free_deferred(mp, agno, 0, agbno, xefi->xefi_blockcount);
pag = xfs_perag_get(mp, agno); pag = xfs_perag_get(mp, agno);
error = xfs_alloc_read_agf(pag, tp, 0, &agbp); error = xfs_alloc_read_agf(pag, tp, 0, &agbp);
@ -558,11 +558,11 @@ xfs_agfl_free_finish_item(
next_extent = efdp->efd_next_extent; next_extent = efdp->efd_next_extent;
ASSERT(next_extent < efdp->efd_format.efd_nextents); ASSERT(next_extent < efdp->efd_format.efd_nextents);
extp = &(efdp->efd_format.efd_extents[next_extent]); extp = &(efdp->efd_format.efd_extents[next_extent]);
extp->ext_start = free->xefi_startblock; extp->ext_start = xefi->xefi_startblock;
extp->ext_len = free->xefi_blockcount; extp->ext_len = xefi->xefi_blockcount;
efdp->efd_next_extent++; efdp->efd_next_extent++;
kmem_cache_free(xfs_extfree_item_cache, free); kmem_cache_free(xfs_extfree_item_cache, xefi);
return error; return error;
} }