Commit 254f800f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: remove XFS_DA_OP_INCOMPLETE

Now that we use the on-disk flags field also for the interface to the
lower level attr routines we can use the XFS_ATTR_INCOMPLETE definition
from the on-disk format directly instead.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChandan Rajendra <chandanrlinux@gmail.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent d5f0f49a
...@@ -898,7 +898,7 @@ xfs_attr_node_addname( ...@@ -898,7 +898,7 @@ xfs_attr_node_addname(
* The INCOMPLETE flag means that we will find the "old" * The INCOMPLETE flag means that we will find the "old"
* attr, not the "new" one. * attr, not the "new" one.
*/ */
args->op_flags |= XFS_DA_OP_INCOMPLETE; args->attr_filter |= XFS_ATTR_INCOMPLETE;
state = xfs_da_state_alloc(); state = xfs_da_state_alloc();
state->args = args; state->args = args;
state->mp = mp; state->mp = mp;
......
...@@ -456,7 +456,12 @@ xfs_attr_match( ...@@ -456,7 +456,12 @@ xfs_attr_match(
return false; return false;
if (memcmp(args->name, name, namelen) != 0) if (memcmp(args->name, name, namelen) != 0)
return false; return false;
if (args->attr_filter != (flags & XFS_ATTR_NSP_ONDISK_MASK)) /*
* If we are looking for incomplete entries, show only those, else only
* show complete entries.
*/
if (args->attr_filter !=
(flags & (XFS_ATTR_NSP_ONDISK_MASK | XFS_ATTR_INCOMPLETE)))
return false; return false;
return true; return true;
} }
...@@ -2387,14 +2392,6 @@ xfs_attr3_leaf_lookup_int( ...@@ -2387,14 +2392,6 @@ xfs_attr3_leaf_lookup_int(
/* /*
* GROT: Add code to remove incomplete entries. * GROT: Add code to remove incomplete entries.
*/ */
/*
* If we are looking for INCOMPLETE entries, show only those.
* If we are looking for complete entries, show only those.
*/
if (!!(args->op_flags & XFS_DA_OP_INCOMPLETE) !=
!!(entry->flags & XFS_ATTR_INCOMPLETE)) {
continue;
}
if (entry->flags & XFS_ATTR_LOCAL) { if (entry->flags & XFS_ATTR_LOCAL) {
name_loc = xfs_attr3_leaf_name_local(leaf, probe); name_loc = xfs_attr3_leaf_name_local(leaf, probe);
if (!xfs_attr_match(args, name_loc->namelen, if (!xfs_attr_match(args, name_loc->namelen,
......
...@@ -59,7 +59,7 @@ typedef struct xfs_da_args { ...@@ -59,7 +59,7 @@ typedef struct xfs_da_args {
uint8_t filetype; /* filetype of inode for directories */ uint8_t filetype; /* filetype of inode for directories */
void *value; /* set of bytes (maybe contain NULLs) */ void *value; /* set of bytes (maybe contain NULLs) */
int valuelen; /* length of value */ int valuelen; /* length of value */
unsigned int attr_filter; /* XFS_ATTR_{ROOT,SECURE} */ unsigned int attr_filter; /* XFS_ATTR_{ROOT,SECURE,INCOMPLETE} */
unsigned int attr_flags; /* XATTR_{CREATE,REPLACE} */ unsigned int attr_flags; /* XATTR_{CREATE,REPLACE} */
xfs_dahash_t hashval; /* hash value of name */ xfs_dahash_t hashval; /* hash value of name */
xfs_ino_t inumber; /* input/output inode number */ xfs_ino_t inumber; /* input/output inode number */
...@@ -90,7 +90,6 @@ typedef struct xfs_da_args { ...@@ -90,7 +90,6 @@ typedef struct xfs_da_args {
#define XFS_DA_OP_OKNOENT 0x0008 /* lookup/add op, ENOENT ok, else die */ #define XFS_DA_OP_OKNOENT 0x0008 /* lookup/add op, ENOENT ok, else die */
#define XFS_DA_OP_CILOOKUP 0x0010 /* lookup to return CI name if found */ #define XFS_DA_OP_CILOOKUP 0x0010 /* lookup to return CI name if found */
#define XFS_DA_OP_NOTIME 0x0020 /* don't update inode timestamps */ #define XFS_DA_OP_NOTIME 0x0020 /* don't update inode timestamps */
#define XFS_DA_OP_INCOMPLETE 0x0040 /* lookup INCOMPLETE attr keys */
#define XFS_DA_OP_FLAGS \ #define XFS_DA_OP_FLAGS \
{ XFS_DA_OP_JUSTCHECK, "JUSTCHECK" }, \ { XFS_DA_OP_JUSTCHECK, "JUSTCHECK" }, \
...@@ -98,8 +97,7 @@ typedef struct xfs_da_args { ...@@ -98,8 +97,7 @@ typedef struct xfs_da_args {
{ XFS_DA_OP_ADDNAME, "ADDNAME" }, \ { XFS_DA_OP_ADDNAME, "ADDNAME" }, \
{ XFS_DA_OP_OKNOENT, "OKNOENT" }, \ { XFS_DA_OP_OKNOENT, "OKNOENT" }, \
{ XFS_DA_OP_CILOOKUP, "CILOOKUP" }, \ { XFS_DA_OP_CILOOKUP, "CILOOKUP" }, \
{ XFS_DA_OP_NOTIME, "NOTIME" }, \ { XFS_DA_OP_NOTIME, "NOTIME" }
{ XFS_DA_OP_INCOMPLETE, "INCOMPLETE" }
/* /*
* Storage for holding state during Btree searches and split/join ops. * Storage for holding state during Btree searches and split/join ops.
......
...@@ -38,7 +38,8 @@ struct xfs_inobt_rec_incore; ...@@ -38,7 +38,8 @@ struct xfs_inobt_rec_incore;
#define XFS_ATTR_FILTER_FLAGS \ #define XFS_ATTR_FILTER_FLAGS \
{ XFS_ATTR_ROOT, "ROOT" }, \ { XFS_ATTR_ROOT, "ROOT" }, \
{ XFS_ATTR_SECURE, "SECURE" } { XFS_ATTR_SECURE, "SECURE" }, \
{ XFS_ATTR_INCOMPLETE, "INCOMPLETE" }
DECLARE_EVENT_CLASS(xfs_attr_list_class, DECLARE_EVENT_CLASS(xfs_attr_list_class,
TP_PROTO(struct xfs_attr_list_context *ctx), TP_PROTO(struct xfs_attr_list_context *ctx),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment