Skip to content

Commit e3c5de2

Browse files
Darrick J. Wongdchinner
authored andcommitted
xfs: rename struct xfs_attr_item to xfs_attr_intent
Everywhere else in XFS, structures that capture the state of an ongoing deferred work item all have names that end with "_intent". The new extended attribute deferred work items are not named as such, so fix it to follow the naming convention used elsewhere. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Allison Henderson <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
1 parent 3768f69 commit e3c5de2

File tree

6 files changed

+51
-51
lines changed

6 files changed

+51
-51
lines changed

fs/xfs/libxfs/xfs_attr.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ STATIC int xfs_attr_leaf_try_add(struct xfs_da_args *args, struct xfs_buf *bp);
5757
*/
5858
STATIC int xfs_attr_node_get(xfs_da_args_t *args);
5959
STATIC void xfs_attr_restore_rmt_blk(struct xfs_da_args *args);
60-
static int xfs_attr_node_try_addname(struct xfs_attr_item *attr);
61-
STATIC int xfs_attr_node_addname_find_attr(struct xfs_attr_item *attr);
62-
STATIC int xfs_attr_node_remove_attr(struct xfs_attr_item *attr);
60+
static int xfs_attr_node_try_addname(struct xfs_attr_intent *attr);
61+
STATIC int xfs_attr_node_addname_find_attr(struct xfs_attr_intent *attr);
62+
STATIC int xfs_attr_node_remove_attr(struct xfs_attr_intent *attr);
6363
STATIC int xfs_attr_node_lookup(struct xfs_da_args *args,
6464
struct xfs_da_state *state);
6565

