diff options
author | Carlos Maiolino <cmaiolino@redhat.com> | 2018-02-26 22:43:19 -0600 |
---|---|---|
committer | Eric Sandeen <sandeen@redhat.com> | 2018-02-26 22:43:19 -0600 |
commit | 37d086ca9ac33917d90aa883decef8bb24524ba1 (patch) | |
tree | 711290d4fb9e9debfa6e2c033daf64a7e6ca3593 | |
parent | d5105a897ca973d43e82d54bda4ea40692a94769 (diff) | |
download | xfsprogs-dev-37d086ca9ac33917d90aa883decef8bb24524ba1.tar.gz |
Split buffer's b_fspriv field
Source kernel commit: fb1755a645972ed096047583600838f6cf414e2b
By splitting the b_fspriv field into two different fields (b_log_item
and b_li_list). It's possible to get rid of an old ABI workaround, by
using the new b_log_item field to store xfs_buf_log_item separated from
the log items attached to the buffer, which will be linked in the new
b_li_list field.
This way, there is no more need to reorder the log items list to place
the buf_log_item at the beginning of the list, simplifying a bit the
logic to handle buffer IO.
This also opens the possibility to change buffer's log items list into a
proper list_head.
b_log_item field is still defined as a void *, because it is still used
by the log buffers to store xlog_in_core structures, and there is no
need to add an extra field on xfs_buf just for xlog_in_core.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: minor style changes]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
[sandeen: b_li_list unused in userspace]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r-- | libxfs/libxfs_io.h | 2 | ||||
-rw-r--r-- | libxfs/logitem.c | 8 | ||||
-rw-r--r-- | libxfs/trans.c | 38 | ||||
-rw-r--r-- | libxfs/util.c | 2 | ||||
-rw-r--r-- | libxfs/xfs_alloc.c | 8 | ||||
-rw-r--r-- | libxfs/xfs_attr_leaf.c | 2 | ||||
-rw-r--r-- | libxfs/xfs_btree.c | 4 | ||||
-rw-r--r-- | libxfs/xfs_da_btree.c | 2 | ||||
-rw-r--r-- | libxfs/xfs_dir2_block.c | 2 | ||||
-rw-r--r-- | libxfs/xfs_dir2_data.c | 2 | ||||
-rw-r--r-- | libxfs/xfs_dir2_leaf.c | 2 | ||||
-rw-r--r-- | libxfs/xfs_dir2_node.c | 2 | ||||
-rw-r--r-- | libxfs/xfs_ialloc.c | 4 | ||||
-rw-r--r-- | libxfs/xfs_sb.c | 2 | ||||
-rw-r--r-- | libxfs/xfs_symlink_remote.c | 2 |
15 files changed, 41 insertions, 41 deletions
diff --git a/libxfs/libxfs_io.h b/libxfs/libxfs_io.h index 6087fe084a..6308a742bc 100644 --- a/libxfs/libxfs_io.h +++ b/libxfs/libxfs_io.h @@ -69,7 +69,7 @@ typedef struct xfs_buf { pthread_mutex_t b_lock; pthread_t b_holder; unsigned int b_recur; - void *b_fspriv; + void *b_log_item; void *b_transp; void *b_addr; int b_error; diff --git a/libxfs/logitem.c b/libxfs/logitem.c index 0c50fcf16b..39ac19232f 100644 --- a/libxfs/logitem.c +++ b/libxfs/logitem.c @@ -73,7 +73,7 @@ xfs_trans_buf_item_match( /* * Allocate a new buf log item to go with the given buffer. - * Set the buffer's b_fsprivate field to point to the new + * Set the buffer's b_log_item field to point to the new * buf log item. If there are other item's attached to the * buffer (see xfs_buf_attach_iodone() below), then put the * buf log item at the front. @@ -97,8 +97,8 @@ xfs_buf_item_init( * nothing to do here so return. */ XFS_BUF_SET_BDSTRAT_FUNC(bp, xfs_bdstrat_cb); - if (bp->b_fspriv != NULL) { - lip = bp->b_fspriv; + if (bp->b_log_item != NULL) { + lip = bp->b_log_item; if (lip->li_type == XFS_LI_BUF) { #ifdef LI_DEBUG fprintf(stderr, @@ -121,7 +121,7 @@ xfs_buf_item_init( bip->bli_format.blf_type = XFS_LI_BUF; bip->bli_format.blf_blkno = (int64_t)XFS_BUF_ADDR(bp); bip->bli_format.blf_len = (unsigned short)BTOBB(XFS_BUF_COUNT(bp)); - bp->b_fspriv = bip; + bp->b_log_item = bip; } diff --git a/libxfs/trans.c b/libxfs/trans.c index f330d4b74b..0e7b7ae0a7 100644 --- a/libxfs/trans.c +++ b/libxfs/trans.c @@ -306,7 +306,7 @@ libxfs_trans_inode_alloc_buf( xfs_trans_t *tp, xfs_buf_t *bp) { - xfs_buf_log_item_t *bip = bp->b_fspriv;; + xfs_buf_log_item_t *bip = bp->b_log_item; ASSERT(bp->bp_transp == tp); ASSERT(bip != NULL); @@ -372,7 +372,7 @@ libxfs_trans_dirty_buf( struct xfs_trans *tp, struct xfs_buf *bp) { - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; ASSERT(bp->bp_transp == tp); ASSERT(bip != NULL); @@ -400,7 +400,7 @@ libxfs_trans_log_buf( uint first, uint last) { - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; ASSERT((first <= last) && (last < XFS_BUF_COUNT(bp))); @@ -420,7 +420,7 @@ libxfs_trans_ordered_buf( struct xfs_trans *tp, struct xfs_buf *bp) { - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; bool ret; ret = (bip->bli_item.li_desc->lid_flags & XFS_LID_DIRTY); @@ -444,7 +444,7 @@ libxfs_trans_brelse( return; } ASSERT(bp->bp_transp == tp); - bip = bp->b_fspriv; + bip = bp->b_log_item; ASSERT(bip->bli_item.li_type == XFS_LI_BUF); if (bip->bli_recur > 0) { bip->bli_recur--; @@ -467,7 +467,7 @@ libxfs_trans_binval( xfs_trans_t *tp, xfs_buf_t *bp) { - xfs_buf_log_item_t *bip = bp->b_fspriv; + xfs_buf_log_item_t *bip = bp->b_log_item; #ifdef XACT_DEBUG fprintf(stderr, "binval'd buffer %p, transaction %p\n", bp, tp); #endif @@ -500,7 +500,7 @@ libxfs_trans_bjoin( #endif xfs_buf_item_init(bp, tp->t_mountp); - bip = bp->b_fspriv; + bip = bp->b_log_item; xfs_trans_add_item(tp, (xfs_log_item_t *)bip); bp->b_transp = tp; } @@ -510,10 +510,10 @@ libxfs_trans_bhold( xfs_trans_t *tp, xfs_buf_t *bp) { - xfs_buf_log_item_t *bip =bp->b_fspriv; + xfs_buf_log_item_t *bip = bp->b_log_item; ASSERT(bp->bp_transp == tp); - ASSERT(bp->b_fspriv != NULL); + ASSERT(bip != NULL); #ifdef XACT_DEBUG fprintf(stderr, "bhold'd buffer %p, transaction %p\n", bp, tp); #endif @@ -538,7 +538,7 @@ libxfs_trans_get_buf_map( bp = xfs_trans_buf_item_match(tp, btp, map, nmaps); if (bp != NULL) { ASSERT(bp->bp_transp == tp); - bip = bp->b_fspriv; + bip = bp->b_log_item; ASSERT(bip != NULL); bip->bli_recur++; return bp; @@ -552,7 +552,7 @@ libxfs_trans_get_buf_map( #endif xfs_buf_item_init(bp, tp->t_mountp); - bip = bp->b_fspriv; + bip = bp->b_log_item; bip->bli_recur = 0; xfs_trans_add_item(tp, (xfs_log_item_t *)bip); @@ -578,7 +578,7 @@ libxfs_trans_getsb( bp = xfs_trans_buf_item_match(tp, mp->m_dev, &map, 1); if (bp != NULL) { ASSERT(bp->bp_transp == tp); - bip = bp->b_fspriv; + bip = bp->b_log_item; ASSERT(bip != NULL); bip->bli_recur++; return bp; @@ -590,7 +590,7 @@ libxfs_trans_getsb( #endif xfs_buf_item_init(bp, mp); - bip = bp->b_fspriv; + bip = bp->b_log_item; bip->bli_recur = 0; xfs_trans_add_item(tp, (xfs_log_item_t *)bip); @@ -629,8 +629,8 @@ libxfs_trans_read_buf_map( bp = xfs_trans_buf_item_match(tp, btp, map, nmaps); if (bp != NULL) { ASSERT(bp->bp_transp == tp); - ASSERT(bp->b_fspriv != NULL); - bip = bp->b_fspriv; + ASSERT(bp->b_log_item != NULL); + bip = bp->b_log_item; bip->bli_recur++; goto done; } @@ -647,7 +647,7 @@ libxfs_trans_read_buf_map( #endif xfs_buf_item_init(bp, tp->t_mountp); - bip = bp->b_fspriv; + bip = bp->b_log_item; bip->bli_recur = 0; xfs_trans_add_item(tp, (xfs_log_item_t *)bip); @@ -735,7 +735,7 @@ inode_item_done( return; } - bp->b_fspriv = iip; + bp->b_log_item = iip; error = libxfs_iflush_int(ip, bp); if (error) { fprintf(stderr, _("%s: warning - iflush_int failed (%d)\n"), @@ -744,7 +744,7 @@ inode_item_done( } ip->i_transp = NULL; /* disassociate from transaction */ - bp->b_fspriv = NULL; /* remove log item */ + bp->b_log_item = NULL; /* remove log item */ bp->b_transp = NULL; /* remove xact ptr */ libxfs_writebuf(bp, 0); #ifdef XACT_DEBUG @@ -763,7 +763,7 @@ buf_item_done( bp = bip->bli_buf; ASSERT(bp != NULL); - bp->b_fspriv = NULL; /* remove log item */ + bp->b_log_item = NULL; /* remove log item */ bp->b_transp = NULL; /* remove xact ptr */ hold = (bip->bli_flags & XFS_BLI_HOLD); diff --git a/libxfs/util.c b/libxfs/util.c index 5e06424ff3..2d3b721777 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -466,7 +466,7 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp) xfs_dinode_t *dip; xfs_mount_t *mp; - ASSERT(bp-b_fspriv != NULL); + ASSERT(bp-b_log_item != NULL); ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE || ip->i_d.di_nextents > ip->i_df.if_ext_max); ASSERT(ip->i_d.di_version > 1); diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index 89a2a94cec..86e3d3450c 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -586,8 +586,8 @@ static void xfs_agfl_write_verify( struct xfs_buf *bp) { - struct xfs_mount *mp = bp->b_target->bt_mount; - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_mount *mp = bp->b_target->bt_mount; + struct xfs_buf_log_item *bip = bp->b_log_item; xfs_failaddr_t fa; /* no verification of non-crc AGFLs */ @@ -2483,8 +2483,8 @@ static void xfs_agf_write_verify( struct xfs_buf *bp) { - struct xfs_mount *mp = bp->b_target->bt_mount; - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_mount *mp = bp->b_target->bt_mount; + struct xfs_buf_log_item *bip = bp->b_log_item; xfs_failaddr_t fa; fa = xfs_agf_verify(bp); diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c index d0bf4cf77e..c3682ebfaa 100644 --- a/libxfs/xfs_attr_leaf.c +++ b/libxfs/xfs_attr_leaf.c @@ -304,7 +304,7 @@ xfs_attr3_leaf_write_verify( struct xfs_buf *bp) { struct xfs_mount *mp = bp->b_target->bt_mount; - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; struct xfs_attr3_leaf_hdr *hdr3 = bp->b_addr; xfs_failaddr_t fa; diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c index 375c04f6e6..1ec9ce13d0 100644 --- a/libxfs/xfs_btree.c +++ b/libxfs/xfs_btree.c @@ -269,7 +269,7 @@ xfs_btree_lblock_calc_crc( struct xfs_buf *bp) { struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; if (!xfs_sb_version_hascrc(&bp->b_target->bt_mount->m_sb)) return; @@ -307,7 +307,7 @@ xfs_btree_sblock_calc_crc( struct xfs_buf *bp) { struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; if (!xfs_sb_version_hascrc(&bp->b_target->bt_mount->m_sb)) return; diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index b442d9a4b9..269edf9a26 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -177,7 +177,7 @@ xfs_da3_node_write_verify( struct xfs_buf *bp) { struct xfs_mount *mp = bp->b_target->bt_mount; - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; struct xfs_da3_node_hdr *hdr3 = bp->b_addr; xfs_failaddr_t fa; diff --git a/libxfs/xfs_dir2_block.c b/libxfs/xfs_dir2_block.c index f69561ebaf..e2c524ed75 100644 --- a/libxfs/xfs_dir2_block.c +++ b/libxfs/xfs_dir2_block.c @@ -99,7 +99,7 @@ xfs_dir3_block_write_verify( struct xfs_buf *bp) { struct xfs_mount *mp = bp->b_target->bt_mount; - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr; xfs_failaddr_t fa; diff --git a/libxfs/xfs_dir2_data.c b/libxfs/xfs_dir2_data.c index 175c119e4b..f78c7174bc 100644 --- a/libxfs/xfs_dir2_data.c +++ b/libxfs/xfs_dir2_data.c @@ -317,7 +317,7 @@ xfs_dir3_data_write_verify( struct xfs_buf *bp) { struct xfs_mount *mp = bp->b_target->bt_mount; - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr; xfs_failaddr_t fa; diff --git a/libxfs/xfs_dir2_leaf.c b/libxfs/xfs_dir2_leaf.c index ff2996be15..60f7eb29a9 100644 --- a/libxfs/xfs_dir2_leaf.c +++ b/libxfs/xfs_dir2_leaf.c @@ -205,7 +205,7 @@ __write_verify( uint16_t magic) { struct xfs_mount *mp = bp->b_target->bt_mount; - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; struct xfs_dir3_leaf_hdr *hdr3 = bp->b_addr; xfs_failaddr_t fa; diff --git a/libxfs/xfs_dir2_node.c b/libxfs/xfs_dir2_node.c index 399926457a..6d7986c996 100644 --- a/libxfs/xfs_dir2_node.c +++ b/libxfs/xfs_dir2_node.c @@ -138,7 +138,7 @@ xfs_dir3_free_write_verify( struct xfs_buf *bp) { struct xfs_mount *mp = bp->b_target->bt_mount; - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr; xfs_failaddr_t fa; diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c index e5b78027cd..4233d1ea86 100644 --- a/libxfs/xfs_ialloc.c +++ b/libxfs/xfs_ialloc.c @@ -2551,8 +2551,8 @@ static void xfs_agi_write_verify( struct xfs_buf *bp) { - struct xfs_mount *mp = bp->b_target->bt_mount; - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_mount *mp = bp->b_target->bt_mount; + struct xfs_buf_log_item *bip = bp->b_log_item; xfs_failaddr_t fa; fa = xfs_agi_verify(bp); diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c index bca65eeb66..e8dd4632cd 100644 --- a/libxfs/xfs_sb.c +++ b/libxfs/xfs_sb.c @@ -670,7 +670,7 @@ xfs_sb_write_verify( struct xfs_buf *bp) { struct xfs_mount *mp = bp->b_target->bt_mount; - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; int error; error = xfs_sb_verify(bp, false); diff --git a/libxfs/xfs_symlink_remote.c b/libxfs/xfs_symlink_remote.c index 4f920f1941..bcd85421c1 100644 --- a/libxfs/xfs_symlink_remote.c +++ b/libxfs/xfs_symlink_remote.c @@ -145,7 +145,7 @@ xfs_symlink_write_verify( struct xfs_buf *bp) { struct xfs_mount *mp = bp->b_target->bt_mount; - struct xfs_buf_log_item *bip = bp->b_fspriv; + struct xfs_buf_log_item *bip = bp->b_log_item; xfs_failaddr_t fa; /* no verification of non-crc buffers */ |