Skip to content

Commit 01a3af2

Browse files
author
Darrick J. Wong
committed
xfs: fix confusing variable names in xfs_refcount_item.c
Variable names in this code module are inconsistent and confusing. xfs_phys_extent describe physical mappings, so rename them "pmap". xfs_refcount_intents describe refcount intents, so rename them "ri". Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 0b11553 commit 01a3af2

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

fs/xfs/xfs_refcount_item.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,16 @@ xfs_refcount_update_diff_items(
292292
/* Set the phys extent flags for this reverse mapping. */
293293
static void
294294
xfs_trans_set_refcount_flags(
295-
struct xfs_phys_extent *refc,
295+
struct xfs_phys_extent *pmap,
296296
enum xfs_refcount_intent_type type)
297297
{
298-
refc->pe_flags = 0;
298+
pmap->pe_flags = 0;
299299
switch (type) {
300300
case XFS_REFCOUNT_INCREASE:
301301
case XFS_REFCOUNT_DECREASE:
302302
case XFS_REFCOUNT_ALLOC_COW:
303303
case XFS_REFCOUNT_FREE_COW:
304-
refc->pe_flags |= type;
304+
pmap->pe_flags |= type;
305305
break;
306306
default:
307307
ASSERT(0);
@@ -313,10 +313,10 @@ STATIC void
313313
xfs_refcount_update_log_item(
314314
struct xfs_trans *tp,
315315
struct xfs_cui_log_item *cuip,
316-
struct xfs_refcount_intent *refc)
316+
struct xfs_refcount_intent *ri)
317317
{
318318
uint next_extent;
319-
struct xfs_phys_extent *ext;
319+
struct xfs_phys_extent *pmap;
320320

321321
tp->t_flags |= XFS_TRANS_DIRTY;
322322
set_bit(XFS_LI_DIRTY, &cuip->cui_item.li_flags);
@@ -328,10 +328,10 @@ xfs_refcount_update_log_item(
328328
*/
329329
next_extent = atomic_inc_return(&cuip->cui_next_extent) - 1;
330330
ASSERT(next_extent < cuip->cui_format.cui_nextents);
331-
ext = &cuip->cui_format.cui_extents[next_extent];
332-
ext->pe_startblock = refc->ri_startblock;
333-
ext->pe_len = refc->ri_blockcount;
334-
xfs_trans_set_refcount_flags(ext, refc->ri_type);
331+
pmap = &cuip->cui_format.cui_extents[next_extent];
332+
pmap->pe_startblock = ri->ri_startblock;
333+
pmap->pe_len = ri->ri_blockcount;
334+
xfs_trans_set_refcount_flags(pmap, ri->ri_type);
335335
}
336336

337337
static struct xfs_log_item *
@@ -343,15 +343,15 @@ xfs_refcount_update_create_intent(
343343
{
344344
struct xfs_mount *mp = tp->t_mountp;
345345
struct xfs_cui_log_item *cuip = xfs_cui_init(mp, count);
346-
struct xfs_refcount_intent *refc;
346+
struct xfs_refcount_intent *ri;
347347

348348
ASSERT(count > 0);
349349

350350
xfs_trans_add_item(tp, &cuip->cui_item);
351351
if (sort)
352352
list_sort(mp, items, xfs_refcount_update_diff_items);
353-
list_for_each_entry(refc, items, ri_list)
354-
xfs_refcount_update_log_item(tp, cuip, refc);
353+
list_for_each_entry(ri, items, ri_list)
354+
xfs_refcount_update_log_item(tp, cuip, ri);
355355
return &cuip->cui_item;
356356
}
357357

@@ -403,10 +403,10 @@ STATIC void
403403
xfs_refcount_update_cancel_item(
404404
struct list_head *item)
405405
{
406-
struct xfs_refcount_intent *refc;
406+
struct xfs_refcount_intent *ri;
407407

408-
refc = container_of(item, struct xfs_refcount_intent, ri_list);
409-
kmem_cache_free(xfs_refcount_intent_cache, refc);
408+
ri = container_of(item, struct xfs_refcount_intent, ri_list);
409+
kmem_cache_free(xfs_refcount_intent_cache, ri);
410410
}
411411

412412
const struct xfs_defer_op_type xfs_refcount_update_defer_type = {
@@ -423,15 +423,15 @@ const struct xfs_defer_op_type xfs_refcount_update_defer_type = {
423423
static inline bool
424424
xfs_cui_validate_phys(
425425
struct xfs_mount *mp,
426-
struct xfs_phys_extent *refc)
426+
struct xfs_phys_extent *pmap)
427427
{
428428
if (!xfs_has_reflink(mp))
429429
return false;
430430

431-
if (refc->pe_flags & ~XFS_REFCOUNT_EXTENT_FLAGS)
431+
if (pmap->pe_flags & ~XFS_REFCOUNT_EXTENT_FLAGS)
432432
return false;
433433

434-
switch (refc->pe_flags & XFS_REFCOUNT_EXTENT_TYPE_MASK) {
434+
switch (pmap->pe_flags & XFS_REFCOUNT_EXTENT_TYPE_MASK) {
435435
case XFS_REFCOUNT_INCREASE:
436436
case XFS_REFCOUNT_DECREASE:
437437
case XFS_REFCOUNT_ALLOC_COW:
@@ -441,7 +441,7 @@ xfs_cui_validate_phys(
441441
return false;
442442
}
443443

444-
return xfs_verify_fsbext(mp, refc->pe_startblock, refc->pe_len);
444+
return xfs_verify_fsbext(mp, pmap->pe_startblock, pmap->pe_len);
445445
}
446446

447447
/*
@@ -499,10 +499,10 @@ xfs_cui_item_recover(
499499

500500
for (i = 0; i < cuip->cui_format.cui_nextents; i++) {
501501
struct xfs_refcount_intent fake = { };
502-
struct xfs_phys_extent *refc;
502+
struct xfs_phys_extent *pmap;
503503

504-
refc = &cuip->cui_format.cui_extents[i];
505-
refc_type = refc->pe_flags & XFS_REFCOUNT_EXTENT_TYPE_MASK;
504+
pmap = &cuip->cui_format.cui_extents[i];
505+
refc_type = pmap->pe_flags & XFS_REFCOUNT_EXTENT_TYPE_MASK;
506506
switch (refc_type) {
507507
case XFS_REFCOUNT_INCREASE:
508508
case XFS_REFCOUNT_DECREASE:
@@ -518,8 +518,8 @@ xfs_cui_item_recover(
518518
goto abort_error;
519519
}
520520

521-
fake.ri_startblock = refc->pe_startblock;
522-
fake.ri_blockcount = refc->pe_len;
521+
fake.ri_startblock = pmap->pe_startblock;
522+
fake.ri_blockcount = pmap->pe_len;
523523
if (!requeue_only)
524524
error = xfs_trans_log_finish_refcount_update(tp, cudp,
525525
&fake, &rcur);
@@ -586,18 +586,18 @@ xfs_cui_item_relog(
586586
{
587587
struct xfs_cud_log_item *cudp;
588588
struct xfs_cui_log_item *cuip;
589-
struct xfs_phys_extent *extp;
589+
struct xfs_phys_extent *pmap;
590590
unsigned int count;
591591

592592
count = CUI_ITEM(intent)->cui_format.cui_nextents;
593-
extp = CUI_ITEM(intent)->cui_format.cui_extents;
593+
pmap = CUI_ITEM(intent)->cui_format.cui_extents;
594594

595595
tp->t_flags |= XFS_TRANS_DIRTY;
596596
cudp = xfs_trans_get_cud(tp, CUI_ITEM(intent));
597597
set_bit(XFS_LI_DIRTY, &cudp->cud_item.li_flags);
598598

599599
cuip = xfs_cui_init(tp->t_mountp, count);
600-
memcpy(cuip->cui_format.cui_extents, extp, count * sizeof(*extp));
600+
memcpy(cuip->cui_format.cui_extents, pmap, count * sizeof(*pmap));
601601
atomic_set(&cuip->cui_next_extent, count);
602602
xfs_trans_add_item(tp, &cuip->cui_item);
603603
set_bit(XFS_LI_DIRTY, &cuip->cui_item.li_flags);

0 commit comments

Comments
 (0)