]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: turn dfp_intent into a xfs_log_item
authorChristoph Hellwig <hch@lst.de>
Mon, 10 Aug 2020 20:32:04 +0000 (16:32 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 10 Aug 2020 20:32:04 +0000 (16:32 -0400)
Source kernel commit: 13a8333339072b8654c1d2c75550ee9f41ee15de

All defer op instance place their own extension of the log item into
the dfp_intent field.  Replace that with a xfs_log_item to improve type
safety and make the code easier to follow.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/defer_item.c
libxfs/xfs_defer.h

index 49ddf38b93fc65329b6d27a3262f2b27d690c21c..38f289655e2a65fa1d77e4f76f72b3deb87a2389 100644 (file)
@@ -43,7 +43,7 @@ xfs_extent_free_diff_items(
 }
 
 /* Get an EFI. */
-STATIC void *
+static struct xfs_log_item *
 xfs_extent_free_create_intent(
        struct xfs_trans                *tp,
        struct list_head                *items,
@@ -61,7 +61,7 @@ xfs_extent_free_create_intent(
 STATIC void *
 xfs_extent_free_create_done(
        struct xfs_trans                *tp,
-       void                            *intent,
+       struct xfs_log_item             *intent,
        unsigned int                    count)
 {
        return NULL;
@@ -89,7 +89,7 @@ xfs_extent_free_finish_item(
 /* Abort all pending EFIs. */
 STATIC void
 xfs_extent_free_abort_intent(
-       void                            *intent)
+       struct xfs_log_item             *intent)
 {
 }
 
@@ -172,7 +172,7 @@ xfs_rmap_update_diff_items(
 }
 
 /* Get an RUI. */
-STATIC void *
+static struct xfs_log_item *
 xfs_rmap_update_create_intent(
        struct xfs_trans                *tp,
        struct list_head                *items,
@@ -190,7 +190,7 @@ xfs_rmap_update_create_intent(
 STATIC void *
 xfs_rmap_update_create_done(
        struct xfs_trans                *tp,
-       void                            *intent,
+       struct xfs_log_item             *intent,
        unsigned int                    count)
 {
        return NULL;
@@ -235,7 +235,7 @@ xfs_rmap_update_finish_cleanup(
 /* Abort all pending RUIs. */
 STATIC void
 xfs_rmap_update_abort_intent(
-       void                            *intent)
+       struct xfs_log_item             *intent)
 {
 }
 
@@ -279,7 +279,7 @@ xfs_refcount_update_diff_items(
 }
 
 /* Get an CUI. */
-STATIC void *
+static struct xfs_log_item *
 xfs_refcount_update_create_intent(
        struct xfs_trans                *tp,
        struct list_head                *items,
@@ -297,7 +297,7 @@ xfs_refcount_update_create_intent(
 STATIC void *
 xfs_refcount_update_create_done(
        struct xfs_trans                *tp,
-       void                            *intent,
+       struct xfs_log_item             *intent,
        unsigned int                    count)
 {
        return NULL;
@@ -350,7 +350,7 @@ xfs_refcount_update_finish_cleanup(
 /* Abort all pending CUIs. */
 STATIC void
 xfs_refcount_update_abort_intent(
-       void                            *intent)
+       struct xfs_log_item             *intent)
 {
 }
 
@@ -392,7 +392,7 @@ xfs_bmap_update_diff_items(
 }
 
 /* Get an BUI. */
-STATIC void *
+static struct xfs_log_item *
 xfs_bmap_update_create_intent(
        struct xfs_trans                *tp,
        struct list_head                *items,
@@ -410,7 +410,7 @@ xfs_bmap_update_create_intent(
 STATIC void *
 xfs_bmap_update_create_done(
        struct xfs_trans                *tp,
-       void                            *intent,
+       struct xfs_log_item             *intent,
        unsigned int                    count)
 {
        return NULL;
@@ -449,7 +449,7 @@ xfs_bmap_update_finish_item(
 /* Abort all pending BUIs. */
 STATIC void
 xfs_bmap_update_abort_intent(
-       void                            *intent)
+       struct xfs_log_item             *intent)
 {
 }
 
index 660f5c3821d6b950b9b93d9688fec4e2fb8e9d20..7b6cc3808a91b0c87c3ea82f0612ac1d9d77a146 100644 (file)
@@ -28,7 +28,7 @@ enum xfs_defer_ops_type {
 struct xfs_defer_pending {
        struct list_head                dfp_list;       /* pending items */
        struct list_head                dfp_work;       /* work items */
-       void                            *dfp_intent;    /* log intent item */
+       struct xfs_log_item             *dfp_intent;    /* log intent item */
        void                            *dfp_done;      /* log done item */
        unsigned int                    dfp_count;      /* # extent items */
        enum xfs_defer_ops_type         dfp_type;
@@ -43,14 +43,15 @@ void xfs_defer_move(struct xfs_trans *dtp, struct xfs_trans *stp);
 
 /* Description of a deferred type. */
 struct xfs_defer_op_type {
-       void (*abort_intent)(void *);
-       void *(*create_done)(struct xfs_trans *, void *, unsigned int);
+       struct xfs_log_item *(*create_intent)(struct xfs_trans *tp,
+                       struct list_head *items, unsigned int count, bool sort);
+       void (*abort_intent)(struct xfs_log_item *intent);
+       void *(*create_done)(struct xfs_trans *tp, struct xfs_log_item *intent,
+                       unsigned int count);
        int (*finish_item)(struct xfs_trans *, struct list_head *, void *,
                        void **);
        void (*finish_cleanup)(struct xfs_trans *, void *, int);
        void (*cancel_item)(struct list_head *);
-       void *(*create_intent)(struct xfs_trans *tp, struct list_head *items,
-                       unsigned int count, bool sort);
        unsigned int            max_items;
 };