瀏覽代碼

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>
Chandra Seetharaman 14 年之前
父節點
當前提交
811e64c716
共有 6 個文件被更改,包括 10 次插入7 次删除
  1. 1 1
      fs/xfs/linux-2.6/xfs_buf.c
  2. 4 1
      fs/xfs/linux-2.6/xfs_buf.h
  3. 1 1
      fs/xfs/linux-2.6/xfs_sync.c
  4. 2 2
      fs/xfs/quota/xfs_dquot.c
  5. 1 1
      fs/xfs/xfs_buf_item.c
  6. 1 1
      fs/xfs/xfs_inode.c

+ 1 - 1
fs/xfs/linux-2.6/xfs_buf.c

@@ -1677,7 +1677,7 @@ xfs_buf_delwri_split(
 	list_for_each_entry_safe(bp, n, dwq, b_list) {
 	list_for_each_entry_safe(bp, n, dwq, b_list) {
 		ASSERT(bp->b_flags & XBF_DELWRI);
 		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 &&
 			if (!force &&
 			    time_before(jiffies, bp->b_queuetime + age)) {
 			    time_before(jiffies, bp->b_queuetime + age)) {
 				xfs_buf_unlock(bp);
 				xfs_buf_unlock(bp);

+ 4 - 1
fs/xfs/linux-2.6/xfs_buf.h

@@ -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_REF(bp, type, ref)	xfs_buf_set_ref(bp, ref)
 #define XFS_BUF_SET_VTYPE(bp, type)		do { } while (0)
 #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);
 #define XFS_BUF_FINISH_IOWAIT(bp)	complete(&bp->b_iowait);
 
 

+ 1 - 1
fs/xfs/linux-2.6/xfs_sync.c

@@ -330,7 +330,7 @@ xfs_sync_fsdata(
 	 * between there and here.
 	 * between there and here.
 	 */
 	 */
 	bp = xfs_getsb(mp, 0);
 	bp = xfs_getsb(mp, 0);
-	if (XFS_BUF_ISPINNED(bp))
+	if (xfs_buf_ispinned(bp))
 		xfs_log_force(mp, 0);
 		xfs_log_force(mp, 0);
 
 
 	return xfs_bwrite(mp, bp);
 	return xfs_bwrite(mp, bp);

+ 2 - 2
fs/xfs/quota/xfs_dquot.c

@@ -1236,7 +1236,7 @@ xfs_qm_dqflush(
 	 * If the buffer is pinned then push on the log so we won't
 	 * If the buffer is pinned then push on the log so we won't
 	 * get stuck waiting in the write for too long.
 	 * get stuck waiting in the write for too long.
 	 */
 	 */
-	if (XFS_BUF_ISPINNED(bp)) {
+	if (xfs_buf_ispinned(bp)) {
 		trace_xfs_dqflush_force(dqp);
 		trace_xfs_dqflush_force(dqp);
 		xfs_log_force(mp, 0);
 		xfs_log_force(mp, 0);
 	}
 	}
@@ -1443,7 +1443,7 @@ xfs_qm_dqflock_pushbuf_wait(
 		goto out_lock;
 		goto out_lock;
 
 
 	if (XFS_BUF_ISDELAYWRITE(bp)) {
 	if (XFS_BUF_ISDELAYWRITE(bp)) {
-		if (XFS_BUF_ISPINNED(bp))
+		if (xfs_buf_ispinned(bp))
 			xfs_log_force(mp, 0);
 			xfs_log_force(mp, 0);
 		xfs_buf_delwri_promote(bp);
 		xfs_buf_delwri_promote(bp);
 		wake_up_process(bp->b_target->bt_task);
 		wake_up_process(bp->b_target->bt_task);

+ 1 - 1
fs/xfs/xfs_buf_item.c

@@ -478,7 +478,7 @@ xfs_buf_item_trylock(
 	struct xfs_buf_log_item	*bip = BUF_ITEM(lip);
 	struct xfs_buf_log_item	*bip = BUF_ITEM(lip);
 	struct xfs_buf		*bp = bip->bli_buf;
 	struct xfs_buf		*bp = bip->bli_buf;
 
 
-	if (XFS_BUF_ISPINNED(bp))
+	if (xfs_buf_ispinned(bp))
 		return XFS_ITEM_PINNED;
 		return XFS_ITEM_PINNED;
 	if (!xfs_buf_trylock(bp))
 	if (!xfs_buf_trylock(bp))
 		return XFS_ITEM_LOCKED;
 		return XFS_ITEM_LOCKED;

+ 1 - 1
fs/xfs/xfs_inode.c

@@ -2585,7 +2585,7 @@ xfs_iflush(
 	 * If the buffer is pinned then push on the log now so we won't
 	 * If the buffer is pinned then push on the log now so we won't
 	 * get stuck waiting in the write for too long.
 	 * get stuck waiting in the write for too long.
 	 */
 	 */
-	if (XFS_BUF_ISPINNED(bp))
+	if (xfs_buf_ispinned(bp))
 		xfs_log_force(mp, 0);
 		xfs_log_force(mp, 0);
 
 
 	/*
 	/*