Skip to content

Commit b53d212

Browse files
Darrick J. Wongdchinner
authored andcommitted
xfs: put the xattr intent item op flags in their own namespace
The flags that are stored in the extended attr intent log item really should have a separate namespace from the rest of the XFS_ATTR_* flags. Give them one to make it a little more obvious that they're intent item flags. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Reviewed-by: Allison Henderson <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
1 parent 4d0cdd2 commit b53d212

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

fs/xfs/libxfs/xfs_attr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ xfs_attr_defer_add(
918918
struct xfs_attr_item *new;
919919
int error = 0;
920920

921-
error = xfs_attr_item_init(args, XFS_ATTR_OP_FLAGS_SET, &new);
921+
error = xfs_attr_item_init(args, XFS_ATTRI_OP_FLAGS_SET, &new);
922922
if (error)
923923
return error;
924924

@@ -937,7 +937,7 @@ xfs_attr_defer_replace(
937937
struct xfs_attr_item *new;
938938
int error = 0;
939939

940-
error = xfs_attr_item_init(args, XFS_ATTR_OP_FLAGS_REPLACE, &new);
940+
error = xfs_attr_item_init(args, XFS_ATTRI_OP_FLAGS_REPLACE, &new);
941941
if (error)
942942
return error;
943943

@@ -957,7 +957,7 @@ xfs_attr_defer_remove(
957957
struct xfs_attr_item *new;
958958
int error;
959959

960-
error = xfs_attr_item_init(args, XFS_ATTR_OP_FLAGS_REMOVE, &new);
960+
error = xfs_attr_item_init(args, XFS_ATTRI_OP_FLAGS_REMOVE, &new);
961961
if (error)
962962
return error;
963963

fs/xfs/libxfs/xfs_attr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ struct xfs_attr_item {
530530
enum xfs_delattr_state xattri_dela_state;
531531

532532
/*
533-
* Attr operation being performed - XFS_ATTR_OP_FLAGS_*
533+
* Attr operation being performed - XFS_ATTRI_OP_FLAGS_*
534534
*/
535535
unsigned int xattri_op_flags;
536536

fs/xfs/libxfs/xfs_log_format.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -906,10 +906,10 @@ struct xfs_icreate_log {
906906
* Flags for deferred attribute operations.
907907
* Upper bits are flags, lower byte is type code
908908
*/
909-
#define XFS_ATTR_OP_FLAGS_SET 1 /* Set the attribute */
910-
#define XFS_ATTR_OP_FLAGS_REMOVE 2 /* Remove the attribute */
911-
#define XFS_ATTR_OP_FLAGS_REPLACE 3 /* Replace the attribute */
912-
#define XFS_ATTR_OP_FLAGS_TYPE_MASK 0xFF /* Flags type mask */
909+
#define XFS_ATTRI_OP_FLAGS_SET 1 /* Set the attribute */
910+
#define XFS_ATTRI_OP_FLAGS_REMOVE 2 /* Remove the attribute */
911+
#define XFS_ATTRI_OP_FLAGS_REPLACE 3 /* Replace the attribute */
912+
#define XFS_ATTRI_OP_FLAGS_TYPE_MASK 0xFF /* Flags type mask */
913913

914914
/*
915915
* alfi_attr_filter captures the state of xfs_da_args.attr_filter, so it should

fs/xfs/xfs_attr_item.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ xfs_attr_log_item(
349349
*/
350350
attrp = &attrip->attri_format;
351351
attrp->alfi_ino = attr->xattri_da_args->dp->i_ino;
352-
ASSERT(!(attr->xattri_op_flags & ~XFS_ATTR_OP_FLAGS_TYPE_MASK));
352+
ASSERT(!(attr->xattri_op_flags & ~XFS_ATTRI_OP_FLAGS_TYPE_MASK));
353353
attrp->alfi_op_flags = attr->xattri_op_flags;
354354
attrp->alfi_value_len = attr->xattri_da_args->valuelen;
355355
attrp->alfi_name_len = attr->xattri_da_args->namelen;
@@ -493,22 +493,22 @@ xfs_attri_validate(
493493
struct xfs_attri_log_format *attrp)
494494
{
495495
unsigned int op = attrp->alfi_op_flags &
496-
XFS_ATTR_OP_FLAGS_TYPE_MASK;
496+
XFS_ATTRI_OP_FLAGS_TYPE_MASK;
497497

498498
if (attrp->__pad != 0)
499499
return false;
500500

501-
if (attrp->alfi_op_flags & ~XFS_ATTR_OP_FLAGS_TYPE_MASK)
501+
if (attrp->alfi_op_flags & ~XFS_ATTRI_OP_FLAGS_TYPE_MASK)
502502
return false;
503503

504504
if (attrp->alfi_attr_filter & ~XFS_ATTRI_FILTER_MASK)
505505
return false;
506506

507507
/* alfi_op_flags should be either a set or remove */
508508
switch (op) {
509-
case XFS_ATTR_OP_FLAGS_SET:
510-
case XFS_ATTR_OP_FLAGS_REPLACE:
511-
case XFS_ATTR_OP_FLAGS_REMOVE:
509+
case XFS_ATTRI_OP_FLAGS_SET:
510+
case XFS_ATTRI_OP_FLAGS_REPLACE:
511+
case XFS_ATTRI_OP_FLAGS_REMOVE:
512512
break;
513513
default:
514514
return false;
@@ -565,7 +565,7 @@ xfs_attri_item_recover(
565565

566566
attr->xattri_da_args = args;
567567
attr->xattri_op_flags = attrp->alfi_op_flags &
568-
XFS_ATTR_OP_FLAGS_TYPE_MASK;
568+
XFS_ATTRI_OP_FLAGS_TYPE_MASK;
569569

570570
args->dp = ip;
571571
args->geo = mp->m_attr_geo;
@@ -577,8 +577,8 @@ xfs_attri_item_recover(
577577
args->op_flags = XFS_DA_OP_RECOVERY | XFS_DA_OP_OKNOENT;
578578

579579
switch (attr->xattri_op_flags) {
580-
case XFS_ATTR_OP_FLAGS_SET:
581-
case XFS_ATTR_OP_FLAGS_REPLACE:
580+
case XFS_ATTRI_OP_FLAGS_SET:
581+
case XFS_ATTRI_OP_FLAGS_REPLACE:
582582
args->value = attrip->attri_value;
583583
args->valuelen = attrp->alfi_value_len;
584584
args->total = xfs_attr_calc_size(args, &local);
@@ -587,7 +587,7 @@ xfs_attri_item_recover(
587587
else
588588
attr->xattri_dela_state = xfs_attr_init_add_state(args);
589589
break;
590-
case XFS_ATTR_OP_FLAGS_REMOVE:
590+
case XFS_ATTRI_OP_FLAGS_REMOVE:
591591
if (!xfs_inode_hasattr(args->dp))
592592
goto out;
593593
attr->xattri_dela_state = xfs_attr_init_remove_state(args);

0 commit comments

Comments
 (0)