aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-08-28 07:12:03 -0400
committerBen Myers <bpm@sgi.com>2013-08-30 15:14:35 -0400
commit904c17e6832845cc651a4d5108a7d57eacdb61f7 (patch)
tree3ff65a6349ccea7752f4beb06ce438625b3e2b72 /fs/xfs
parent239567033c38933c4d6f402f9f8a2126df73e4c6 (diff)
xfs: finish removing IOP_* macros.
In optimising the CIL operations, some of the IOP_* macros for calling log item operations were removed. Remove the rest of them as Christoph requested. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Geoffrey Wehrman <gwehrman@sgi.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_trans.c23
-rw-r--r--fs/xfs/xfs_trans.h8
-rw-r--r--fs/xfs/xfs_trans_ail.c4
-rw-r--r--fs/xfs/xfs_trans_buf.c2
4 files changed, 17 insertions, 20 deletions
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index b986400ea728..5411e01ab452 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -716,10 +716,10 @@ xfs_trans_free_items(
716 lip->li_desc = NULL; 716 lip->li_desc = NULL;
717 717
718 if (commit_lsn != NULLCOMMITLSN) 718 if (commit_lsn != NULLCOMMITLSN)
719 IOP_COMMITTING(lip, commit_lsn); 719 lip->li_ops->iop_committing(lip, commit_lsn);
720 if (flags & XFS_TRANS_ABORT) 720 if (flags & XFS_TRANS_ABORT)
721 lip->li_flags |= XFS_LI_ABORTED; 721 lip->li_flags |= XFS_LI_ABORTED;
722 IOP_UNLOCK(lip); 722 lip->li_ops->iop_unlock(lip);
723 723
724 xfs_trans_free_item_desc(lidp); 724 xfs_trans_free_item_desc(lidp);
725 } 725 }
@@ -739,8 +739,11 @@ xfs_log_item_batch_insert(
739 /* xfs_trans_ail_update_bulk drops ailp->xa_lock */ 739 /* xfs_trans_ail_update_bulk drops ailp->xa_lock */
740 xfs_trans_ail_update_bulk(ailp, cur, log_items, nr_items, commit_lsn); 740 xfs_trans_ail_update_bulk(ailp, cur, log_items, nr_items, commit_lsn);
741 741
742 for (i = 0; i < nr_items; i++) 742 for (i = 0; i < nr_items; i++) {
743 IOP_UNPIN(log_items[i], 0); 743 struct xfs_log_item *lip = log_items[i];
744
745 lip->li_ops->iop_unpin(lip, 0);
746 }
744} 747}
745 748
746/* 749/*
@@ -750,11 +753,11 @@ xfs_log_item_batch_insert(
750 * 753 *
751 * If we are called with the aborted flag set, it is because a log write during 754 * If we are called with the aborted flag set, it is because a log write during
752 * a CIL checkpoint commit has failed. In this case, all the items in the 755 * a CIL checkpoint commit has failed. In this case, all the items in the
753 * checkpoint have already gone through IOP_COMMITED and IOP_UNLOCK, which 756 * checkpoint have already gone through iop_commited and iop_unlock, which
754 * means that checkpoint commit abort handling is treated exactly the same 757 * means that checkpoint commit abort handling is treated exactly the same
755 * as an iclog write error even though we haven't started any IO yet. Hence in 758 * as an iclog write error even though we haven't started any IO yet. Hence in
756 * this case all we need to do is IOP_COMMITTED processing, followed by an 759 * this case all we need to do is iop_committed processing, followed by an
757 * IOP_UNPIN(aborted) call. 760 * iop_unpin(aborted) call.
758 * 761 *
759 * The AIL cursor is used to optimise the insert process. If commit_lsn is not 762 * The AIL cursor is used to optimise the insert process. If commit_lsn is not
760 * at the end of the AIL, the insert cursor avoids the need to walk 763 * at the end of the AIL, the insert cursor avoids the need to walk
@@ -787,7 +790,7 @@ xfs_trans_committed_bulk(
787 790
788 if (aborted) 791 if (aborted)
789 lip->li_flags |= XFS_LI_ABORTED; 792 lip->li_flags |= XFS_LI_ABORTED;
790 item_lsn = IOP_COMMITTED(lip, commit_lsn); 793 item_lsn = lip->li_ops->iop_committed(lip, commit_lsn);
791 794
792 /* item_lsn of -1 means the item needs no further processing */ 795 /* item_lsn of -1 means the item needs no further processing */
793 if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0) 796 if (XFS_LSN_CMP(item_lsn, (xfs_lsn_t)-1) == 0)
@@ -799,7 +802,7 @@ xfs_trans_committed_bulk(
799 */ 802 */
800 if (aborted) { 803 if (aborted) {
801 ASSERT(XFS_FORCED_SHUTDOWN(ailp->xa_mount)); 804 ASSERT(XFS_FORCED_SHUTDOWN(ailp->xa_mount));
802 IOP_UNPIN(lip, 1); 805 lip->li_ops->iop_unpin(lip, 1);
803 continue; 806 continue;
804 } 807 }
805 808
@@ -817,7 +820,7 @@ xfs_trans_committed_bulk(
817 xfs_trans_ail_update(ailp, lip, item_lsn); 820 xfs_trans_ail_update(ailp, lip, item_lsn);
818 else 821 else
819 spin_unlock(&ailp->xa_lock); 822 spin_unlock(&ailp->xa_lock);
820 IOP_UNPIN(lip, 0); 823 lip->li_ops->iop_unpin(lip, 0);
821 continue; 824 continue;
822 } 825 }
823 826
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index 4786170baeb0..09cf40b89e8c 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -77,14 +77,8 @@ struct xfs_item_ops {
77 void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t); 77 void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t);
78}; 78};
79 79
80#define IOP_UNPIN(ip, remove) (*(ip)->li_ops->iop_unpin)(ip, remove)
81#define IOP_PUSH(ip, list) (*(ip)->li_ops->iop_push)(ip, list)
82#define IOP_UNLOCK(ip) (*(ip)->li_ops->iop_unlock)(ip)
83#define IOP_COMMITTED(ip, lsn) (*(ip)->li_ops->iop_committed)(ip, lsn)
84#define IOP_COMMITTING(ip, lsn) (*(ip)->li_ops->iop_committing)(ip, lsn)
85
86/* 80/*
87 * Return values for the IOP_PUSH() routines. 81 * Return values for the iop_push() routines.
88 */ 82 */
89#define XFS_ITEM_SUCCESS 0 83#define XFS_ITEM_SUCCESS 0
90#define XFS_ITEM_PINNED 1 84#define XFS_ITEM_PINNED 1
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 0e7df03e60c5..21c6d7ddbc06 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -379,11 +379,11 @@ xfsaild_push(
379 int lock_result; 379 int lock_result;
380 380
381 /* 381 /*
382 * Note that IOP_PUSH may unlock and reacquire the AIL lock. We 382 * Note that iop_push may unlock and reacquire the AIL lock. We
383 * rely on the AIL cursor implementation to be able to deal with 383 * rely on the AIL cursor implementation to be able to deal with
384 * the dropped lock. 384 * the dropped lock.
385 */ 385 */
386 lock_result = IOP_PUSH(lip, &ailp->xa_buf_list); 386 lock_result = lip->li_ops->iop_push(lip, &ailp->xa_buf_list);
387 switch (lock_result) { 387 switch (lock_result) {
388 case XFS_ITEM_SUCCESS: 388 case XFS_ITEM_SUCCESS:
389 XFS_STATS_INC(xs_push_ail_success); 389 XFS_STATS_INC(xs_push_ail_success);
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index aa5a04b844d6..8c75b8f67270 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -505,7 +505,7 @@ xfs_trans_brelse(xfs_trans_t *tp,
505 505
506/* 506/*
507 * Mark the buffer as not needing to be unlocked when the buf item's 507 * Mark the buffer as not needing to be unlocked when the buf item's
508 * IOP_UNLOCK() routine is called. The buffer must already be locked 508 * iop_unlock() routine is called. The buffer must already be locked
509 * and associated with the given transaction. 509 * and associated with the given transaction.
510 */ 510 */
511/* ARGSUSED */ 511/* ARGSUSED */