summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_attr_item.c
diff options
context:
space:
mode:
authorAllison Henderson <allison.henderson@oracle.com>2022-05-11 09:01:22 +0200
committerDave Chinner <david@fromorbit.com>2022-05-11 09:01:22 +0200
commitd68c51e9a4095b57f06bf5dd15ab8fae6dab5d8b (patch)
treeca1971d767cf397a83e5ffaf024867336ac3fb52 /fs/xfs/xfs_attr_item.c
parentxfs: Add larp debug option (diff)
downloadlinux-d68c51e9a4095b57f06bf5dd15ab8fae6dab5d8b.tar.xz
linux-d68c51e9a4095b57f06bf5dd15ab8fae6dab5d8b.zip
xfs: Merge xfs_delattr_context into xfs_attr_item
This is a clean up patch that merges xfs_delattr_context into xfs_attr_item. Now that the refactoring is complete and the delayed operation infrastructure is in place, we can combine these to eliminate the extra struct Signed-off-by: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_attr_item.c')
-rw-r--r--fs/xfs/xfs_attr_item.c50
1 files changed, 24 insertions, 26 deletions
diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c
index 6d1dcc88abfe..1a72fdf76a5f 100644
--- a/fs/xfs/xfs_attr_item.c
+++ b/fs/xfs/xfs_attr_item.c
@@ -302,11 +302,11 @@ xfs_attrd_item_intent(
*/
STATIC int
xfs_xattri_finish_update(
- struct xfs_delattr_context *dac,
+ struct xfs_attr_item *attr,
struct xfs_attrd_log_item *attrdp,
uint32_t op_flags)
{
- struct xfs_da_args *args = dac->da_args;
+ struct xfs_da_args *args = attr->xattri_da_args;
unsigned int op = op_flags &
XFS_ATTR_OP_FLAGS_TYPE_MASK;
int error;
@@ -318,11 +318,11 @@ xfs_xattri_finish_update(
switch (op) {
case XFS_ATTR_OP_FLAGS_SET:
- error = xfs_attr_set_iter(dac);
+ error = xfs_attr_set_iter(attr);
break;
case XFS_ATTR_OP_FLAGS_REMOVE:
ASSERT(XFS_IFORK_Q(args->dp));
- error = xfs_attr_remove_iter(dac);
+ error = xfs_attr_remove_iter(attr);
break;
default:
error = -EFSCORRUPTED;
@@ -366,18 +366,18 @@ xfs_attr_log_item(
* structure with fields from this xfs_attr_item
*/
attrp = &attrip->attri_format;
- attrp->alfi_ino = attr->xattri_dac.da_args->dp->i_ino;
+ attrp->alfi_ino = attr->xattri_da_args->dp->i_ino;
attrp->alfi_op_flags = attr->xattri_op_flags;
- attrp->alfi_value_len = attr->xattri_dac.da_args->valuelen;
- attrp->alfi_name_len = attr->xattri_dac.da_args->namelen;
- attrp->alfi_attr_flags = attr->xattri_dac.da_args->attr_filter;
-
- memcpy(attrip->attri_name, attr->xattri_dac.da_args->name,
- attr->xattri_dac.da_args->namelen);
- memcpy(attrip->attri_value, attr->xattri_dac.da_args->value,
- attr->xattri_dac.da_args->valuelen);
- attrip->attri_name_len = attr->xattri_dac.da_args->namelen;
- attrip->attri_value_len = attr->xattri_dac.da_args->valuelen;
+ attrp->alfi_value_len = attr->xattri_da_args->valuelen;
+ attrp->alfi_name_len = attr->xattri_da_args->namelen;
+ attrp->alfi_attr_flags = attr->xattri_da_args->attr_filter;
+
+ memcpy(attrip->attri_name, attr->xattri_da_args->name,
+ attr->xattri_da_args->namelen);
+ memcpy(attrip->attri_value, attr->xattri_da_args->value,
+ attr->xattri_da_args->valuelen);
+ attrip->attri_name_len = attr->xattri_da_args->namelen;
+ attrip->attri_value_len = attr->xattri_da_args->valuelen;
}
/* Get an ATTRI. */
@@ -402,8 +402,8 @@ xfs_attr_create_intent(
* this is a list of one
*/
list_for_each_entry(attr, items, xattri_list) {
- attrip = xfs_attri_init(mp, attr->xattri_dac.da_args->namelen,
- attr->xattri_dac.da_args->valuelen);
+ attrip = xfs_attri_init(mp, attr->xattri_da_args->namelen,
+ attr->xattri_da_args->valuelen);
if (attrip == NULL)
return NULL;
@@ -425,10 +425,8 @@ xfs_attr_finish_item(
struct xfs_attr_item *attr;
struct xfs_attrd_log_item *done_item = NULL;
int error;
- struct xfs_delattr_context *dac;
attr = container_of(item, struct xfs_attr_item, xattri_list);
- dac = &attr->xattri_dac;
if (done)
done_item = ATTRD_ITEM(done);
@@ -436,9 +434,10 @@ xfs_attr_finish_item(
* Always reset trans after EAGAIN cycle
* since the transaction is new
*/
- dac->da_args->trans = tp;
+ attr->xattri_da_args->trans = tp;
- error = xfs_xattri_finish_update(dac, done_item, attr->xattri_op_flags);
+ error = xfs_xattri_finish_update(attr, done_item,
+ attr->xattri_op_flags);
if (error != -EAGAIN)
kmem_free(attr);
@@ -560,7 +559,7 @@ xfs_attri_item_recover(
sizeof(struct xfs_da_args), KM_NOFS);
args = (struct xfs_da_args *)(attr + 1);
- attr->xattri_dac.da_args = args;
+ attr->xattri_da_args = args;
attr->xattri_op_flags = attrp->alfi_op_flags;
args->dp = ip;
@@ -596,8 +595,7 @@ xfs_attri_item_recover(
xfs_ilock(ip, XFS_ILOCK_EXCL);
xfs_trans_ijoin(tp, ip, 0);
- ret = xfs_xattri_finish_update(&attr->xattri_dac, done_item,
- attrp->alfi_op_flags);
+ ret = xfs_xattri_finish_update(attr, done_item, attrp->alfi_op_flags);
if (ret == -EAGAIN) {
/* There's more work to do, so add it to this transaction */
xfs_defer_add(tp, XFS_DEFER_OPS_TYPE_ATTR, &attr->xattri_list);
@@ -612,8 +610,8 @@ xfs_attri_item_recover(
error = xfs_defer_ops_capture_and_commit(tp, capture_list);
out_unlock:
- if (attr->xattri_dac.leaf_bp)
- xfs_buf_relse(attr->xattri_dac.leaf_bp);
+ if (attr->xattri_leaf_bp)
+ xfs_buf_relse(attr->xattri_leaf_bp);
xfs_iunlock(ip, XFS_ILOCK_EXCL);
xfs_irele(ip);