Replace the macro XFS_BUF_ISPINNED with helper xfs_buf_ispinned
authorChandra Seetharaman <sekharan@us.ibm.com>
Fri, 22 Jul 2011 23:40:27 +0000 (23:40 +0000)
committerAlex Elder <aelder@sgi.com>
Mon, 25 Jul 2011 20:03:22 +0000 (15:03 -0500)
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>
fs/xfs/linux-2.6/xfs_buf.c
fs/xfs/linux-2.6/xfs_buf.h
fs/xfs/linux-2.6/xfs_sync.c
fs/xfs/quota/xfs_dquot.c
fs/xfs/xfs_buf_item.c
fs/xfs/xfs_inode.c

index 6a42f71d08aaebcae9a366efa2fcb839f8f02c42..5e929f0e57f765928b6be487794e68b3fd2bd290 100644 (file)
@@ -1677,7 +1677,7 @@ xfs_buf_delwri_split(
        list_for_each_entry_safe(bp, n, dwq, b_list) {
                ASSERT(bp->b_flags & XBF_DELWRI);
 
-               if (!XFS_BUF_ISPINNED(bp) && xfs_buf_trylock(bp)) {
+               if (!xfs_buf_ispinned(bp) && xfs_buf_trylock(bp)) {
                        if (!force &&
                            time_before(jiffies, bp->b_queuetime + age)) {
                                xfs_buf_unlock(bp);
index c5601e1e0f46de16f2847b51120423c452097936..f4e3de65ebe7b8995230bdc401ed237b95476713 100644 (file)
@@ -285,7 +285,10 @@ xfs_buf_set_ref(
 #define XFS_BUF_SET_VTYPE_REF(bp, type, ref)   xfs_buf_set_ref(bp, ref)
 #define XFS_BUF_SET_VTYPE(bp, type)            do { } while (0)
 
-#define XFS_BUF_ISPINNED(bp)   atomic_read(&((bp)->b_pin_count))
+static inline int xfs_buf_ispinned(struct xfs_buf *bp)
+{
+       return atomic_read(&bp->b_pin_count);
+}
 
 #define XFS_BUF_FINISH_IOWAIT(bp)      complete(&bp->b_iowait);
 
index 5cc158e52d4c4b631a5287fe074bc6760de484da..a8500e92ae7270d3e85423b3b7f4777e4c7c5685 100644 (file)
@@ -330,7 +330,7 @@ xfs_sync_fsdata(
         * between there and here.
         */
        bp = xfs_getsb(mp, 0);
-       if (XFS_BUF_ISPINNED(bp))
+       if (xfs_buf_ispinned(bp))
                xfs_log_force(mp, 0);
 
        return xfs_bwrite(mp, bp);
index 2e0629265f674aa96e15c5dea5e5714555b98b3c..db62959bed132d66c9d26ab2128335c5d4b9c318 100644 (file)
@@ -1236,7 +1236,7 @@ xfs_qm_dqflush(
         * If the buffer is pinned then push on the log so we won't
         * get stuck waiting in the write for too long.
         */
-       if (XFS_BUF_ISPINNED(bp)) {
+       if (xfs_buf_ispinned(bp)) {
                trace_xfs_dqflush_force(dqp);
                xfs_log_force(mp, 0);
        }
@@ -1443,7 +1443,7 @@ xfs_qm_dqflock_pushbuf_wait(
                goto out_lock;
 
        if (XFS_BUF_ISDELAYWRITE(bp)) {
-               if (XFS_BUF_ISPINNED(bp))
+               if (xfs_buf_ispinned(bp))
                        xfs_log_force(mp, 0);
                xfs_buf_delwri_promote(bp);
                wake_up_process(bp->b_target->bt_task);
index a16c24c3a3dd004101b3a6eec33917eb09a47179..a3d2bbca26c731816e0727c0131e6ac16098d7af 100644 (file)
@@ -478,7 +478,7 @@ xfs_buf_item_trylock(
        struct xfs_buf_log_item *bip = BUF_ITEM(lip);
        struct xfs_buf          *bp = bip->bli_buf;
 
-       if (XFS_BUF_ISPINNED(bp))
+       if (xfs_buf_ispinned(bp))
                return XFS_ITEM_PINNED;
        if (!xfs_buf_trylock(bp))
                return XFS_ITEM_LOCKED;
index bdb47b22c6bce28513ae8ad9ed91897a63ee4c64..76ee2c5371ca7895dd25387c37db164ed2015fcb 100644 (file)
@@ -2585,7 +2585,7 @@ xfs_iflush(
         * If the buffer is pinned then push on the log now so we won't
         * get stuck waiting in the write for too long.
         */
-       if (XFS_BUF_ISPINNED(bp))
+       if (xfs_buf_ispinned(bp))
                xfs_log_force(mp, 0);
 
        /*
This page took 0.038369 seconds and 5 git commands to generate.