@@ -376,7 +376,7 @@ xfs_attr_try_sf_addname(
376376

377377
static int
378378
xfs_attr_sf_addname(
379-
struct xfs_attr_item *attr)
379+
struct xfs_attr_intent *attr)
380380
{
381381
struct xfs_da_args *args = attr->xattri_da_args;
382382
struct xfs_inode *dp = args->dp;
@@ -422,7 +422,7 @@ xfs_attr_sf_addname(
422422
*/
423423
static enum xfs_delattr_state
424424
xfs_attr_complete_op(
425-
struct xfs_attr_item *attr,
425+
struct xfs_attr_intent *attr,
426426
enum xfs_delattr_state replace_state)
427427
{
428428
struct xfs_da_args *args = attr->xattri_da_args;
@@ -438,7 +438,7 @@ xfs_attr_complete_op(
438438

439439
static int
440440
xfs_attr_leaf_addname(
441-
struct xfs_attr_item *attr)
441+
struct xfs_attr_intent *attr)
442442
{
443443
struct xfs_da_args *args = attr->xattri_da_args;
444444
int error;
@@ -492,7 +492,7 @@ xfs_attr_leaf_addname(
492492
*/
493493
static int
494494
xfs_attr_node_addname(
495-
struct xfs_attr_item *attr)
495+
struct xfs_attr_intent *attr)
496496
{
497497
struct xfs_da_args *args = attr->xattri_da_args;
498498
int error;
@@ -529,7 +529,7 @@ xfs_attr_node_addname(
529529

530530
static int
531531
xfs_attr_rmtval_alloc(
532-
struct xfs_attr_item *attr)
532+
struct xfs_attr_intent *attr)
533533
{
534534
struct xfs_da_args *args = attr->xattri_da_args;
535535
int error = 0;
@@ -596,7 +596,7 @@ xfs_attr_leaf_mark_incomplete(
596596
/* Ensure the da state of an xattr deferred work item is ready to go. */
597597
static inline void
598598
xfs_attr_item_init_da_state(
599-
struct xfs_attr_item *attr)
599+
struct xfs_attr_intent *attr)
600600
{
601601
struct xfs_da_args *args = attr->xattri_da_args;
602602

@@ -613,7 +613,7 @@ xfs_attr_item_init_da_state(
613613
*/
614614
static
615615
int xfs_attr_node_removename_setup(
616-
struct xfs_attr_item *attr)
616+
struct xfs_attr_intent *attr)
617617
{
618618
struct xfs_da_args *args = attr->xattri_da_args;
619619
struct xfs_da_state *state;
@@ -651,7 +651,7 @@ int xfs_attr_node_removename_setup(
651651
*/
652652
static int
653653
xfs_attr_leaf_remove_attr(
654-
struct xfs_attr_item *attr)
654+
struct xfs_attr_intent *attr)
655655
{
656656
struct xfs_da_args *args = attr->xattri_da_args;
657657
struct xfs_inode *dp = args->dp;
@@ -716,7 +716,7 @@ xfs_attr_leaf_shrink(
716716
*/
717717
int
718718
xfs_attr_set_iter(
719-
struct xfs_attr_item *attr)
719+
struct xfs_attr_intent *attr)
720720
{
721721
struct xfs_da_args *args = attr->xattri_da_args;
722722
int error = 0;
@@ -893,13 +893,13 @@ xfs_attr_lookup(
893893
}
894894

895895
static int
896-
xfs_attr_item_init(
896+
xfs_attr_intent_init(
897897
struct xfs_da_args *args,
898898
unsigned int op_flags, /* op flag (set or remove) */
899-
struct xfs_attr_item **attr) /* new xfs_attr_item */
899+
struct xfs_attr_intent **attr) /* new xfs_attr_intent */
900900
{
901901

902-
struct xfs_attr_item *new;
902+
struct xfs_attr_intent *new;
903903

904904
new = kmem_cache_zalloc(xfs_attr_intent_cache, GFP_NOFS | __GFP_NOFAIL);
905905
new->xattri_op_flags = op_flags;
@@ -914,10 +914,10 @@ static int
914914
xfs_attr_defer_add(
915915
struct xfs_da_args *args)
916916
{
917-
struct xfs_attr_item *new;
917+
struct xfs_attr_intent *new;
918918
int error = 0;
919919

920-
error = xfs_attr_item_init(args, XFS_ATTRI_OP_FLAGS_SET, &new);
920+
error = xfs_attr_intent_init(args, XFS_ATTRI_OP_FLAGS_SET, &new);
921921
if (error)
922922
return error;
923923

@@ -933,10 +933,10 @@ static int
933933
xfs_attr_defer_replace(
934934
struct xfs_da_args *args)
935935
{
936-
struct xfs_attr_item *new;
936+
struct xfs_attr_intent *new;
937937
int error = 0;
938938

939-
error = xfs_attr_item_init(args, XFS_ATTRI_OP_FLAGS_REPLACE, &new);
939+
error = xfs_attr_intent_init(args, XFS_ATTRI_OP_FLAGS_REPLACE, &new);
940940
if (error)
941941
return error;
942942

@@ -953,10 +953,10 @@ xfs_attr_defer_remove(
953953
struct xfs_da_args *args)
954954
{
955955

956-
struct xfs_attr_item *new;
956+
struct xfs_attr_intent *new;
957957
int error;
958958

959-
error = xfs_attr_item_init(args, XFS_ATTRI_OP_FLAGS_REMOVE, &new);
959+
error = xfs_attr_intent_init(args, XFS_ATTRI_OP_FLAGS_REMOVE, &new);
960960
if (error)
961961
return error;
962962

@@ -1394,7 +1394,7 @@ xfs_attr_node_lookup(
13941394

13951395
STATIC int
13961396
xfs_attr_node_addname_find_attr(
1397-
struct xfs_attr_item *attr)
1397+
struct xfs_attr_intent *attr)
13981398
{
13991399
struct xfs_da_args *args = attr->xattri_da_args;
14001400
int error;
@@ -1447,7 +1447,7 @@ xfs_attr_node_addname_find_attr(
14471447
*/
14481448
static int
14491449
xfs_attr_node_try_addname(
1450-
struct xfs_attr_item *attr)
1450+
struct xfs_attr_intent *attr)
14511451
{
14521452
struct xfs_da_args *args = attr->xattri_da_args;
14531453
struct xfs_da_state *state = attr->xattri_da_state;
@@ -1513,7 +1513,7 @@ xfs_attr_node_removename(
15131513

15141514
static int
15151515
xfs_attr_node_remove_attr(
1516-
struct xfs_attr_item *attr)
1516+
struct xfs_attr_intent *attr)
15171517
{
15181518
struct xfs_da_args *args = attr->xattri_da_args;
15191519
struct xfs_da_state *state = xfs_da_state_alloc(args);
@@ -1616,8 +1616,8 @@ xfs_attr_namecheck(
16161616
int __init
16171617
xfs_attr_intent_init_cache(void)
16181618
{
1619-
xfs_attr_intent_cache = kmem_cache_create("xfs_attr_item",
1620-
sizeof(struct xfs_attr_item),
1619+
xfs_attr_intent_cache = kmem_cache_create("xfs_attr_intent",
1620+
sizeof(struct xfs_attr_intent),
16211621
0, 0, NULL);
16221622

16231623
return xfs_attr_intent_cache != NULL ? 0 : -ENOMEM;

fs/xfs/libxfs/xfs_attr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ struct xfs_attr_list_context {
434434
*/
435435

436436
/*
437-
* Enum values for xfs_attr_item.xattri_da_state
437+
* Enum values for xfs_attr_intent.xattri_da_state
438438
*
439439
* These values are used by delayed attribute operations to keep track of where
440440
* they were before they returned -EAGAIN. A return code of -EAGAIN signals the
@@ -504,7 +504,7 @@ enum xfs_delattr_state {
504504
/*
505505
* Context used for keeping track of delayed attribute operations
506506
*/
507-
struct xfs_attr_item {
507+
struct xfs_attr_intent {
508508
/*
509509
* used to log this item to an intent containing a list of attrs to
510510
* commit later
@@ -551,8 +551,8 @@ bool xfs_attr_is_leaf(struct xfs_inode *ip);
551551
int xfs_attr_get_ilocked(struct xfs_da_args *args);
552552
int xfs_attr_get(struct xfs_da_args *args);
553553
int xfs_attr_set(struct xfs_da_args *args);
554-
int xfs_attr_set_iter(struct xfs_attr_item *attr);
555-
int xfs_attr_remove_iter(struct xfs_attr_item *attr);
554+
int xfs_attr_set_iter(struct xfs_attr_intent *attr);
555+
int xfs_attr_remove_iter(struct xfs_attr_intent *attr);
556556
bool xfs_attr_namecheck(const void *name, size_t length);
557557
int xfs_attr_calc_size(struct xfs_da_args *args, int *local);
558558
void xfs_init_attr_trans(struct xfs_da_args *args, struct xfs_trans_res *tres,

fs/xfs/libxfs/xfs_attr_remote.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ xfs_attr_rmtval_stale(
568568
*/
569569
int
570570
xfs_attr_rmtval_find_space(
571-
struct xfs_attr_item *attr)
571+
struct xfs_attr_intent *attr)
572572
{
573573
struct xfs_da_args *args = attr->xattri_da_args;
574574
struct xfs_bmbt_irec *map = &attr->xattri_map;
@@ -598,7 +598,7 @@ xfs_attr_rmtval_find_space(
598598
*/
599599
int
600600
xfs_attr_rmtval_set_blk(
601-
struct xfs_attr_item *attr)
601+
struct xfs_attr_intent *attr)
602602
{
603603
struct xfs_da_args *args = attr->xattri_da_args;
604604
struct xfs_inode *dp = args->dp;
@@ -674,7 +674,7 @@ xfs_attr_rmtval_invalidate(
674674
*/
675675
int
676676
xfs_attr_rmtval_remove(
677-
struct xfs_attr_item *attr)
677+
struct xfs_attr_intent *attr)
678678
{
679679
struct xfs_da_args *args = attr->xattri_da_args;
680680
int error, done;

fs/xfs/libxfs/xfs_attr_remote.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ int xfs_attr_rmtval_get(struct xfs_da_args *args);
1212
int xfs_attr_rmtval_stale(struct xfs_inode *ip, struct xfs_bmbt_irec *map,
1313
xfs_buf_flags_t incore_flags);
1414
int xfs_attr_rmtval_invalidate(struct xfs_da_args *args);
15-
int xfs_attr_rmtval_remove(struct xfs_attr_item *attr);
15+
int xfs_attr_rmtval_remove(struct xfs_attr_intent *attr);
1616
int xfs_attr_rmt_find_hole(struct xfs_da_args *args);
1717
int xfs_attr_rmtval_set_value(struct xfs_da_args *args);
18-
int xfs_attr_rmtval_set_blk(struct xfs_attr_item *attr);
19-
int xfs_attr_rmtval_find_space(struct xfs_attr_item *attr);
18+
int xfs_attr_rmtval_set_blk(struct xfs_attr_intent *attr);
19+
int xfs_attr_rmtval_find_space(struct xfs_attr_intent *attr);
2020
#endif /* __XFS_ATTR_REMOTE_H__ */

fs/xfs/xfs_attr_item.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ xfs_attrd_item_intent(
300300
*/
301301
STATIC int
302302
xfs_xattri_finish_update(
303-
struct xfs_attr_item *attr,
303+
struct xfs_attr_intent *attr,
304304
struct xfs_attrd_log_item *attrdp)
305305
{
306306
struct xfs_da_args *args = attr->xattri_da_args;
@@ -338,17 +338,17 @@ STATIC void
338338
xfs_attr_log_item(
339339
struct xfs_trans *tp,
340340
struct xfs_attri_log_item *attrip,
341-
struct xfs_attr_item *attr)
341+
const struct xfs_attr_intent *attr)
342342
{
343343
struct xfs_attri_log_format *attrp;
344344

345345
tp->t_flags |= XFS_TRANS_DIRTY;
346346
set_bit(XFS_LI_DIRTY, &attrip->attri_item.li_flags);
347347

348348
/*
349-
* At this point the xfs_attr_item has been constructed, and we've
349+
* At this point the xfs_attr_intent has been constructed, and we've
350350
* created the log intent. Fill in the attri log item and log format
351-
* structure with fields from this xfs_attr_item
351+
* structure with fields from this xfs_attr_intent
352352
*/
353353
attrp = &attrip->attri_format;
354354
attrp->alfi_ino = attr->xattri_da_args->dp->i_ino;
@@ -377,7 +377,7 @@ xfs_attr_create_intent(
377377
{
378378
struct xfs_mount *mp = tp->t_mountp;
379379
struct xfs_attri_log_item *attrip;
380-
struct xfs_attr_item *attr;
380+
struct xfs_attr_intent *attr;
381381

382382
ASSERT(count == 1);
383383

@@ -403,7 +403,7 @@ xfs_attr_create_intent(
403403

404404
static inline void
405405
xfs_attr_free_item(
406-
struct xfs_attr_item *attr)
406+
struct xfs_attr_intent *attr)
407407
{
408408
if (attr->xattri_da_state)
409409
xfs_da_state_free(attr->xattri_da_state);
@@ -421,11 +421,11 @@ xfs_attr_finish_item(
421421
struct list_head *item,
422422
struct xfs_btree_cur **state)
423423
{
424-
struct xfs_attr_item *attr;
424+
struct xfs_attr_intent *attr;
425425
struct xfs_attrd_log_item *done_item = NULL;
426426
int error;
427427

428-
attr = container_of(item, struct xfs_attr_item, xattri_list);
428+
attr = container_of(item, struct xfs_attr_intent, xattri_list);
429429
if (done)
430430
done_item = ATTRD_ITEM(done);
431431

@@ -455,9 +455,9 @@ STATIC void
455455
xfs_attr_cancel_item(
456456
struct list_head *item)
457457
{
458-
struct xfs_attr_item *attr;
458+
struct xfs_attr_intent *attr;
459459

460-
attr = container_of(item, struct xfs_attr_item, xattri_list);
460+
attr = container_of(item, struct xfs_attr_intent, xattri_list);
461461
xfs_attr_free_item(attr);
462462
}
463463

@@ -540,7 +540,7 @@ xfs_attri_item_recover(
540540
struct list_head *capture_list)
541541
{
542542
struct xfs_attri_log_item *attrip = ATTRI_ITEM(lip);
543-
struct xfs_attr_item *attr;
543+
struct xfs_attr_intent *attr;
544544
struct xfs_mount *mp = lip->li_log->l_mp;
545545
struct xfs_inode *ip;
546546
struct xfs_da_args *args;
@@ -565,7 +565,7 @@ xfs_attri_item_recover(
565565
if (error)
566566
return error;
567567

568-
attr = kmem_zalloc(sizeof(struct xfs_attr_item) +
568+
attr = kmem_zalloc(sizeof(struct xfs_attr_intent) +
569569
sizeof(struct xfs_da_args), KM_NOFS);
570570
args = (struct xfs_da_args *)(attr + 1);
571571

fs/xfs/xfs_attr_item.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ struct kmem_zone;
1515
* This is the "attr intention" log item. It is used to log the fact that some
1616
* extended attribute operations need to be processed. An operation is
1717
* currently either a set or remove. Set or remove operations are described by
18-
* the xfs_attr_item which may be logged to this intent.
18+
* the xfs_attr_intent which may be logged to this intent.
1919
*
2020
* During a normal attr operation, name and value point to the name and value
2121
* fields of the caller's xfs_da_args structure. During a recovery, the name
2222
* and value buffers are copied from the log, and stored in a trailing buffer
23-
* attached to the xfs_attr_item until they are committed. They are freed when
24-
* the xfs_attr_item itself is freed when the work is done.
23+
* attached to the xfs_attr_intent until they are committed. They are freed
24+
* when the xfs_attr_intent itself is freed when the work is done.
2525
*/
2626
struct xfs_attri_log_item {
2727
struct xfs_log_item attri_item;

0 commit comments

Comments
 (0)