Skip to content

Commit d86142d

Browse files
dgchinnerDarrick J. Wong
authored andcommitted
xfs: log items should have a xlog pointer, not a mount
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>
1 parent 70447e0 commit d86142d

10 files changed

Lines changed: 14 additions & 12 deletions

fs/xfs/xfs_bmap_item.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ xfs_bui_item_recover(
463463
struct xfs_bui_log_item *buip = BUI_ITEM(lip);
464464
struct xfs_trans *tp;
465465
struct xfs_inode *ip = NULL;
466-
struct xfs_mount *mp = lip->li_mountp;
466+
struct xfs_mount *mp = lip->li_log->l_mp;
467467
struct xfs_map_extent *bmap;
468468
struct xfs_bud_log_item *budp;
469469
xfs_filblks_t count;

fs/xfs/xfs_buf_item.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "xfs_dquot.h"
2222
#include "xfs_trace.h"
2323
#include "xfs_log.h"
24+
#include "xfs_log_priv.h"
2425

2526

2627
struct kmem_cache *xfs_buf_item_cache;
@@ -428,7 +429,7 @@ xfs_buf_item_format(
428429
* occurs during recovery.
429430
*/
430431
if (bip->bli_flags & XFS_BLI_INODE_BUF) {
431-
if (xfs_has_v3inodes(lip->li_mountp) ||
432+
if (xfs_has_v3inodes(lip->li_log->l_mp) ||
432433
!((bip->bli_flags & XFS_BLI_INODE_ALLOC_BUF) &&
433434
xfs_log_item_in_current_chkpt(lip)))
434435
bip->__bli_format.blf_flags |= XFS_BLF_INODE_BUF;
@@ -616,7 +617,7 @@ xfs_buf_item_put(
616617
* that case, the bli is freed on buffer writeback completion.
617618
*/
618619
aborted = test_bit(XFS_LI_ABORTED, &lip->li_flags) ||
619-
xfs_is_shutdown(lip->li_mountp);
620+
xlog_is_shutdown(lip->li_log);
620621
dirty = bip->bli_flags & XFS_BLI_DIRTY;
621622
if (dirty && !aborted)
622623
return false;

fs/xfs/xfs_extfree_item.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ xfs_efi_item_recover(
604604
struct list_head *capture_list)
605605
{
606606
struct xfs_efi_log_item *efip = EFI_ITEM(lip);
607-
struct xfs_mount *mp = lip->li_mountp;
607+
struct xfs_mount *mp = lip->li_log->l_mp;
608608
struct xfs_efd_log_item *efdp;
609609
struct xfs_trans *tp;
610610
struct xfs_extent *extp;

fs/xfs/xfs_log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ xfs_log_item_init(
11011101
int type,
11021102
const struct xfs_item_ops *ops)
11031103
{
1104-
item->li_mountp = mp;
1104+
item->li_log = mp->m_log;
11051105
item->li_ailp = mp->m_ail;
11061106
item->li_type = type;
11071107
item->li_ops = ops;

fs/xfs/xfs_log_cil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ bool
14841484
xfs_log_item_in_current_chkpt(
14851485
struct xfs_log_item *lip)
14861486
{
1487-
struct xfs_cil *cil = lip->li_mountp->m_log->l_cilp;
1487+
struct xfs_cil *cil = lip->li_log->l_cilp;
14881488

14891489
if (list_empty(&lip->li_cil))
14901490
return false;

fs/xfs/xfs_refcount_item.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ xfs_cui_item_recover(
457457
struct xfs_cud_log_item *cudp;
458458
struct xfs_trans *tp;
459459
struct xfs_btree_cur *rcur = NULL;
460-
struct xfs_mount *mp = lip->li_mountp;
460+
struct xfs_mount *mp = lip->li_log->l_mp;
461461
xfs_fsblock_t new_fsb;
462462
xfs_extlen_t new_len;
463463
unsigned int refc_type;

fs/xfs/xfs_rmap_item.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ xfs_rui_item_recover(
510510
struct xfs_rud_log_item *rudp;
511511
struct xfs_trans *tp;
512512
struct xfs_btree_cur *rcur = NULL;
513-
struct xfs_mount *mp = lip->li_mountp;
513+
struct xfs_mount *mp = lip->li_log->l_mp;
514514
enum xfs_rmap_intent_type type;
515515
xfs_exntst_t state;
516516
int i;

fs/xfs/xfs_trace.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ DECLARE_EVENT_CLASS(xfs_log_item_class,
13081308
__field(xfs_lsn_t, lsn)
13091309
),
13101310
TP_fast_assign(
1311-
__entry->dev = lip->li_mountp->m_super->s_dev;
1311+
__entry->dev = lip->li_log->l_mp->m_super->s_dev;
13121312
__entry->lip = lip;
13131313
__entry->type = lip->li_type;
13141314
__entry->flags = lip->li_flags;
@@ -1361,7 +1361,7 @@ DECLARE_EVENT_CLASS(xfs_ail_class,
13611361
__field(xfs_lsn_t, new_lsn)
13621362
),
13631363
TP_fast_assign(
1364-
__entry->dev = lip->li_mountp->m_super->s_dev;
1364+
__entry->dev = lip->li_log->l_mp->m_super->s_dev;
13651365
__entry->lip = lip;
13661366
__entry->type = lip->li_type;
13671367
__entry->flags = lip->li_flags;

fs/xfs/xfs_trans.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ xfs_trans_add_item(
648648
struct xfs_trans *tp,
649649
struct xfs_log_item *lip)
650650
{
651-
ASSERT(lip->li_mountp == tp->t_mountp);
651+
ASSERT(lip->li_log == tp->t_mountp->m_log);
652652
ASSERT(lip->li_ailp == tp->t_mountp->m_ail);
653653
ASSERT(list_empty(&lip->li_trans));
654654
ASSERT(!test_bit(XFS_LI_DIRTY, &lip->li_flags));

fs/xfs/xfs_trans.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/* kernel only transaction subsystem defines */
1010

11+
struct xlog;
1112
struct xfs_buf;
1213
struct xfs_buftarg;
1314
struct xfs_efd_log_item;
@@ -31,7 +32,7 @@ struct xfs_log_item {
3132
struct list_head li_ail; /* AIL pointers */
3233
struct list_head li_trans; /* transaction list */
3334
xfs_lsn_t li_lsn; /* last on-disk lsn */
34-
struct xfs_mount *li_mountp; /* ptr to fs mount */
35+
struct xlog *li_log;
3536
struct xfs_ail *li_ailp; /* ptr to AIL */
3637
uint li_type; /* item type */
3738
unsigned long li_flags; /* misc flags */

0 commit comments

Comments
 (0)