diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2011-07-22 19:40:27 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2011-07-25 16:03:22 -0400 |
commit | 811e64c7169bb59229971c4aa3b1ed5093f44c84 (patch) | |
tree | cf14860be8322a112409095619b6e3ee71b500a7 /fs | |
parent | 02fe03d909f3a5876d7b4775fdbc83c07c7c3842 (diff) |
Replace the macro XFS_BUF_ISPINNED with helper xfs_buf_ispinned
Replace the macro XFS_BUF_ISPINNED with an inline helper function
xfs_buf_ispinned, and change all its usages.
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.h | 5 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_sync.c | 2 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_dquot.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 2 |
6 files changed, 10 insertions, 7 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 6a42f71d08aa..5e929f0e57f7 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -1677,7 +1677,7 @@ xfs_buf_delwri_split( | |||
1677 | list_for_each_entry_safe(bp, n, dwq, b_list) { | 1677 | list_for_each_entry_safe(bp, n, dwq, b_list) { |
1678 | ASSERT(bp->b_flags & XBF_DELWRI); | 1678 | ASSERT(bp->b_flags & XBF_DELWRI); |
1679 | 1679 | ||
1680 | if (!XFS_BUF_ISPINNED(bp) && xfs_buf_trylock(bp)) { | 1680 | if (!xfs_buf_ispinned(bp) && xfs_buf_trylock(bp)) { |
1681 | if (!force && | 1681 | if (!force && |
1682 | time_before(jiffies, bp->b_queuetime + age)) { | 1682 | time_before(jiffies, bp->b_queuetime + age)) { |
1683 | xfs_buf_unlock(bp); | 1683 | xfs_buf_unlock(bp); |
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h index c5601e1e0f46..f4e3de65ebe7 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/linux-2.6/xfs_buf.h | |||
@@ -285,7 +285,10 @@ xfs_buf_set_ref( | |||
285 | #define XFS_BUF_SET_VTYPE_REF(bp, type, ref) xfs_buf_set_ref(bp, ref) | 285 | #define XFS_BUF_SET_VTYPE_REF(bp, type, ref) xfs_buf_set_ref(bp, ref) |
286 | #define XFS_BUF_SET_VTYPE(bp, type) do { } while (0) | 286 | #define XFS_BUF_SET_VTYPE(bp, type) do { } while (0) |
287 | 287 | ||
288 | #define XFS_BUF_ISPINNED(bp) atomic_read(&((bp)->b_pin_count)) | 288 | static inline int xfs_buf_ispinned(struct xfs_buf *bp) |
289 | { | ||
290 | return atomic_read(&bp->b_pin_count); | ||
291 | } | ||
289 | 292 | ||
290 | #define XFS_BUF_FINISH_IOWAIT(bp) complete(&bp->b_iowait); | 293 | #define XFS_BUF_FINISH_IOWAIT(bp) complete(&bp->b_iowait); |
291 | 294 | ||
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index 5cc158e52d4c..a8500e92ae72 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c | |||
@@ -330,7 +330,7 @@ xfs_sync_fsdata( | |||
330 | * between there and here. | 330 | * between there and here. |
331 | */ | 331 | */ |
332 | bp = xfs_getsb(mp, 0); | 332 | bp = xfs_getsb(mp, 0); |
333 | if (XFS_BUF_ISPINNED(bp)) | 333 | if (xfs_buf_ispinned(bp)) |
334 | xfs_log_force(mp, 0); | 334 | xfs_log_force(mp, 0); |
335 | 335 | ||
336 | return xfs_bwrite(mp, bp); | 336 | return xfs_bwrite(mp, bp); |
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c index 2e0629265f67..db62959bed13 100644 --- a/fs/xfs/quota/xfs_dquot.c +++ b/fs/xfs/quota/xfs_dquot.c | |||
@@ -1236,7 +1236,7 @@ xfs_qm_dqflush( | |||
1236 | * If the buffer is pinned then push on the log so we won't | 1236 | * If the buffer is pinned then push on the log so we won't |
1237 | * get stuck waiting in the write for too long. | 1237 | * get stuck waiting in the write for too long. |
1238 | */ | 1238 | */ |
1239 | if (XFS_BUF_ISPINNED(bp)) { | 1239 | if (xfs_buf_ispinned(bp)) { |
1240 | trace_xfs_dqflush_force(dqp); | 1240 | trace_xfs_dqflush_force(dqp); |
1241 | xfs_log_force(mp, 0); | 1241 | xfs_log_force(mp, 0); |
1242 | } | 1242 | } |
@@ -1443,7 +1443,7 @@ xfs_qm_dqflock_pushbuf_wait( | |||
1443 | goto out_lock; | 1443 | goto out_lock; |
1444 | 1444 | ||
1445 | if (XFS_BUF_ISDELAYWRITE(bp)) { | 1445 | if (XFS_BUF_ISDELAYWRITE(bp)) { |
1446 | if (XFS_BUF_ISPINNED(bp)) | 1446 | if (xfs_buf_ispinned(bp)) |
1447 | xfs_log_force(mp, 0); | 1447 | xfs_log_force(mp, 0); |
1448 | xfs_buf_delwri_promote(bp); | 1448 | xfs_buf_delwri_promote(bp); |
1449 | wake_up_process(bp->b_target->bt_task); | 1449 | wake_up_process(bp->b_target->bt_task); |
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index a16c24c3a3dd..a3d2bbca26c7 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -478,7 +478,7 @@ xfs_buf_item_trylock( | |||
478 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); | 478 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); |
479 | struct xfs_buf *bp = bip->bli_buf; | 479 | struct xfs_buf *bp = bip->bli_buf; |
480 | 480 | ||
481 | if (XFS_BUF_ISPINNED(bp)) | 481 | if (xfs_buf_ispinned(bp)) |
482 | return XFS_ITEM_PINNED; | 482 | return XFS_ITEM_PINNED; |
483 | if (!xfs_buf_trylock(bp)) | 483 | if (!xfs_buf_trylock(bp)) |
484 | return XFS_ITEM_LOCKED; | 484 | return XFS_ITEM_LOCKED; |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index bdb47b22c6bc..76ee2c5371ca 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -2585,7 +2585,7 @@ xfs_iflush( | |||
2585 | * If the buffer is pinned then push on the log now so we won't | 2585 | * If the buffer is pinned then push on the log now so we won't |
2586 | * get stuck waiting in the write for too long. | 2586 | * get stuck waiting in the write for too long. |
2587 | */ | 2587 | */ |
2588 | if (XFS_BUF_ISPINNED(bp)) | 2588 | if (xfs_buf_ispinned(bp)) |
2589 | xfs_log_force(mp, 0); | 2589 | xfs_log_force(mp, 0); |
2590 | 2590 | ||
2591 | /* | 2591 | /* |