]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
xfs: log items should have a xlog pointer, not a mount
authorDave Chinner <dchinner@redhat.com>
Thu, 17 Mar 2022 16:09:12 +0000 (09:09 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Sun, 20 Mar 2022 15:59:49 +0000 (08:59 -0700)
Log items belong to the log, not the xfs_mount. Convert the mount
pointer in the log item to a xlog pointer in preparation for
upcoming log centric changes to the log items.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Chandan Babu R <chandan.babu@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_bmap_item.c
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_extfree_item.c
fs/xfs/xfs_log.c
fs/xfs/xfs_log_cil.c
fs/xfs/xfs_refcount_item.c
fs/xfs/xfs_rmap_item.c
fs/xfs/xfs_trace.h
fs/xfs/xfs_trans.c
fs/xfs/xfs_trans.h

index e1f4d7d5a011cbc6b3bb8bbea03d6bdee9b4280c..761dde15509958ee2a231465307e136fae09c64c 100644 (file)
@@ -463,7 +463,7 @@ xfs_bui_item_recover(
        struct xfs_bui_log_item         *buip = BUI_ITEM(lip);
        struct xfs_trans                *tp;
        struct xfs_inode                *ip = NULL;
-       struct xfs_mount                *mp = lip->li_mountp;
+       struct xfs_mount                *mp = lip->li_log->l_mp;
        struct xfs_map_extent           *bmap;
        struct xfs_bud_log_item         *budp;
        xfs_filblks_t                   count;
index a7a8e452888192b9d795c1c2d4cc43a5a24c89f4..522d450a94b18616183ebc2a0c8a35b56111341d 100644 (file)
@@ -21,6 +21,7 @@
 #include "xfs_dquot.h"
 #include "xfs_trace.h"
 #include "xfs_log.h"
+#include "xfs_log_priv.h"
 
 
 struct kmem_cache      *xfs_buf_item_cache;
@@ -428,7 +429,7 @@ xfs_buf_item_format(
         * occurs during recovery.
         */
        if (bip->bli_flags & XFS_BLI_INODE_BUF) {
-               if (xfs_has_v3inodes(lip->li_mountp) ||
+               if (xfs_has_v3inodes(lip->li_log->l_mp) ||
                    !((bip->bli_flags & XFS_BLI_INODE_ALLOC_BUF) &&
                      xfs_log_item_in_current_chkpt(lip)))
                        bip->__bli_format.blf_flags |= XFS_BLF_INODE_BUF;
@@ -616,7 +617,7 @@ xfs_buf_item_put(
         * that case, the bli is freed on buffer writeback completion.
         */
        aborted = test_bit(XFS_LI_ABORTED, &lip->li_flags) ||
-                 xfs_is_shutdown(lip->li_mountp);
+                       xlog_is_shutdown(lip->li_log);
        dirty = bip->bli_flags & XFS_BLI_DIRTY;
        if (dirty && !aborted)
                return false;
index 47ef9c9c5c176a58ecada3129356cb551e90426b..0e50f2c9348e196ab39cc33b7fc25d4ca3d96458 100644 (file)
@@ -604,7 +604,7 @@ xfs_efi_item_recover(
        struct list_head                *capture_list)
 {
        struct xfs_efi_log_item         *efip = EFI_ITEM(lip);
-       struct xfs_mount                *mp = lip->li_mountp;
+       struct xfs_mount                *mp = lip->li_log->l_mp;
        struct xfs_efd_log_item         *efdp;
        struct xfs_trans                *tp;
        struct xfs_extent               *extp;
index ffd928cf9a9ae7c67235a01c00bff37860918100..5010ce712a3e6adfd57192a0271646bd1974929e 100644 (file)
@@ -1101,7 +1101,7 @@ xfs_log_item_init(
        int                     type,
        const struct xfs_item_ops *ops)
 {
-       item->li_mountp = mp;
+       item->li_log = mp->m_log;
        item->li_ailp = mp->m_ail;
        item->li_type = type;
        item->li_ops = ops;
index 25a86e35b4fe923ee0522049ab6d29885cdeefd9..796e4464f809b143ede4dab5698a1bd0cb7db64b 100644 (file)
@@ -1484,7 +1484,7 @@ bool
 xfs_log_item_in_current_chkpt(
        struct xfs_log_item     *lip)
 {
-       struct xfs_cil          *cil = lip->li_mountp->m_log->l_cilp;
+       struct xfs_cil          *cil = lip->li_log->l_cilp;
 
        if (list_empty(&lip->li_cil))
                return false;
index d3da67772d5727640922cd539f168bf55cc11a76..0d868c93144d3b1828a457286e8919f5615a2407 100644 (file)
@@ -457,7 +457,7 @@ xfs_cui_item_recover(
        struct xfs_cud_log_item         *cudp;
        struct xfs_trans                *tp;
        struct xfs_btree_cur            *rcur = NULL;
-       struct xfs_mount                *mp = lip->li_mountp;
+       struct xfs_mount                *mp = lip->li_log->l_mp;
        xfs_fsblock_t                   new_fsb;
        xfs_extlen_t                    new_len;
        unsigned int                    refc_type;
index c3966b4c58ef6f0f62257de1d52684076ca9c1a2..a22b2d19ef91750761b0d95e9175c7f132112c6e 100644 (file)
@@ -510,7 +510,7 @@ xfs_rui_item_recover(
        struct xfs_rud_log_item         *rudp;
        struct xfs_trans                *tp;
        struct xfs_btree_cur            *rcur = NULL;
-       struct xfs_mount                *mp = lip->li_mountp;
+       struct xfs_mount                *mp = lip->li_log->l_mp;
        enum xfs_rmap_intent_type       type;
        xfs_exntst_t                    state;
        int                             i;
index 239c8b8a5a8567f6d2320bece43344a06afc97ef..b141ef78c7550587d72b38da7ba7fa0b63d77dde 100644 (file)
@@ -1308,7 +1308,7 @@ DECLARE_EVENT_CLASS(xfs_log_item_class,
                __field(xfs_lsn_t, lsn)
        ),
        TP_fast_assign(
-               __entry->dev = lip->li_mountp->m_super->s_dev;
+               __entry->dev = lip->li_log->l_mp->m_super->s_dev;
                __entry->lip = lip;
                __entry->type = lip->li_type;
                __entry->flags = lip->li_flags;
@@ -1361,7 +1361,7 @@ DECLARE_EVENT_CLASS(xfs_ail_class,
                __field(xfs_lsn_t, new_lsn)
        ),
        TP_fast_assign(
-               __entry->dev = lip->li_mountp->m_super->s_dev;
+               __entry->dev = lip->li_log->l_mp->m_super->s_dev;
                __entry->lip = lip;
                __entry->type = lip->li_type;
                __entry->flags = lip->li_flags;
index 3d11f9bb0dbbcf2500f0768a534a7efe38381aa0..50f22c34716aedc3ad45e2535846dce29dc2fa91 100644 (file)
@@ -648,7 +648,7 @@ xfs_trans_add_item(
        struct xfs_trans        *tp,
        struct xfs_log_item     *lip)
 {
-       ASSERT(lip->li_mountp == tp->t_mountp);
+       ASSERT(lip->li_log == tp->t_mountp->m_log);
        ASSERT(lip->li_ailp == tp->t_mountp->m_ail);
        ASSERT(list_empty(&lip->li_trans));
        ASSERT(!test_bit(XFS_LI_DIRTY, &lip->li_flags));
index faa282204498b621b30db83a5e3c88efd39363a3..de177842b951cafd27dd22e166b1bd23a200d4de 100644 (file)
@@ -8,6 +8,7 @@
 
 /* kernel only transaction subsystem defines */
 
+struct xlog;
 struct xfs_buf;
 struct xfs_buftarg;
 struct xfs_efd_log_item;
@@ -31,7 +32,7 @@ struct xfs_log_item {
        struct list_head                li_ail;         /* AIL pointers */
        struct list_head                li_trans;       /* transaction list */
        xfs_lsn_t                       li_lsn;         /* last on-disk lsn */
-       struct xfs_mount                *li_mountp;     /* ptr to fs mount */
+       struct xlog                     *li_log;
        struct xfs_ail                  *li_ailp;       /* ptr to AIL */
        uint                            li_type;        /* item type */
        unsigned long                   li_flags;       /* misc flags */