Skip to content

Commit f3ebac4

Browse files
author
Darrick J. Wong
committed
xfs: fix confusing variable names in xfs_bmap_item.c
Variable names in this code module are inconsistent and confusing. xfs_map_extent describe file mappings, so rename them "map". xfs_bmap_intents describe block mapping intents, so rename them "bi". Signed-off-by: Darrick J. Wong <[email protected]>
1 parent ddccb81 commit f3ebac4

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

fs/xfs/xfs_bmap_item.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -283,32 +283,32 @@ xfs_bmap_update_diff_items(
283283
/* Set the map extent flags for this mapping. */
284284
static void
285285
xfs_trans_set_bmap_flags(
286-
struct xfs_map_extent *bmap,
286+
struct xfs_map_extent *map,
287287
enum xfs_bmap_intent_type type,
288288
int whichfork,
289289
xfs_exntst_t state)
290290
{
291-
bmap->me_flags = 0;
291+
map->me_flags = 0;
292292
switch (type) {
293293
case XFS_BMAP_MAP:
294294
case XFS_BMAP_UNMAP:
295-
bmap->me_flags = type;
295+
map->me_flags = type;
296296
break;
297297
default:
298298
ASSERT(0);
299299
}
300300
if (state == XFS_EXT_UNWRITTEN)
301-
bmap->me_flags |= XFS_BMAP_EXTENT_UNWRITTEN;
301+
map->me_flags |= XFS_BMAP_EXTENT_UNWRITTEN;
302302
if (whichfork == XFS_ATTR_FORK)
303-
bmap->me_flags |= XFS_BMAP_EXTENT_ATTR_FORK;
303+
map->me_flags |= XFS_BMAP_EXTENT_ATTR_FORK;
304304
}
305305

306306
/* Log bmap updates in the intent item. */
307307
STATIC void
308308
xfs_bmap_update_log_item(
309309
struct xfs_trans *tp,
310310
struct xfs_bui_log_item *buip,
311-
struct xfs_bmap_intent *bmap)
311+
struct xfs_bmap_intent *bi)
312312
{
313313
uint next_extent;
314314
struct xfs_map_extent *map;
@@ -324,12 +324,12 @@ xfs_bmap_update_log_item(
324324
next_extent = atomic_inc_return(&buip->bui_next_extent) - 1;
325325
ASSERT(next_extent < buip->bui_format.bui_nextents);
326326
map = &buip->bui_format.bui_extents[next_extent];
327-
map->me_owner = bmap->bi_owner->i_ino;
328-
map->me_startblock = bmap->bi_bmap.br_startblock;
329-
map->me_startoff = bmap->bi_bmap.br_startoff;
330-
map->me_len = bmap->bi_bmap.br_blockcount;
331-
xfs_trans_set_bmap_flags(map, bmap->bi_type, bmap->bi_whichfork,
332-
bmap->bi_bmap.br_state);
327+
map->me_owner = bi->bi_owner->i_ino;
328+
map->me_startblock = bi->bi_bmap.br_startblock;
329+
map->me_startoff = bi->bi_bmap.br_startoff;
330+
map->me_len = bi->bi_bmap.br_blockcount;
331+
xfs_trans_set_bmap_flags(map, bi->bi_type, bi->bi_whichfork,
332+
bi->bi_bmap.br_state);
333333
}
334334

335335
static struct xfs_log_item *
@@ -341,15 +341,15 @@ xfs_bmap_update_create_intent(
341341
{
342342
struct xfs_mount *mp = tp->t_mountp;
343343
struct xfs_bui_log_item *buip = xfs_bui_init(mp);
344-
struct xfs_bmap_intent *bmap;
344+
struct xfs_bmap_intent *bi;
345345

346346
ASSERT(count == XFS_BUI_MAX_FAST_EXTENTS);
347347

348348
xfs_trans_add_item(tp, &buip->bui_item);
349349
if (sort)
350350
list_sort(mp, items, xfs_bmap_update_diff_items);
351-
list_for_each_entry(bmap, items, bi_list)
352-
xfs_bmap_update_log_item(tp, buip, bmap);
351+
list_for_each_entry(bi, items, bi_list)
352+
xfs_bmap_update_log_item(tp, buip, bi);
353353
return &buip->bui_item;
354354
}
355355

@@ -398,10 +398,10 @@ STATIC void
398398
xfs_bmap_update_cancel_item(
399399
struct list_head *item)
400400
{
401-
struct xfs_bmap_intent *bmap;
401+
struct xfs_bmap_intent *bi;
402402

403-
bmap = container_of(item, struct xfs_bmap_intent, bi_list);
404-
kmem_cache_free(xfs_bmap_intent_cache, bmap);
403+
bi = container_of(item, struct xfs_bmap_intent, bi_list);
404+
kmem_cache_free(xfs_bmap_intent_cache, bi);
405405
}
406406

407407
const struct xfs_defer_op_type xfs_bmap_update_defer_type = {
@@ -419,32 +419,32 @@ xfs_bui_validate(
419419
struct xfs_mount *mp,
420420
struct xfs_bui_log_item *buip)
421421
{
422-
struct xfs_map_extent *bmap;
422+
struct xfs_map_extent *map;
423423

424424
/* Only one mapping operation per BUI... */
425425
if (buip->bui_format.bui_nextents != XFS_BUI_MAX_FAST_EXTENTS)
426426
return false;
427427

428-
bmap = &buip->bui_format.bui_extents[0];
428+
map = &buip->bui_format.bui_extents[0];
429429

430-
if (bmap->me_flags & ~XFS_BMAP_EXTENT_FLAGS)
430+
if (map->me_flags & ~XFS_BMAP_EXTENT_FLAGS)
431431
return false;
432432

433-
switch (bmap->me_flags & XFS_BMAP_EXTENT_TYPE_MASK) {
433+
switch (map->me_flags & XFS_BMAP_EXTENT_TYPE_MASK) {
434434
case XFS_BMAP_MAP:
435435
case XFS_BMAP_UNMAP:
436436
break;
437437
default:
438438
return false;
439439
}
440440

441-
if (!xfs_verify_ino(mp, bmap->me_owner))
441+
if (!xfs_verify_ino(mp, map->me_owner))
442442
return false;
443443

444-
if (!xfs_verify_fileext(mp, bmap->me_startoff, bmap->me_len))
444+
if (!xfs_verify_fileext(mp, map->me_startoff, map->me_len))
445445
return false;
446446

447-
return xfs_verify_fsbext(mp, bmap->me_startblock, bmap->me_len);
447+
return xfs_verify_fsbext(mp, map->me_startblock, map->me_len);
448448
}
449449

450450
/*
@@ -558,18 +558,18 @@ xfs_bui_item_relog(
558558
{
559559
struct xfs_bud_log_item *budp;
560560
struct xfs_bui_log_item *buip;
561-
struct xfs_map_extent *extp;
561+
struct xfs_map_extent *map;
562562
unsigned int count;
563563

564564
count = BUI_ITEM(intent)->bui_format.bui_nextents;
565-
extp = BUI_ITEM(intent)->bui_format.bui_extents;
565+
map = BUI_ITEM(intent)->bui_format.bui_extents;
566566

567567
tp->t_flags |= XFS_TRANS_DIRTY;
568568
budp = xfs_trans_get_bud(tp, BUI_ITEM(intent));
569569
set_bit(XFS_LI_DIRTY, &budp->bud_item.li_flags);
570570

571571
buip = xfs_bui_init(tp->t_mountp);
572-
memcpy(buip->bui_format.bui_extents, extp, count * sizeof(*extp));
572+
memcpy(buip->bui_format.bui_extents, map, count * sizeof(*map));
573573
atomic_set(&buip->bui_next_extent, count);
574574
xfs_trans_add_item(tp, &buip->bui_item);
575575
set_bit(XFS_LI_DIRTY, &buip->bui_item.li_flags);

0 commit comments

Comments
 (0)