aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_buf_item.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_buf_item.c')
-rw-r--r--fs/xfs/xfs_buf_item.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 65b32acfa0f6..7dcaec54a20b 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -5,19 +5,17 @@
5 */ 5 */
6#include "xfs.h" 6#include "xfs.h"
7#include "xfs_fs.h" 7#include "xfs_fs.h"
8#include "xfs_shared.h"
8#include "xfs_format.h" 9#include "xfs_format.h"
9#include "xfs_log_format.h" 10#include "xfs_log_format.h"
10#include "xfs_trans_resv.h" 11#include "xfs_trans_resv.h"
11#include "xfs_bit.h" 12#include "xfs_bit.h"
12#include "xfs_sb.h"
13#include "xfs_mount.h" 13#include "xfs_mount.h"
14#include "xfs_trans.h" 14#include "xfs_trans.h"
15#include "xfs_buf_item.h" 15#include "xfs_buf_item.h"
16#include "xfs_trans_priv.h" 16#include "xfs_trans_priv.h"
17#include "xfs_error.h"
18#include "xfs_trace.h" 17#include "xfs_trace.h"
19#include "xfs_log.h" 18#include "xfs_log.h"
20#include "xfs_inode.h"
21 19
22 20
23kmem_zone_t *xfs_buf_item_zone; 21kmem_zone_t *xfs_buf_item_zone;
@@ -520,7 +518,7 @@ xfs_buf_item_push(
520 /* has a previous flush failed due to IO errors? */ 518 /* has a previous flush failed due to IO errors? */
521 if ((bp->b_flags & XBF_WRITE_FAIL) && 519 if ((bp->b_flags & XBF_WRITE_FAIL) &&
522 ___ratelimit(&xfs_buf_write_fail_rl_state, "XFS: Failing async write")) { 520 ___ratelimit(&xfs_buf_write_fail_rl_state, "XFS: Failing async write")) {
523 xfs_warn(bp->b_target->bt_mount, 521 xfs_warn(bp->b_mount,
524"Failing async write on buffer block 0x%llx. Retrying async write.", 522"Failing async write on buffer block 0x%llx. Retrying async write.",
525 (long long)bp->b_bn); 523 (long long)bp->b_bn);
526 } 524 }
@@ -594,7 +592,7 @@ xfs_buf_item_put(
594 * free the item. 592 * free the item.
595 */ 593 */
596STATIC void 594STATIC void
597xfs_buf_item_unlock( 595xfs_buf_item_release(
598 struct xfs_log_item *lip) 596 struct xfs_log_item *lip)
599{ 597{
600 struct xfs_buf_log_item *bip = BUF_ITEM(lip); 598 struct xfs_buf_log_item *bip = BUF_ITEM(lip);
@@ -609,7 +607,7 @@ xfs_buf_item_unlock(
609 &lip->li_flags); 607 &lip->li_flags);
610#endif 608#endif
611 609
612 trace_xfs_buf_item_unlock(bip); 610 trace_xfs_buf_item_release(bip);
613 611
614 /* 612 /*
615 * The bli dirty state should match whether the blf has logged segments 613 * The bli dirty state should match whether the blf has logged segments
@@ -639,6 +637,14 @@ xfs_buf_item_unlock(
639 xfs_buf_relse(bp); 637 xfs_buf_relse(bp);
640} 638}
641 639
640STATIC void
641xfs_buf_item_committing(
642 struct xfs_log_item *lip,
643 xfs_lsn_t commit_lsn)
644{
645 return xfs_buf_item_release(lip);
646}
647
642/* 648/*
643 * This is called to find out where the oldest active copy of the 649 * This is called to find out where the oldest active copy of the
644 * buf log item in the on disk log resides now that the last log 650 * buf log item in the on disk log resides now that the last log
@@ -671,25 +677,15 @@ xfs_buf_item_committed(
671 return lsn; 677 return lsn;
672} 678}
673 679
674STATIC void
675xfs_buf_item_committing(
676 struct xfs_log_item *lip,
677 xfs_lsn_t commit_lsn)
678{
679}
680
681/*
682 * This is the ops vector shared by all buf log items.
683 */
684static const struct xfs_item_ops xfs_buf_item_ops = { 680static const struct xfs_item_ops xfs_buf_item_ops = {
685 .iop_size = xfs_buf_item_size, 681 .iop_size = xfs_buf_item_size,
686 .iop_format = xfs_buf_item_format, 682 .iop_format = xfs_buf_item_format,
687 .iop_pin = xfs_buf_item_pin, 683 .iop_pin = xfs_buf_item_pin,
688 .iop_unpin = xfs_buf_item_unpin, 684 .iop_unpin = xfs_buf_item_unpin,
689 .iop_unlock = xfs_buf_item_unlock, 685 .iop_release = xfs_buf_item_release,
686 .iop_committing = xfs_buf_item_committing,
690 .iop_committed = xfs_buf_item_committed, 687 .iop_committed = xfs_buf_item_committed,
691 .iop_push = xfs_buf_item_push, 688 .iop_push = xfs_buf_item_push,
692 .iop_committing = xfs_buf_item_committing
693}; 689};
694 690
695STATIC int 691STATIC int
@@ -743,7 +739,7 @@ xfs_buf_item_init(
743 * this buffer. If we do already have one, there is 739 * this buffer. If we do already have one, there is
744 * nothing to do here so return. 740 * nothing to do here so return.
745 */ 741 */
746 ASSERT(bp->b_target->bt_mount == mp); 742 ASSERT(bp->b_mount == mp);
747 if (bip) { 743 if (bip) {
748 ASSERT(bip->bli_item.li_type == XFS_LI_BUF); 744 ASSERT(bip->bli_item.li_type == XFS_LI_BUF);
749 ASSERT(!bp->b_transp); 745 ASSERT(!bp->b_transp);
@@ -980,9 +976,9 @@ xfs_buf_item_relse(
980 */ 976 */
981void 977void
982xfs_buf_attach_iodone( 978xfs_buf_attach_iodone(
983 xfs_buf_t *bp, 979 struct xfs_buf *bp,
984 void (*cb)(xfs_buf_t *, xfs_log_item_t *), 980 void (*cb)(struct xfs_buf *, struct xfs_log_item *),
985 xfs_log_item_t *lip) 981 struct xfs_log_item *lip)
986{ 982{
987 ASSERT(xfs_buf_islocked(bp)); 983 ASSERT(xfs_buf_islocked(bp));
988 984