[PATCH v8 10/28] xfs: Add attr context to log item
From: Allison Henderson <hidden>
Date: 2018-08-28 23:18:00
Subsystem:
filesystems (vfs and infrastructure), the rest, xfs filesystem · Maintainers:
Alexander Viro, Christian Brauner, Linus Torvalds, Carlos Maiolino
This patch modifies xfs_attr_item to store a xfs_da_args, a xfs_buf pointer and a new state type. We will use these in the next patch when we modify xfs_set_attr_args to roll transactions by returning EAGAIN. Because the subroutines of this function modify the contents of these structures, we need to find a place to store them where they remain instantiated across multiple calls to xfs_set_attr_args. Signed-off-by: Allison Henderson <redacted> --- fs/xfs/libxfs/xfs_attr.h | 17 ++++++++++++++++- fs/xfs/scrub/common.c | 2 ++ fs/xfs/xfs_acl.c | 2 ++ fs/xfs/xfs_attr_item.c | 2 +- fs/xfs/xfs_ioctl.c | 2 ++ fs/xfs/xfs_ioctl32.c | 2 ++ fs/xfs/xfs_iops.c | 1 + fs/xfs/xfs_xattr.c | 1 + 8 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_attr.h b/fs/xfs/libxfs/xfs_attr.h
index dcf1794..38ba5df 100644
--- a/fs/xfs/libxfs/xfs_attr.h
+++ b/fs/xfs/libxfs/xfs_attr.h@@ -77,6 +77,12 @@ typedef struct attrlist_ent { /* data from attr_list() */ char a_name[1]; /* attr name (NULL terminated) */ } attrlist_ent_t; +/* Attr state machine types */ +typedef enum { + XFS_ATTR_STATE1 = 1, + XFS_ATTR_STATE2 = 2, +} xfs_attr_state_t; + /* * List of attrs to commit later. */
@@ -88,7 +94,16 @@ struct xfs_attr_item { void* xattri_name; /* attr name */ uint32_t xattri_name_len; /* length of name */ uint32_t xattri_flags; /* attr flags */ - struct list_head xattri_list; + + /* + * Delayed attr parameters that need to remain instantiated + * across transaction rolls during the defer finish + */ + struct xfs_buf *xattri_leaf_bp; /* Leaf buf to release */ + xfs_attr_state_t xattri_state; /* state machine marker */ + struct xfs_da_args xattri_args; /* args context */ + + struct list_head xattri_list; /* * A byte array follows the header containing the file name and
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index 346b02a..5d07411 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c@@ -30,6 +30,8 @@ #include "xfs_rmap_btree.h" #include "xfs_log.h" #include "xfs_trans_priv.h" +#include "xfs_da_format.h" +#include "xfs_da_btree.h" #include "xfs_attr.h" #include "xfs_reflink.h" #include "scrub/xfs_scrub.h"
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 8039e35..48166df 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c@@ -10,6 +10,8 @@ #include "xfs_mount.h" #include "xfs_inode.h" #include "xfs_acl.h" +#include "xfs_da_format.h" +#include "xfs_da_btree.h" #include "xfs_attr.h" #include "xfs_trace.h" #include <linux/slab.h>
diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c
index dc09b52..56fc0b0 100644
--- a/fs/xfs/xfs_attr_item.c
+++ b/fs/xfs/xfs_attr_item.c@@ -30,10 +30,10 @@ #include "xfs_rmap.h" #include "xfs_inode.h" #include "xfs_icache.h" -#include "xfs_attr.h" #include "xfs_shared.h" #include "xfs_da_format.h" #include "xfs_da_btree.h" +#include "xfs_attr.h" static inline struct xfs_attri_log_item *ATTRI_ITEM(struct xfs_log_item *lip) {
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 0ef5ece..6cd9218 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c@@ -16,6 +16,8 @@ #include "xfs_rtalloc.h" #include "xfs_itable.h" #include "xfs_error.h" +#include "xfs_da_format.h" +#include "xfs_da_btree.h" #include "xfs_attr.h" #include "xfs_bmap.h" #include "xfs_bmap_util.h"
diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c
index fba115f..42889fc 100644
--- a/fs/xfs/xfs_ioctl32.c
+++ b/fs/xfs/xfs_ioctl32.c@@ -21,6 +21,8 @@ #include "xfs_fsops.h" #include "xfs_alloc.h" #include "xfs_rtalloc.h" +#include "xfs_da_format.h" +#include "xfs_da_btree.h" #include "xfs_attr.h" #include "xfs_ioctl.h" #include "xfs_ioctl32.h"
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index 0ef5ad7..ab605fe 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c@@ -17,6 +17,7 @@ #include "xfs_acl.h" #include "xfs_quota.h" #include "xfs_error.h" +#include "xfs_da_btree.h" #include "xfs_attr.h" #include "xfs_trans.h" #include "xfs_trace.h"
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
index 63ee1d5..031f720 100644
--- a/fs/xfs/xfs_xattr.c
+++ b/fs/xfs/xfs_xattr.c@@ -11,6 +11,7 @@ #include "xfs_mount.h" #include "xfs_da_format.h" #include "xfs_inode.h" +#include "xfs_da_btree.h" #include "xfs_attr.h" #include "xfs_attr_leaf.h" #include "xfs_acl.h"
--
2.7.4