]> git.itanic.dy.fi Git - linux-stable/commitdiff
xfs: move xfs_attr_defer_type up in xfs_attr_item.c
authorChristoph Hellwig <hch@lst.de>
Wed, 13 Dec 2023 09:06:30 +0000 (10:06 +0100)
committerChandan Babu R <chandanbabu@kernel.org>
Thu, 14 Dec 2023 05:40:33 +0000 (11:10 +0530)
We'll reference it directly in xlog_recover_attri_commit_pass2, so move
it up a bit.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/xfs_attr_item.c

index 39f2c5a46179f74272a87bd072bb46c4757533d5..4e0eaa2640e0d2340715555d638a4652306d2074 100644 (file)
@@ -654,6 +654,39 @@ xfs_attr_relog_intent(
        return &new_attrip->attri_item;
 }
 
+/* Get an ATTRD so we can process all the attrs. */
+static struct xfs_log_item *
+xfs_attr_create_done(
+       struct xfs_trans                *tp,
+       struct xfs_log_item             *intent,
+       unsigned int                    count)
+{
+       struct xfs_attri_log_item       *attrip;
+       struct xfs_attrd_log_item       *attrdp;
+
+       attrip = ATTRI_ITEM(intent);
+
+       attrdp = kmem_cache_zalloc(xfs_attrd_cache, GFP_NOFS | __GFP_NOFAIL);
+
+       xfs_log_item_init(tp->t_mountp, &attrdp->attrd_item, XFS_LI_ATTRD,
+                         &xfs_attrd_item_ops);
+       attrdp->attrd_attrip = attrip;
+       attrdp->attrd_format.alfd_alf_id = attrip->attri_format.alfi_id;
+
+       return &attrdp->attrd_item;
+}
+
+const struct xfs_defer_op_type xfs_attr_defer_type = {
+       .max_items      = 1,
+       .create_intent  = xfs_attr_create_intent,
+       .abort_intent   = xfs_attr_abort_intent,
+       .create_done    = xfs_attr_create_done,
+       .finish_item    = xfs_attr_finish_item,
+       .cancel_item    = xfs_attr_cancel_item,
+       .recover_work   = xfs_attr_recover_work,
+       .relog_intent   = xfs_attr_relog_intent,
+};
+
 STATIC int
 xlog_recover_attri_commit_pass2(
        struct xlog                     *log,
@@ -730,39 +763,6 @@ xlog_recover_attri_commit_pass2(
        return 0;
 }
 
-/* Get an ATTRD so we can process all the attrs. */
-static struct xfs_log_item *
-xfs_attr_create_done(
-       struct xfs_trans                *tp,
-       struct xfs_log_item             *intent,
-       unsigned int                    count)
-{
-       struct xfs_attri_log_item       *attrip;
-       struct xfs_attrd_log_item       *attrdp;
-
-       attrip = ATTRI_ITEM(intent);
-
-       attrdp = kmem_cache_zalloc(xfs_attrd_cache, GFP_NOFS | __GFP_NOFAIL);
-
-       xfs_log_item_init(tp->t_mountp, &attrdp->attrd_item, XFS_LI_ATTRD,
-                         &xfs_attrd_item_ops);
-       attrdp->attrd_attrip = attrip;
-       attrdp->attrd_format.alfd_alf_id = attrip->attri_format.alfi_id;
-
-       return &attrdp->attrd_item;
-}
-
-const struct xfs_defer_op_type xfs_attr_defer_type = {
-       .max_items      = 1,
-       .create_intent  = xfs_attr_create_intent,
-       .abort_intent   = xfs_attr_abort_intent,
-       .create_done    = xfs_attr_create_done,
-       .finish_item    = xfs_attr_finish_item,
-       .cancel_item    = xfs_attr_cancel_item,
-       .recover_work   = xfs_attr_recover_work,
-       .relog_intent   = xfs_attr_relog_intent,
-};
-
 /*
  * This routine is called when an ATTRD format structure is found in a committed
  * transaction in the log. Its purpose is to cancel the corresponding ATTRI if