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>
This commit is contained in:
Carlos Maiolino 2018-01-24 13:38:48 -08:00 коммит произвёл Darrick J. Wong
Родитель 70a2065533
Коммит fb1755a645
18 изменённых файлов: 104 добавлений и 86 удалений

Просмотреть файл

@ -590,8 +590,8 @@ static void
xfs_agfl_write_verify( xfs_agfl_write_verify(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; 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; xfs_failaddr_t fa;
/* no verification of non-crc AGFLs */ /* no verification of non-crc AGFLs */
@ -2487,8 +2487,8 @@ static void
xfs_agf_write_verify( xfs_agf_write_verify(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; 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; xfs_failaddr_t fa;
fa = xfs_agf_verify(bp); fa = xfs_agf_verify(bp);

Просмотреть файл

@ -309,7 +309,7 @@ xfs_attr3_leaf_write_verify(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; 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; struct xfs_attr3_leaf_hdr *hdr3 = bp->b_addr;
xfs_failaddr_t fa; xfs_failaddr_t fa;

Просмотреть файл

@ -273,7 +273,7 @@ xfs_btree_lblock_calc_crc(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(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)) if (!xfs_sb_version_hascrc(&bp->b_target->bt_mount->m_sb))
return; return;
@ -311,7 +311,7 @@ xfs_btree_sblock_calc_crc(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(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)) if (!xfs_sb_version_hascrc(&bp->b_target->bt_mount->m_sb))
return; return;

Просмотреть файл

@ -182,7 +182,7 @@ xfs_da3_node_write_verify(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; 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; struct xfs_da3_node_hdr *hdr3 = bp->b_addr;
xfs_failaddr_t fa; xfs_failaddr_t fa;

Просмотреть файл

@ -103,7 +103,7 @@ xfs_dir3_block_write_verify(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; 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; struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr;
xfs_failaddr_t fa; xfs_failaddr_t fa;

Просмотреть файл

@ -320,7 +320,7 @@ xfs_dir3_data_write_verify(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; 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; struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr;
xfs_failaddr_t fa; xfs_failaddr_t fa;

Просмотреть файл

@ -208,7 +208,7 @@ __write_verify(
uint16_t magic) uint16_t magic)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; 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; struct xfs_dir3_leaf_hdr *hdr3 = bp->b_addr;
xfs_failaddr_t fa; xfs_failaddr_t fa;

Просмотреть файл

@ -141,7 +141,7 @@ xfs_dir3_free_write_verify(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; 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; struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr;
xfs_failaddr_t fa; xfs_failaddr_t fa;

Просмотреть файл

@ -2557,8 +2557,8 @@ static void
xfs_agi_write_verify( xfs_agi_write_verify(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; 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; xfs_failaddr_t fa;
fa = xfs_agi_verify(bp); fa = xfs_agi_verify(bp);

Просмотреть файл

@ -688,7 +688,7 @@ xfs_sb_write_verify(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; 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; int error;
error = xfs_sb_verify(bp, false); error = xfs_sb_verify(bp, false);

Просмотреть файл

@ -149,7 +149,7 @@ xfs_symlink_write_verify(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_mount *mp = bp->b_target->bt_mount; 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; xfs_failaddr_t fa;
/* no verification of non-crc buffers */ /* no verification of non-crc buffers */

Просмотреть файл

@ -176,7 +176,8 @@ typedef struct xfs_buf {
struct workqueue_struct *b_ioend_wq; /* I/O completion wq */ struct workqueue_struct *b_ioend_wq; /* I/O completion wq */
xfs_buf_iodone_t b_iodone; /* I/O completion function */ xfs_buf_iodone_t b_iodone; /* I/O completion function */
struct completion b_iowait; /* queue for I/O waiters */ struct completion b_iowait; /* queue for I/O waiters */
void *b_fspriv; void *b_log_item;
struct xfs_log_item *b_li_list;
struct xfs_trans *b_transp; struct xfs_trans *b_transp;
struct page **b_pages; /* array of page pointers */ struct page **b_pages; /* array of page pointers */
struct page *b_page_array[XB_PAGES]; /* inline pages */ struct page *b_page_array[XB_PAGES]; /* inline pages */

Просмотреть файл

@ -411,7 +411,7 @@ xfs_buf_item_unpin(
int stale = bip->bli_flags & XFS_BLI_STALE; int stale = bip->bli_flags & XFS_BLI_STALE;
int freed; int freed;
ASSERT(bp->b_fspriv == bip); ASSERT(bp->b_log_item == bip);
ASSERT(atomic_read(&bip->bli_refcount) > 0); ASSERT(atomic_read(&bip->bli_refcount) > 0);
trace_xfs_buf_item_unpin(bip); trace_xfs_buf_item_unpin(bip);
@ -456,13 +456,14 @@ xfs_buf_item_unpin(
*/ */
if (bip->bli_flags & XFS_BLI_STALE_INODE) { if (bip->bli_flags & XFS_BLI_STALE_INODE) {
xfs_buf_do_callbacks(bp); xfs_buf_do_callbacks(bp);
bp->b_fspriv = NULL; bp->b_log_item = NULL;
bp->b_li_list = NULL;
bp->b_iodone = NULL; bp->b_iodone = NULL;
} else { } else {
spin_lock(&ailp->xa_lock); spin_lock(&ailp->xa_lock);
xfs_trans_ail_delete(ailp, lip, SHUTDOWN_LOG_IO_ERROR); xfs_trans_ail_delete(ailp, lip, SHUTDOWN_LOG_IO_ERROR);
xfs_buf_item_relse(bp); xfs_buf_item_relse(bp);
ASSERT(bp->b_fspriv == NULL); ASSERT(bp->b_log_item == NULL);
} }
xfs_buf_relse(bp); xfs_buf_relse(bp);
} else if (freed && remove) { } else if (freed && remove) {
@ -722,18 +723,15 @@ xfs_buf_item_free_format(
/* /*
* Allocate a new buf log item to go with the given buffer. * 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 * buf log item.
* buffer (see xfs_buf_attach_iodone() below), then put the
* buf log item at the front.
*/ */
int int
xfs_buf_item_init( xfs_buf_item_init(
struct xfs_buf *bp, struct xfs_buf *bp,
struct xfs_mount *mp) struct xfs_mount *mp)
{ {
struct xfs_log_item *lip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_log_item;
struct xfs_buf_log_item *bip;
int chunks; int chunks;
int map_size; int map_size;
int error; int error;
@ -741,13 +739,14 @@ xfs_buf_item_init(
/* /*
* Check to see if there is already a buf log item for * Check to see if there is already a buf log item for
* this buffer. If there is, it is guaranteed to be * this buffer. If we do already have one, there is
* the first. If we do already have one, there is
* nothing to do here so return. * nothing to do here so return.
*/ */
ASSERT(bp->b_target->bt_mount == mp); ASSERT(bp->b_target->bt_mount == mp);
if (lip != NULL && lip->li_type == XFS_LI_BUF) if (bip != NULL) {
ASSERT(bip->bli_item.li_type == XFS_LI_BUF);
return 0; return 0;
}
bip = kmem_zone_zalloc(xfs_buf_item_zone, KM_SLEEP); bip = kmem_zone_zalloc(xfs_buf_item_zone, KM_SLEEP);
xfs_log_item_init(mp, &bip->bli_item, XFS_LI_BUF, &xfs_buf_item_ops); xfs_log_item_init(mp, &bip->bli_item, XFS_LI_BUF, &xfs_buf_item_ops);
@ -781,13 +780,7 @@ xfs_buf_item_init(
bip->bli_formats[i].blf_map_size = map_size; bip->bli_formats[i].blf_map_size = map_size;
} }
/* bp->b_log_item = bip;
* Put the buf item into the list of items attached to the
* buffer at the front.
*/
if (bp->b_fspriv)
bip->bli_item.li_bio_list = bp->b_fspriv;
bp->b_fspriv = bip;
xfs_buf_hold(bp); xfs_buf_hold(bp);
return 0; return 0;
} }
@ -961,13 +954,14 @@ void
xfs_buf_item_relse( xfs_buf_item_relse(
xfs_buf_t *bp) xfs_buf_t *bp)
{ {
struct xfs_buf_log_item *bip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_log_item;
struct xfs_log_item *lip = bp->b_li_list;
trace_xfs_buf_item_relse(bp, _RET_IP_); trace_xfs_buf_item_relse(bp, _RET_IP_);
ASSERT(!(bip->bli_item.li_flags & XFS_LI_IN_AIL)); ASSERT(!(bip->bli_item.li_flags & XFS_LI_IN_AIL));
bp->b_fspriv = bip->bli_item.li_bio_list; bp->b_log_item = NULL;
if (bp->b_fspriv == NULL) if (lip == NULL)
bp->b_iodone = NULL; bp->b_iodone = NULL;
xfs_buf_rele(bp); xfs_buf_rele(bp);
@ -980,9 +974,7 @@ xfs_buf_item_relse(
* to be called when the buffer's I/O completes. If it is not set * to be called when the buffer's I/O completes. If it is not set
* already, set the buffer's b_iodone() routine to be * already, set the buffer's b_iodone() routine to be
* xfs_buf_iodone_callbacks() and link the log item into the list of * xfs_buf_iodone_callbacks() and link the log item into the list of
* items rooted at b_fsprivate. Items are always added as the second * items rooted at b_li_list.
* entry in the list if there is a first, because the buf item code
* assumes that the buf log item is first.
*/ */
void void
xfs_buf_attach_iodone( xfs_buf_attach_iodone(
@ -995,12 +987,12 @@ xfs_buf_attach_iodone(
ASSERT(xfs_buf_islocked(bp)); ASSERT(xfs_buf_islocked(bp));
lip->li_cb = cb; lip->li_cb = cb;
head_lip = bp->b_fspriv; head_lip = bp->b_li_list;
if (head_lip) { if (head_lip) {
lip->li_bio_list = head_lip->li_bio_list; lip->li_bio_list = head_lip->li_bio_list;
head_lip->li_bio_list = lip; head_lip->li_bio_list = lip;
} else { } else {
bp->b_fspriv = lip; bp->b_li_list = lip;
} }
ASSERT(bp->b_iodone == NULL || ASSERT(bp->b_iodone == NULL ||
@ -1024,10 +1016,17 @@ STATIC void
xfs_buf_do_callbacks( xfs_buf_do_callbacks(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_buf_log_item *blip = bp->b_log_item;
struct xfs_log_item *lip; struct xfs_log_item *lip;
while ((lip = bp->b_fspriv) != NULL) { /* If there is a buf_log_item attached, run its callback */
bp->b_fspriv = lip->li_bio_list; if (blip) {
lip = &blip->bli_item;
lip->li_cb(bp, lip);
}
while ((lip = bp->b_li_list) != NULL) {
bp->b_li_list = lip->li_bio_list;
ASSERT(lip->li_cb != NULL); ASSERT(lip->li_cb != NULL);
/* /*
* Clear the next pointer so we don't have any * Clear the next pointer so we don't have any
@ -1052,10 +1051,19 @@ STATIC void
xfs_buf_do_callbacks_fail( xfs_buf_do_callbacks_fail(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_log_item *lip = bp->b_li_list;
struct xfs_log_item *next; struct xfs_log_item *next;
struct xfs_log_item *lip = bp->b_fspriv; struct xfs_ail *ailp;
struct xfs_ail *ailp = lip->li_ailp;
/*
* Buffer log item errors are handled directly by xfs_buf_item_push()
* and xfs_buf_iodone_callback_error, and they have no IO error
* callbacks. Check only for items in b_li_list.
*/
if (lip == NULL)
return;
ailp = lip->li_ailp;
spin_lock(&ailp->xa_lock); spin_lock(&ailp->xa_lock);
for (; lip; lip = next) { for (; lip; lip = next) {
next = lip->li_bio_list; next = lip->li_bio_list;
@ -1069,12 +1077,20 @@ static bool
xfs_buf_iodone_callback_error( xfs_buf_iodone_callback_error(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xfs_log_item *lip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_log_item;
struct xfs_mount *mp = lip->li_mountp; struct xfs_log_item *lip = bp->b_li_list;
struct xfs_mount *mp;
static ulong lasttime; static ulong lasttime;
static xfs_buftarg_t *lasttarg; static xfs_buftarg_t *lasttarg;
struct xfs_error_cfg *cfg; struct xfs_error_cfg *cfg;
/*
* The failed buffer might not have a buf_log_item attached or the
* log_item list might be empty. Get the mp from the available
* xfs_log_item
*/
mp = bip ? bip->bli_item.li_mountp : lip->li_mountp;
/* /*
* If we've already decided to shutdown the filesystem because of * If we've already decided to shutdown the filesystem because of
* I/O errors, there's no point in giving this a retry. * I/O errors, there's no point in giving this a retry.
@ -1183,7 +1199,8 @@ xfs_buf_iodone_callbacks(
bp->b_first_retry_time = 0; bp->b_first_retry_time = 0;
xfs_buf_do_callbacks(bp); xfs_buf_do_callbacks(bp);
bp->b_fspriv = NULL; bp->b_log_item = NULL;
bp->b_li_list = NULL;
bp->b_iodone = NULL; bp->b_iodone = NULL;
xfs_buf_ioend(bp); xfs_buf_ioend(bp);
} }

Просмотреть файл

@ -2272,7 +2272,7 @@ xfs_ifree_cluster(
* stale first, we will not attempt to lock them in the loop * stale first, we will not attempt to lock them in the loop
* below as the XFS_ISTALE flag will be set. * below as the XFS_ISTALE flag will be set.
*/ */
lip = bp->b_fspriv; lip = bp->b_li_list;
while (lip) { while (lip) {
if (lip->li_type == XFS_LI_INODE) { if (lip->li_type == XFS_LI_INODE) {
iip = (xfs_inode_log_item_t *)lip; iip = (xfs_inode_log_item_t *)lip;
@ -3649,7 +3649,7 @@ xfs_iflush_int(
/* generate the checksum. */ /* generate the checksum. */
xfs_dinode_calc_crc(mp, dip); xfs_dinode_calc_crc(mp, dip);
ASSERT(bp->b_fspriv != NULL); ASSERT(bp->b_li_list != NULL);
ASSERT(bp->b_iodone != NULL); ASSERT(bp->b_iodone != NULL);
return 0; return 0;

Просмотреть файл

@ -722,7 +722,7 @@ xfs_iflush_done(
* Scan the buffer IO completions for other inodes being completed and * Scan the buffer IO completions for other inodes being completed and
* attach them to the current inode log item. * attach them to the current inode log item.
*/ */
blip = bp->b_fspriv; blip = bp->b_li_list;
prev = NULL; prev = NULL;
while (blip != NULL) { while (blip != NULL) {
if (blip->li_cb != xfs_iflush_done) { if (blip->li_cb != xfs_iflush_done) {
@ -734,7 +734,7 @@ xfs_iflush_done(
/* remove from list */ /* remove from list */
next = blip->li_bio_list; next = blip->li_bio_list;
if (!prev) { if (!prev) {
bp->b_fspriv = next; bp->b_li_list = next;
} else { } else {
prev->li_bio_list = next; prev->li_bio_list = next;
} }

Просмотреть файл

@ -1242,7 +1242,7 @@ xlog_space_left(
static void static void
xlog_iodone(xfs_buf_t *bp) xlog_iodone(xfs_buf_t *bp)
{ {
struct xlog_in_core *iclog = bp->b_fspriv; struct xlog_in_core *iclog = bp->b_log_item;
struct xlog *l = iclog->ic_log; struct xlog *l = iclog->ic_log;
int aborted = 0; int aborted = 0;
@ -1773,7 +1773,7 @@ STATIC int
xlog_bdstrat( xlog_bdstrat(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
struct xlog_in_core *iclog = bp->b_fspriv; struct xlog_in_core *iclog = bp->b_log_item;
xfs_buf_lock(bp); xfs_buf_lock(bp);
if (iclog->ic_state & XLOG_STATE_IOERROR) { if (iclog->ic_state & XLOG_STATE_IOERROR) {
@ -1919,7 +1919,7 @@ xlog_sync(
} }
bp->b_io_length = BTOBB(count); bp->b_io_length = BTOBB(count);
bp->b_fspriv = iclog; bp->b_log_item = iclog;
bp->b_flags &= ~XBF_FLUSH; bp->b_flags &= ~XBF_FLUSH;
bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE | XBF_FUA); bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE | XBF_FUA);
@ -1958,7 +1958,7 @@ xlog_sync(
XFS_BUF_SET_ADDR(bp, 0); /* logical 0 */ XFS_BUF_SET_ADDR(bp, 0); /* logical 0 */
xfs_buf_associate_memory(bp, xfs_buf_associate_memory(bp,
(char *)&iclog->ic_header + count, split); (char *)&iclog->ic_header + count, split);
bp->b_fspriv = iclog; bp->b_log_item = iclog;
bp->b_flags &= ~XBF_FLUSH; bp->b_flags &= ~XBF_FLUSH;
bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE | XBF_FUA); bp->b_flags |= (XBF_ASYNC | XBF_SYNCIO | XBF_WRITE | XBF_FUA);

Просмотреть файл

@ -400,9 +400,9 @@ xlog_recover_iodone(
* On v5 supers, a bli could be attached to update the metadata LSN. * On v5 supers, a bli could be attached to update the metadata LSN.
* Clean it up. * Clean it up.
*/ */
if (bp->b_fspriv) if (bp->b_log_item)
xfs_buf_item_relse(bp); xfs_buf_item_relse(bp);
ASSERT(bp->b_fspriv == NULL); ASSERT(bp->b_log_item == NULL);
bp->b_iodone = NULL; bp->b_iodone = NULL;
xfs_buf_ioend(bp); xfs_buf_ioend(bp);
@ -2630,7 +2630,7 @@ xlog_recover_validate_buf_type(
ASSERT(!bp->b_iodone || bp->b_iodone == xlog_recover_iodone); ASSERT(!bp->b_iodone || bp->b_iodone == xlog_recover_iodone);
bp->b_iodone = xlog_recover_iodone; bp->b_iodone = xlog_recover_iodone;
xfs_buf_item_init(bp, mp); xfs_buf_item_init(bp, mp);
bip = bp->b_fspriv; bip = bp->b_log_item;
bip->bli_item.li_lsn = current_lsn; bip->bli_item.li_lsn = current_lsn;
} }
} }

Просмотреть файл

@ -82,12 +82,12 @@ _xfs_trans_bjoin(
ASSERT(bp->b_transp == NULL); ASSERT(bp->b_transp == NULL);
/* /*
* The xfs_buf_log_item pointer is stored in b_fsprivate. If * The xfs_buf_log_item pointer is stored in b_log_item. If
* it doesn't have one yet, then allocate one and initialize it. * it doesn't have one yet, then allocate one and initialize it.
* The checks to see if one is there are in xfs_buf_item_init(). * The checks to see if one is there are in xfs_buf_item_init().
*/ */
xfs_buf_item_init(bp, tp->t_mountp); xfs_buf_item_init(bp, tp->t_mountp);
bip = bp->b_fspriv; bip = bp->b_log_item;
ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); ASSERT(!(bip->bli_flags & XFS_BLI_STALE));
ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_CANCEL)); ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_CANCEL));
ASSERT(!(bip->bli_flags & XFS_BLI_LOGGED)); ASSERT(!(bip->bli_flags & XFS_BLI_LOGGED));
@ -118,7 +118,7 @@ xfs_trans_bjoin(
struct xfs_buf *bp) struct xfs_buf *bp)
{ {
_xfs_trans_bjoin(tp, bp, 0); _xfs_trans_bjoin(tp, bp, 0);
trace_xfs_trans_bjoin(bp->b_fspriv); trace_xfs_trans_bjoin(bp->b_log_item);
} }
/* /*
@ -159,7 +159,7 @@ xfs_trans_get_buf_map(
} }
ASSERT(bp->b_transp == tp); ASSERT(bp->b_transp == tp);
bip = bp->b_fspriv; bip = bp->b_log_item;
ASSERT(bip != NULL); ASSERT(bip != NULL);
ASSERT(atomic_read(&bip->bli_refcount) > 0); ASSERT(atomic_read(&bip->bli_refcount) > 0);
bip->bli_recur++; bip->bli_recur++;
@ -175,7 +175,7 @@ xfs_trans_get_buf_map(
ASSERT(!bp->b_error); ASSERT(!bp->b_error);
_xfs_trans_bjoin(tp, bp, 1); _xfs_trans_bjoin(tp, bp, 1);
trace_xfs_trans_get_buf(bp->b_fspriv); trace_xfs_trans_get_buf(bp->b_log_item);
return bp; return bp;
} }
@ -211,7 +211,7 @@ xfs_trans_getsb(
*/ */
bp = mp->m_sb_bp; bp = mp->m_sb_bp;
if (bp->b_transp == tp) { if (bp->b_transp == tp) {
bip = bp->b_fspriv; bip = bp->b_log_item;
ASSERT(bip != NULL); ASSERT(bip != NULL);
ASSERT(atomic_read(&bip->bli_refcount) > 0); ASSERT(atomic_read(&bip->bli_refcount) > 0);
bip->bli_recur++; bip->bli_recur++;
@ -224,7 +224,7 @@ xfs_trans_getsb(
return NULL; return NULL;
_xfs_trans_bjoin(tp, bp, 1); _xfs_trans_bjoin(tp, bp, 1);
trace_xfs_trans_getsb(bp->b_fspriv); trace_xfs_trans_getsb(bp->b_log_item);
return bp; return bp;
} }
@ -267,7 +267,7 @@ xfs_trans_read_buf_map(
if (bp) { if (bp) {
ASSERT(xfs_buf_islocked(bp)); ASSERT(xfs_buf_islocked(bp));
ASSERT(bp->b_transp == tp); ASSERT(bp->b_transp == tp);
ASSERT(bp->b_fspriv != NULL); ASSERT(bp->b_log_item != NULL);
ASSERT(!bp->b_error); ASSERT(!bp->b_error);
ASSERT(bp->b_flags & XBF_DONE); ASSERT(bp->b_flags & XBF_DONE);
@ -280,7 +280,7 @@ xfs_trans_read_buf_map(
return -EIO; return -EIO;
} }
bip = bp->b_fspriv; bip = bp->b_log_item;
bip->bli_recur++; bip->bli_recur++;
ASSERT(atomic_read(&bip->bli_refcount) > 0); ASSERT(atomic_read(&bip->bli_refcount) > 0);
@ -330,7 +330,7 @@ xfs_trans_read_buf_map(
if (tp) { if (tp) {
_xfs_trans_bjoin(tp, bp, 1); _xfs_trans_bjoin(tp, bp, 1);
trace_xfs_trans_read_buf(bp->b_fspriv); trace_xfs_trans_read_buf(bp->b_log_item);
} }
*bpp = bp; *bpp = bp;
return 0; return 0;
@ -370,7 +370,7 @@ xfs_trans_brelse(
} }
ASSERT(bp->b_transp == tp); ASSERT(bp->b_transp == tp);
bip = bp->b_fspriv; bip = bp->b_log_item;
ASSERT(bip->bli_item.li_type == XFS_LI_BUF); ASSERT(bip->bli_item.li_type == XFS_LI_BUF);
ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); ASSERT(!(bip->bli_flags & XFS_BLI_STALE));
ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_CANCEL)); ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_CANCEL));
@ -462,7 +462,7 @@ xfs_trans_bhold(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_buf_t *bp) xfs_buf_t *bp)
{ {
struct xfs_buf_log_item *bip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_log_item;
ASSERT(bp->b_transp == tp); ASSERT(bp->b_transp == tp);
ASSERT(bip != NULL); ASSERT(bip != NULL);
@ -483,7 +483,7 @@ xfs_trans_bhold_release(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_buf_t *bp) xfs_buf_t *bp)
{ {
struct xfs_buf_log_item *bip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_log_item;
ASSERT(bp->b_transp == tp); ASSERT(bp->b_transp == tp);
ASSERT(bip != NULL); ASSERT(bip != NULL);
@ -504,7 +504,7 @@ xfs_trans_dirty_buf(
struct xfs_trans *tp, struct xfs_trans *tp,
struct xfs_buf *bp) 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->b_transp == tp); ASSERT(bp->b_transp == tp);
ASSERT(bip != NULL); ASSERT(bip != NULL);
@ -561,7 +561,7 @@ xfs_trans_log_buf(
uint first, uint first,
uint last) 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 < BBTOB(bp->b_length)); ASSERT(first <= last && last < BBTOB(bp->b_length));
ASSERT(!(bip->bli_flags & XFS_BLI_ORDERED)); ASSERT(!(bip->bli_flags & XFS_BLI_ORDERED));
@ -607,7 +607,7 @@ xfs_trans_binval(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_buf_t *bp) xfs_buf_t *bp)
{ {
struct xfs_buf_log_item *bip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_log_item;
int i; int i;
ASSERT(bp->b_transp == tp); ASSERT(bp->b_transp == tp);
@ -662,7 +662,7 @@ xfs_trans_inode_buf(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_buf_t *bp) xfs_buf_t *bp)
{ {
struct xfs_buf_log_item *bip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_log_item;
ASSERT(bp->b_transp == tp); ASSERT(bp->b_transp == tp);
ASSERT(bip != NULL); ASSERT(bip != NULL);
@ -686,7 +686,7 @@ xfs_trans_stale_inode_buf(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_buf_t *bp) xfs_buf_t *bp)
{ {
struct xfs_buf_log_item *bip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_log_item;
ASSERT(bp->b_transp == tp); ASSERT(bp->b_transp == tp);
ASSERT(bip != NULL); ASSERT(bip != NULL);
@ -711,7 +711,7 @@ xfs_trans_inode_alloc_buf(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_buf_t *bp) xfs_buf_t *bp)
{ {
struct xfs_buf_log_item *bip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_log_item;
ASSERT(bp->b_transp == tp); ASSERT(bp->b_transp == tp);
ASSERT(bip != NULL); ASSERT(bip != NULL);
@ -733,7 +733,7 @@ xfs_trans_ordered_buf(
struct xfs_trans *tp, struct xfs_trans *tp,
struct xfs_buf *bp) 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->b_transp == tp); ASSERT(bp->b_transp == tp);
ASSERT(bip != NULL); ASSERT(bip != NULL);
@ -763,7 +763,7 @@ xfs_trans_buf_set_type(
struct xfs_buf *bp, struct xfs_buf *bp,
enum xfs_blft type) enum xfs_blft type)
{ {
struct xfs_buf_log_item *bip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_log_item;
if (!tp) if (!tp)
return; return;
@ -780,8 +780,8 @@ xfs_trans_buf_copy_type(
struct xfs_buf *dst_bp, struct xfs_buf *dst_bp,
struct xfs_buf *src_bp) struct xfs_buf *src_bp)
{ {
struct xfs_buf_log_item *sbip = src_bp->b_fspriv; struct xfs_buf_log_item *sbip = src_bp->b_log_item;
struct xfs_buf_log_item *dbip = dst_bp->b_fspriv; struct xfs_buf_log_item *dbip = dst_bp->b_log_item;
enum xfs_blft type; enum xfs_blft type;
type = xfs_blft_from_flags(&sbip->__bli_format); type = xfs_blft_from_flags(&sbip->__bli_format);
@ -805,7 +805,7 @@ xfs_trans_dquot_buf(
xfs_buf_t *bp, xfs_buf_t *bp,
uint type) uint type)
{ {
struct xfs_buf_log_item *bip = bp->b_fspriv; struct xfs_buf_log_item *bip = bp->b_log_item;
ASSERT(type == XFS_BLF_UDQUOT_BUF || ASSERT(type == XFS_BLF_UDQUOT_BUF ||
type == XFS_BLF_PDQUOT_BUF || type == XFS_BLF_PDQUOT_BUF ||