aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_buf.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-06-23 04:11:15 -0400
committerAlex Elder <aelder@sgi.com>2010-07-26 14:16:36 -0400
commit4d16e9246fc3b3cf7bc95609eff66929a39daa06 (patch)
treed3e1cb33c3394b7cb95f390a85acb48c80fd5f54 /fs/xfs/linux-2.6/xfs_buf.c
parentca30b2a7b7ac899ac4da6030ccbebf2f137b8e6d (diff)
xfs: simplify buffer pinning
Get rid of the xfs_buf_pin/xfs_buf_unpin/xfs_buf_ispin helpers and opencode them in their only callers, just like we did for the inode pinning a while ago. Also remove duplicate trace points - the bufitem tracepoints cover all the information that is present in a buffer tracepoint. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_buf.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index 4b2177f5b223..efce8abb375c 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -896,36 +896,6 @@ xfs_buf_unlock(
896 trace_xfs_buf_unlock(bp, _RET_IP_); 896 trace_xfs_buf_unlock(bp, _RET_IP_);
897} 897}
898 898
899
900/*
901 * Pinning Buffer Storage in Memory
902 * Ensure that no attempt to force a buffer to disk will succeed.
903 */
904void
905xfs_buf_pin(
906 xfs_buf_t *bp)
907{
908 trace_xfs_buf_pin(bp, _RET_IP_);
909 atomic_inc(&bp->b_pin_count);
910}
911
912void
913xfs_buf_unpin(
914 xfs_buf_t *bp)
915{
916 trace_xfs_buf_unpin(bp, _RET_IP_);
917
918 if (atomic_dec_and_test(&bp->b_pin_count))
919 wake_up_all(&bp->b_waiters);
920}
921
922int
923xfs_buf_ispin(
924 xfs_buf_t *bp)
925{
926 return atomic_read(&bp->b_pin_count);
927}
928
929STATIC void 899STATIC void
930xfs_buf_wait_unpin( 900xfs_buf_wait_unpin(
931 xfs_buf_t *bp) 901 xfs_buf_t *bp)
@@ -1803,7 +1773,7 @@ xfs_buf_delwri_split(
1803 trace_xfs_buf_delwri_split(bp, _RET_IP_); 1773 trace_xfs_buf_delwri_split(bp, _RET_IP_);
1804 ASSERT(bp->b_flags & XBF_DELWRI); 1774 ASSERT(bp->b_flags & XBF_DELWRI);
1805 1775
1806 if (!xfs_buf_ispin(bp) && !xfs_buf_cond_lock(bp)) { 1776 if (!XFS_BUF_ISPINNED(bp) && !xfs_buf_cond_lock(bp)) {
1807 if (!force && 1777 if (!force &&
1808 time_before(jiffies, bp->b_queuetime + age)) { 1778 time_before(jiffies, bp->b_queuetime + age)) {
1809 xfs_buf_unlock(bp); 1779 xfs_buf_unlock(bp);