All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] a couple of buffer cache cleanups
@ 2011-10-06 21:06 Christoph Hellwig
  2011-10-06 21:06 ` [PATCH 1/9] xfs: remove xfs_get_buftarg_list Christoph Hellwig
                   ` (8 more replies)
  0 siblings, 9 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-06 21:06 UTC (permalink / raw)
  To: xfs

This series contains a handful of patches that tidy up various bits and
pieces in the XFS buffer cache.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 1/9] xfs: remove xfs_get_buftarg_list
  2011-10-06 21:06 [PATCH 0/9] a couple of buffer cache cleanups Christoph Hellwig
@ 2011-10-06 21:06 ` Christoph Hellwig
  2011-10-07  1:38   ` Dave Chinner
  2011-10-07 19:36   ` Alex Elder
  2011-10-06 21:06 ` [PATCH 2/9] xfs: remove XFS_BUF_FINISH_IOWAIT Christoph Hellwig
                   ` (7 subsequent siblings)
  8 siblings, 2 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-06 21:06 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-kill-xfs_get_buftarg_list --]
[-- Type: text/plain, Size: 1367 bytes --]

The code is unused and under a config option that doesn't exist, remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/xfs_buf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.c	2011-10-02 14:05:00.984771623 +0200
+++ xfs/fs/xfs/xfs_buf.c	2011-10-02 14:06:02.936771751 +0200
@@ -1835,11 +1835,3 @@ xfs_buf_terminate(void)
 	destroy_workqueue(xfslogd_workqueue);
 	kmem_zone_destroy(xfs_buf_zone);
 }
-
-#ifdef CONFIG_KDB_MODULES
-struct list_head *
-xfs_get_buftarg_list(void)
-{
-	return &xfs_buftarg_list;
-}
-#endif
Index: xfs/fs/xfs/xfs_buf.h
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.h	2011-10-02 14:06:00.752771537 +0200
+++ xfs/fs/xfs/xfs_buf.h	2011-10-02 14:06:02.936771751 +0200
@@ -311,10 +311,6 @@ extern void xfs_wait_buftarg(xfs_buftarg
 extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int, unsigned int);
 extern int xfs_flush_buftarg(xfs_buftarg_t *, int);
 
-#ifdef CONFIG_KDB_MODULES
-extern struct list_head *xfs_get_buftarg_list(void);
-#endif
-
 #define xfs_getsize_buftarg(buftarg)	block_size((buftarg)->bt_bdev)
 #define xfs_readonly_buftarg(buftarg)	bdev_read_only((buftarg)->bt_bdev)
 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 2/9] xfs: remove XFS_BUF_FINISH_IOWAIT
  2011-10-06 21:06 [PATCH 0/9] a couple of buffer cache cleanups Christoph Hellwig
  2011-10-06 21:06 ` [PATCH 1/9] xfs: remove xfs_get_buftarg_list Christoph Hellwig
@ 2011-10-06 21:06 ` Christoph Hellwig
  2011-10-07  1:38   ` Dave Chinner
  2011-10-07 19:36   ` Alex Elder
  2011-10-06 21:06 ` [PATCH 3/9] xfs: remove XFS_BUF_SET_VTYPE and XFS_BUF_SET_VTYPE_REF Christoph Hellwig
                   ` (6 subsequent siblings)
  8 siblings, 2 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-06 21:06 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-kill-XFS_BUF_FINISH_IOWAIT --]
[-- Type: text/plain, Size: 1051 bytes --]

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/xfs_buf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.c	2011-10-02 14:06:02.936771751 +0200
+++ xfs/fs/xfs/xfs_buf.c	2011-10-02 14:06:08.028771236 +0200
@@ -1100,7 +1100,7 @@ xfs_bioerror_relse(
 		 * ASYNC buffers.
 		 */
 		xfs_buf_ioerror(bp, EIO);
-		XFS_BUF_FINISH_IOWAIT(bp);
+		complete(&bp->b_iowait);
 	} else {
 		xfs_buf_relse(bp);
 	}
Index: xfs/fs/xfs/xfs_buf.h
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.h	2011-10-02 14:06:02.936771751 +0200
+++ xfs/fs/xfs/xfs_buf.h	2011-10-02 14:06:08.028771236 +0200
@@ -293,8 +293,6 @@ static inline int xfs_buf_ispinned(struc
 	return atomic_read(&bp->b_pin_count);
 }
 
-#define XFS_BUF_FINISH_IOWAIT(bp)	complete(&bp->b_iowait);
-
 static inline void xfs_buf_relse(xfs_buf_t *bp)
 {
 	xfs_buf_unlock(bp);

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 3/9] xfs: remove XFS_BUF_SET_VTYPE and XFS_BUF_SET_VTYPE_REF
  2011-10-06 21:06 [PATCH 0/9] a couple of buffer cache cleanups Christoph Hellwig
  2011-10-06 21:06 ` [PATCH 1/9] xfs: remove xfs_get_buftarg_list Christoph Hellwig
  2011-10-06 21:06 ` [PATCH 2/9] xfs: remove XFS_BUF_FINISH_IOWAIT Christoph Hellwig
@ 2011-10-06 21:06 ` Christoph Hellwig
  2011-10-07  1:40   ` Dave Chinner
  2011-10-07 19:36   ` Alex Elder
  2011-10-06 21:06 ` [PATCH 4/9] xfs: remove XFS_BUF_STALE and XFS_BUF_SUPER_STALE Christoph Hellwig
                   ` (5 subsequent siblings)
  8 siblings, 2 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-06 21:06 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-kill-XFS_BUF_SET_VTYPE --]
[-- Type: text/plain, Size: 4729 bytes --]

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/xfs_alloc.c
===================================================================
--- xfs.orig/fs/xfs/xfs_alloc.c	2011-09-26 11:05:28.202868929 +0200
+++ xfs/fs/xfs/xfs_alloc.c	2011-09-26 11:07:54.067868056 +0200
@@ -452,7 +452,7 @@ xfs_alloc_read_agfl(
 	if (error)
 		return error;
 	ASSERT(!xfs_buf_geterror(bp));
-	XFS_BUF_SET_VTYPE_REF(bp, B_FS_AGFL, XFS_AGFL_REF);
+	xfs_buf_set_ref(bp, XFS_AGFL_REF);
 	*bpp = bp;
 	return 0;
 }
@@ -2139,7 +2139,7 @@ xfs_read_agf(
 		xfs_trans_brelse(tp, *bpp);
 		return XFS_ERROR(EFSCORRUPTED);
 	}
-	XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_AGF, XFS_AGF_REF);
+	xfs_buf_set_ref(*bpp, XFS_AGF_REF);
 	return 0;
 }
 
Index: xfs/fs/xfs/xfs_btree.c
===================================================================
--- xfs.orig/fs/xfs/xfs_btree.c	2011-09-26 10:53:36.618367481 +0200
+++ xfs/fs/xfs/xfs_btree.c	2011-09-26 11:07:54.071914772 +0200
@@ -631,7 +631,7 @@ xfs_btree_read_bufl(
 	}
 	ASSERT(!xfs_buf_geterror(bp));
 	if (bp)
-		XFS_BUF_SET_VTYPE_REF(bp, B_FS_MAP, refval);
+		xfs_buf_set_ref(bp, refval);
 	*bpp = bp;
 	return 0;
 }
@@ -939,13 +939,13 @@ xfs_btree_set_refs(
 	switch (cur->bc_btnum) {
 	case XFS_BTNUM_BNO:
 	case XFS_BTNUM_CNT:
-		XFS_BUF_SET_VTYPE_REF(bp, B_FS_MAP, XFS_ALLOC_BTREE_REF);
+		xfs_buf_set_ref(bp, XFS_ALLOC_BTREE_REF);
 		break;
 	case XFS_BTNUM_INO:
-		XFS_BUF_SET_VTYPE_REF(bp, B_FS_INOMAP, XFS_INO_BTREE_REF);
+		xfs_buf_set_ref(bp, XFS_INO_BTREE_REF);
 		break;
 	case XFS_BTNUM_BMAP:
-		XFS_BUF_SET_VTYPE_REF(bp, B_FS_MAP, XFS_BMAP_BTREE_REF);
+		xfs_buf_set_ref(bp, XFS_BMAP_BTREE_REF);
 		break;
 	default:
 		ASSERT(0);
Index: xfs/fs/xfs/xfs_buf.h
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.h	2011-09-26 11:05:34.114368266 +0200
+++ xfs/fs/xfs/xfs_buf.h	2011-09-26 11:07:54.071914772 +0200
@@ -278,15 +278,10 @@ void xfs_buf_stale(struct xfs_buf *bp);
 #define XFS_BUF_SIZE(bp)		((bp)->b_buffer_length)
 #define XFS_BUF_SET_SIZE(bp, cnt)	((bp)->b_buffer_length = (cnt))
 
-static inline void
-xfs_buf_set_ref(
-	struct xfs_buf	*bp,
-	int		lru_ref)
+static inline void xfs_buf_set_ref(struct xfs_buf *bp, int lru_ref)
 {
 	atomic_set(&bp->b_lru_ref, lru_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)
 
 static inline int xfs_buf_ispinned(struct xfs_buf *bp)
 {
Index: xfs/fs/xfs/xfs_da_btree.c
===================================================================
--- xfs.orig/fs/xfs/xfs_da_btree.c	2011-09-26 10:53:36.000000000 +0200
+++ xfs/fs/xfs/xfs_da_btree.c	2011-09-26 11:07:54.075868682 +0200
@@ -2053,13 +2053,10 @@ xfs_da_do_buf(
 		if (!bp)
 			continue;
 		if (caller == 1) {
-			if (whichfork == XFS_ATTR_FORK) {
-				XFS_BUF_SET_VTYPE_REF(bp, B_FS_ATTR_BTREE,
-						XFS_ATTR_BTREE_REF);
-			} else {
-				XFS_BUF_SET_VTYPE_REF(bp, B_FS_DIR_BTREE,
-						XFS_DIR_BTREE_REF);
-			}
+			if (whichfork == XFS_ATTR_FORK)
+				xfs_buf_set_ref(bp, XFS_ATTR_BTREE_REF);
+			else
+				xfs_buf_set_ref(bp, XFS_DIR_BTREE_REF);
 		}
 		if (bplist) {
 			bplist[nbplist++] = bp;
Index: xfs/fs/xfs/xfs_dquot.c
===================================================================
--- xfs.orig/fs/xfs/xfs_dquot.c	2011-09-26 10:55:36.962581408 +0200
+++ xfs/fs/xfs/xfs_dquot.c	2011-09-26 11:07:54.083927037 +0200
@@ -605,7 +605,7 @@ xfs_qm_dqread(
 	dqp->q_res_rtbcount = be64_to_cpu(ddqp->d_rtbcount);
 
 	/* Mark the buf so that this will stay incore a little longer */
-	XFS_BUF_SET_VTYPE_REF(bp, B_FS_DQUOT, XFS_DQUOT_REF);
+	xfs_buf_set_ref(bp, XFS_DQUOT_REF);
 
 	/*
 	 * We got the buffer with a xfs_trans_read_buf() (in dqtobp())
Index: xfs/fs/xfs/xfs_ialloc.c
===================================================================
--- xfs.orig/fs/xfs/xfs_ialloc.c	2011-09-26 10:53:36.622367741 +0200
+++ xfs/fs/xfs/xfs_ialloc.c	2011-09-26 11:07:54.087885695 +0200
@@ -1505,7 +1505,7 @@ xfs_read_agi(
 		return XFS_ERROR(EFSCORRUPTED);
 	}
 
-	XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_AGI, XFS_AGI_REF);
+	xfs_buf_set_ref(*bpp, XFS_AGI_REF);
 
 	xfs_check_agi_unlinked(agi);
 	return 0;
Index: xfs/fs/xfs/xfs_inode.c
===================================================================
--- xfs.orig/fs/xfs/xfs_inode.c	2011-09-26 10:55:36.954369070 +0200
+++ xfs/fs/xfs/xfs_inode.c	2011-09-26 11:07:54.095882086 +0200
@@ -190,12 +190,6 @@ xfs_imap_to_bp(
 	}
 
 	xfs_inobp_check(mp, bp);
-
-	/*
-	 * Mark the buffer as an inode buffer now that it looks good
-	 */
-	XFS_BUF_SET_VTYPE(bp, B_FS_INO);
-
 	*bpp = bp;
 	return 0;
 }

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 4/9] xfs: remove XFS_BUF_STALE and XFS_BUF_SUPER_STALE
  2011-10-06 21:06 [PATCH 0/9] a couple of buffer cache cleanups Christoph Hellwig
                   ` (2 preceding siblings ...)
  2011-10-06 21:06 ` [PATCH 3/9] xfs: remove XFS_BUF_SET_VTYPE and XFS_BUF_SET_VTYPE_REF Christoph Hellwig
@ 2011-10-06 21:06 ` Christoph Hellwig
  2011-10-07  1:41   ` Dave Chinner
  2011-10-07 19:36   ` Alex Elder
  2011-10-06 21:06 ` [PATCH 5/9] xfs: remove buffers from the delwri list in xfs_buf_stale Christoph Hellwig
                   ` (4 subsequent siblings)
  8 siblings, 2 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-06 21:06 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-kill-XFS_BUF_STALE --]
[-- Type: text/plain, Size: 6504 bytes --]

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/xfs_attr.c
===================================================================
--- xfs.orig/fs/xfs/xfs_attr.c	2011-10-06 14:37:08.850919140 -0400
+++ xfs/fs/xfs/xfs_attr.c	2011-10-06 14:37:11.010920453 -0400
@@ -2168,7 +2168,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *ar
 		 */
 		bp = xfs_incore(mp->m_ddev_targp, dblkno, blkcnt, XBF_TRYLOCK);
 		if (bp) {
-			XFS_BUF_STALE(bp);
+			xfs_buf_stale(bp);
 			xfs_buf_delwri_dequeue(bp);
 			xfs_buf_relse(bp);
 			bp = NULL;
Index: xfs/fs/xfs/xfs_buf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.c	2011-10-06 14:37:08.862918712 -0400
+++ xfs/fs/xfs/xfs_buf.c	2011-10-06 14:37:11.014920137 -0400
@@ -1061,7 +1061,7 @@ xfs_bioerror(
 	XFS_BUF_UNREAD(bp);
 	xfs_buf_delwri_dequeue(bp);
 	XFS_BUF_UNDONE(bp);
-	XFS_BUF_STALE(bp);
+	xfs_buf_stale(bp);
 
 	xfs_buf_ioend(bp, 0);
 
@@ -1090,7 +1090,7 @@ xfs_bioerror_relse(
 	XFS_BUF_UNREAD(bp);
 	xfs_buf_delwri_dequeue(bp);
 	XFS_BUF_DONE(bp);
-	XFS_BUF_STALE(bp);
+	xfs_buf_stale(bp);
 	bp->b_iodone = NULL;
 	if (!(fl & XBF_ASYNC)) {
 		/*
Index: xfs/fs/xfs/xfs_buf.h
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.h	2011-10-06 14:37:08.870920884 -0400
+++ xfs/fs/xfs/xfs_buf.h	2011-10-06 14:37:11.014920137 -0400
@@ -242,14 +242,8 @@ xfs_buf_target_name(struct xfs_buftarg *
 			    XBF_SYNCIO|XBF_FUA|XBF_FLUSH))
 
 void xfs_buf_stale(struct xfs_buf *bp);
-#define XFS_BUF_STALE(bp)	xfs_buf_stale(bp);
 #define XFS_BUF_UNSTALE(bp)	((bp)->b_flags &= ~XBF_STALE)
 #define XFS_BUF_ISSTALE(bp)	((bp)->b_flags & XBF_STALE)
-#define XFS_BUF_SUPER_STALE(bp)	do {				\
-					XFS_BUF_STALE(bp);	\
-					xfs_buf_delwri_dequeue(bp);	\
-					XFS_BUF_DONE(bp);	\
-				} while (0)
 
 #define XFS_BUF_ISDELAYWRITE(bp)	((bp)->b_flags & XBF_DELWRI)
 
Index: xfs/fs/xfs/xfs_buf_item.c
===================================================================
--- xfs.orig/fs/xfs/xfs_buf_item.c	2011-10-06 14:37:08.882920547 -0400
+++ xfs/fs/xfs/xfs_buf_item.c	2011-10-06 14:37:11.014920137 -0400
@@ -967,7 +967,9 @@ xfs_buf_iodone_callbacks(
 	 * I/O errors, there's no point in giving this a retry.
 	 */
 	if (XFS_FORCED_SHUTDOWN(mp)) {
-		XFS_BUF_SUPER_STALE(bp);
+		xfs_buf_stale(bp);
+		xfs_buf_delwri_dequeue(bp);
+		XFS_BUF_DONE(bp);
 		trace_xfs_buf_item_iodone(bp, _RET_IP_);
 		goto do_callbacks;
 	}
@@ -1006,7 +1008,7 @@ xfs_buf_iodone_callbacks(
 	 * If the write of the buffer was synchronous, we want to make
 	 * sure to return the error to the caller of xfs_bwrite().
 	 */
-	XFS_BUF_STALE(bp);
+	xfs_buf_stale(bp);
 	XFS_BUF_DONE(bp);
 	xfs_buf_delwri_dequeue(bp);
 
Index: xfs/fs/xfs/xfs_inode.c
===================================================================
--- xfs.orig/fs/xfs/xfs_inode.c	2011-10-06 14:37:08.894917822 -0400
+++ xfs/fs/xfs/xfs_inode.c	2011-10-06 14:37:11.018917565 -0400
@@ -2469,11 +2469,11 @@ cluster_corrupt_out:
 		 */
 		if (bp->b_iodone) {
 			XFS_BUF_UNDONE(bp);
-			XFS_BUF_STALE(bp);
+			xfs_buf_stale(bp);
 			xfs_buf_ioerror(bp, EIO);
 			xfs_buf_ioend(bp, 0);
 		} else {
-			XFS_BUF_STALE(bp);
+			xfs_buf_stale(bp);
 			xfs_buf_relse(bp);
 		}
 	}
Index: xfs/fs/xfs/xfs_log.c
===================================================================
--- xfs.orig/fs/xfs/xfs_log.c	2011-10-06 14:37:08.902920983 -0400
+++ xfs/fs/xfs/xfs_log.c	2011-10-06 14:37:11.022918855 -0400
@@ -869,7 +869,7 @@ xlog_iodone(xfs_buf_t *bp)
 	if (XFS_TEST_ERROR((xfs_buf_geterror(bp)), l->l_mp,
 			XFS_ERRTAG_IODONE_IOERR, XFS_RANDOM_IODONE_IOERR)) {
 		xfs_ioerror_alert("xlog_iodone", l->l_mp, bp, XFS_BUF_ADDR(bp));
-		XFS_BUF_STALE(bp);
+		xfs_buf_stale(bp);
 		xfs_force_shutdown(l->l_mp, SHUTDOWN_LOG_IO_ERROR);
 		/*
 		 * This flag will be propagated to the trans-committed
@@ -1235,7 +1235,7 @@ xlog_bdstrat(
 
 	if (iclog->ic_state & XLOG_STATE_IOERROR) {
 		xfs_buf_ioerror(bp, EIO);
-		XFS_BUF_STALE(bp);
+		xfs_buf_stale(bp);
 		xfs_buf_ioend(bp, 0);
 		/*
 		 * It would seem logical to return EIO here, but we rely on
Index: xfs/fs/xfs/xfs_log_recover.c
===================================================================
--- xfs.orig/fs/xfs/xfs_log_recover.c	2011-10-06 14:37:08.914921299 -0400
+++ xfs/fs/xfs/xfs_log_recover.c	2011-10-06 14:37:11.026919015 -0400
@@ -2174,7 +2174,7 @@ xlog_recover_buffer_pass2(
 	    be16_to_cpu(*((__be16 *)xfs_buf_offset(bp, 0))) &&
 	    (XFS_BUF_COUNT(bp) != MAX(log->l_mp->m_sb.sb_blocksize,
 			(__uint32_t)XFS_INODE_CLUSTER_SIZE(log->l_mp)))) {
-		XFS_BUF_STALE(bp);
+		xfs_buf_stale(bp);
 		error = xfs_bwrite(bp);
 	} else {
 		ASSERT(bp->b_target->bt_mount == mp);
Index: xfs/fs/xfs/xfs_rw.c
===================================================================
--- xfs.orig/fs/xfs/xfs_rw.c	2011-10-06 14:37:08.926918084 -0400
+++ xfs/fs/xfs/xfs_rw.c	2011-10-06 14:37:11.030919219 -0400
@@ -150,7 +150,7 @@ xfs_read_buf(
 		if (bp) {
 			XFS_BUF_UNDONE(bp);
 			xfs_buf_delwri_dequeue(bp);
-			XFS_BUF_STALE(bp);
+			xfs_buf_stale(bp);
 			/*
 			 * brelse clears B_ERROR and b_error
 			 */
Index: xfs/fs/xfs/xfs_trans_buf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_trans_buf.c	2011-10-06 14:37:08.942920379 -0400
+++ xfs/fs/xfs/xfs_trans_buf.c	2011-10-06 14:37:11.030919219 -0400
@@ -160,8 +160,11 @@ xfs_trans_get_buf(xfs_trans_t	*tp,
 	bp = xfs_trans_buf_item_match(tp, target_dev, blkno, len);
 	if (bp != NULL) {
 		ASSERT(xfs_buf_islocked(bp));
-		if (XFS_FORCED_SHUTDOWN(tp->t_mountp))
-			XFS_BUF_SUPER_STALE(bp);
+		if (XFS_FORCED_SHUTDOWN(tp->t_mountp)) {
+			xfs_buf_stale(bp);
+			xfs_buf_delwri_dequeue(bp);
+			XFS_BUF_DONE(bp);
+		}
 
 		/*
 		 * If the buffer is stale then it was binval'ed
@@ -387,7 +390,9 @@ xfs_trans_read_buf(
 	}
 	if (bp->b_error) {
 		error = bp->b_error;
-		XFS_BUF_SUPER_STALE(bp);
+		xfs_buf_stale(bp);
+		xfs_buf_delwri_dequeue(bp);
+		XFS_BUF_DONE(bp);
 		xfs_ioerror_alert("xfs_trans_read_buf", mp,
 				  bp, blkno);
 		if (tp->t_flags & XFS_TRANS_DIRTY)
@@ -740,7 +745,7 @@ xfs_trans_binval(
 	 * rid of it.
 	 */
 	xfs_buf_delwri_dequeue(bp);
-	XFS_BUF_STALE(bp);
+	xfs_buf_stale(bp);
 	bip->bli_flags |= XFS_BLI_STALE;
 	bip->bli_flags &= ~(XFS_BLI_INODE_BUF | XFS_BLI_LOGGED | XFS_BLI_DIRTY);
 	bip->bli_format.blf_flags &= ~XFS_BLF_INODE_BUF;

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 5/9] xfs: remove buffers from the delwri list in xfs_buf_stale
  2011-10-06 21:06 [PATCH 0/9] a couple of buffer cache cleanups Christoph Hellwig
                   ` (3 preceding siblings ...)
  2011-10-06 21:06 ` [PATCH 4/9] xfs: remove XFS_BUF_STALE and XFS_BUF_SUPER_STALE Christoph Hellwig
@ 2011-10-06 21:06 ` Christoph Hellwig
  2011-10-07  1:45   ` Dave Chinner
  2011-10-07 19:36   ` Alex Elder
  2011-10-06 21:06 ` [PATCH 6/9] xfs: clean up buffer allocation Christoph Hellwig
                   ` (3 subsequent siblings)
  8 siblings, 2 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-06 21:06 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-buf-stale-delwri-remove --]
[-- Type: text/plain, Size: 3764 bytes --]

For each call to xfs_buf_stale we call xfs_buf_delwri_dequeue either
directly before or after it, or are guaranteed by the surrounding
conditionals that we are never called on delwri buffers.  Simply
this situation by moving the call to xfs_buf_delwri_dequeue into
xfs_buf_stale.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/xfs_attr.c
===================================================================
--- xfs.orig/fs/xfs/xfs_attr.c	2011-10-06 14:37:11.010920453 -0400
+++ xfs/fs/xfs/xfs_attr.c	2011-10-06 14:37:13.674921044 -0400
@@ -2169,7 +2169,6 @@ xfs_attr_rmtval_remove(xfs_da_args_t *ar
 		bp = xfs_incore(mp->m_ddev_targp, dblkno, blkcnt, XBF_TRYLOCK);
 		if (bp) {
 			xfs_buf_stale(bp);
-			xfs_buf_delwri_dequeue(bp);
 			xfs_buf_relse(bp);
 			bp = NULL;
 		}
Index: xfs/fs/xfs/xfs_buf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.c	2011-10-06 14:37:11.014920137 -0400
+++ xfs/fs/xfs/xfs_buf.c	2011-10-06 14:37:13.674921044 -0400
@@ -151,6 +151,7 @@ xfs_buf_stale(
 	struct xfs_buf	*bp)
 {
 	bp->b_flags |= XBF_STALE;
+	xfs_buf_delwri_dequeue(bp);
 	atomic_set(&(bp)->b_lru_ref, 0);
 	if (!list_empty(&bp->b_lru)) {
 		struct xfs_buftarg *btp = bp->b_target;
@@ -1059,7 +1060,6 @@ xfs_bioerror(
 	 * We're calling xfs_buf_ioend, so delete XBF_DONE flag.
 	 */
 	XFS_BUF_UNREAD(bp);
-	xfs_buf_delwri_dequeue(bp);
 	XFS_BUF_UNDONE(bp);
 	xfs_buf_stale(bp);
 
@@ -1088,7 +1088,6 @@ xfs_bioerror_relse(
 	 * change that interface.
 	 */
 	XFS_BUF_UNREAD(bp);
-	xfs_buf_delwri_dequeue(bp);
 	XFS_BUF_DONE(bp);
 	xfs_buf_stale(bp);
 	bp->b_iodone = NULL;
Index: xfs/fs/xfs/xfs_buf_item.c
===================================================================
--- xfs.orig/fs/xfs/xfs_buf_item.c	2011-10-06 14:37:11.014920137 -0400
+++ xfs/fs/xfs/xfs_buf_item.c	2011-10-06 14:37:13.678919098 -0400
@@ -968,7 +968,6 @@ xfs_buf_iodone_callbacks(
 	 */
 	if (XFS_FORCED_SHUTDOWN(mp)) {
 		xfs_buf_stale(bp);
-		xfs_buf_delwri_dequeue(bp);
 		XFS_BUF_DONE(bp);
 		trace_xfs_buf_item_iodone(bp, _RET_IP_);
 		goto do_callbacks;
@@ -1010,7 +1007,6 @@ xfs_buf_iodone_callbacks(
 	 */
 	xfs_buf_stale(bp);
 	XFS_BUF_DONE(bp);
-	xfs_buf_delwri_dequeue(bp);
 
 	trace_xfs_buf_error_relse(bp, _RET_IP_);
 
Index: xfs/fs/xfs/xfs_rw.c
===================================================================
--- xfs.orig/fs/xfs/xfs_rw.c	2011-10-06 14:37:11.030919219 -0400
+++ xfs/fs/xfs/xfs_rw.c	2011-10-06 14:37:13.682917913 -0400
@@ -149,7 +149,6 @@ xfs_read_buf(
 		}
 		if (bp) {
 			XFS_BUF_UNDONE(bp);
-			xfs_buf_delwri_dequeue(bp);
 			xfs_buf_stale(bp);
 			/*
 			 * brelse clears B_ERROR and b_error
Index: xfs/fs/xfs/xfs_trans_buf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_trans_buf.c	2011-10-06 14:37:11.030919219 -0400
+++ xfs/fs/xfs/xfs_trans_buf.c	2011-10-06 14:37:13.686917964 -0400
@@ -162,7 +162,6 @@ xfs_trans_get_buf(xfs_trans_t	*tp,
 		ASSERT(xfs_buf_islocked(bp));
 		if (XFS_FORCED_SHUTDOWN(tp->t_mountp)) {
 			xfs_buf_stale(bp);
-			xfs_buf_delwri_dequeue(bp);
 			XFS_BUF_DONE(bp);
 		}
 
@@ -391,7 +390,6 @@ xfs_trans_read_buf(
 	if (bp->b_error) {
 		error = bp->b_error;
 		xfs_buf_stale(bp);
-		xfs_buf_delwri_dequeue(bp);
 		XFS_BUF_DONE(bp);
 		xfs_ioerror_alert("xfs_trans_read_buf", mp,
 				  bp, blkno);
@@ -744,7 +742,6 @@ xfs_trans_binval(
 	 * We set the stale bit in the buffer as well since we're getting
 	 * rid of it.
 	 */
-	xfs_buf_delwri_dequeue(bp);
 	xfs_buf_stale(bp);
 	bip->bli_flags |= XFS_BLI_STALE;
 	bip->bli_flags &= ~(XFS_BLI_INODE_BUF | XFS_BLI_LOGGED | XFS_BLI_DIRTY);

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 6/9] xfs: clean up buffer allocation
  2011-10-06 21:06 [PATCH 0/9] a couple of buffer cache cleanups Christoph Hellwig
                   ` (4 preceding siblings ...)
  2011-10-06 21:06 ` [PATCH 5/9] xfs: remove buffers from the delwri list in xfs_buf_stale Christoph Hellwig
@ 2011-10-06 21:06 ` Christoph Hellwig
  2011-10-07  1:48   ` Dave Chinner
  2011-10-07 19:37   ` Alex Elder
  2011-10-06 21:06 ` [PATCH 7/9] xfs: clean up xfs_ioerror_alert Christoph Hellwig
                   ` (2 subsequent siblings)
  8 siblings, 2 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-06 21:06 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-cleanup-buffer-allocation --]
[-- Type: text/plain, Size: 4726 bytes --]

Change _xfs_buf_initialize to allocate the buffer directly and rename it to
xfs_buf_alloc now that is the only buffer allocation routine.  Also remove
the xfs_buf_deallocate wrapper around the kmem_zone_free calls for buffers.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/xfs_buf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.c	2011-10-02 16:08:22.484275559 +0200
+++ xfs/fs/xfs/xfs_buf.c	2011-10-02 16:17:59.831271600 +0200
@@ -65,10 +65,6 @@ struct workqueue_struct *xfsconvertd_wor
 #define xb_to_km(flags) \
 	 (((flags) & XBF_DONT_BLOCK) ? KM_NOFS : KM_SLEEP)
 
-#define xfs_buf_allocate(flags) \
-	kmem_zone_alloc(xfs_buf_zone, xb_to_km(flags))
-#define xfs_buf_deallocate(bp) \
-	kmem_zone_free(xfs_buf_zone, (bp));
 
 static inline int
 xfs_buf_is_vmapped(
@@ -167,14 +163,19 @@ xfs_buf_stale(
 	ASSERT(atomic_read(&bp->b_hold) >= 1);
 }
 
-STATIC void
-_xfs_buf_initialize(
-	xfs_buf_t		*bp,
-	xfs_buftarg_t		*target,
+struct xfs_buf *
+xfs_buf_alloc(
+	struct xfs_buftarg	*target,
 	xfs_off_t		range_base,
 	size_t			range_length,
 	xfs_buf_flags_t		flags)
 {
+	struct xfs_buf		*bp;
+
+	bp = kmem_zone_alloc(xfs_buf_zone, xb_to_km(flags));
+	if (unlikely(!bp))
+		return NULL;
+
 	/*
 	 * We don't want certain flags to appear in b_flags.
 	 */
@@ -203,8 +204,9 @@ _xfs_buf_initialize(
 	init_waitqueue_head(&bp->b_waiters);
 
 	XFS_STATS_INC(xb_create);
-
 	trace_xfs_buf_init(bp, _RET_IP_);
+
+	return bp;
 }
 
 /*
@@ -277,7 +279,7 @@ xfs_buf_free(
 	} else if (bp->b_flags & _XBF_KMEM)
 		kmem_free(bp->b_addr);
 	_xfs_buf_free_pages(bp);
-	xfs_buf_deallocate(bp);
+	kmem_zone_free(xfs_buf_zone, bp);
 }
 
 /*
@@ -539,16 +541,14 @@ xfs_buf_get(
 	if (likely(bp))
 		goto found;
 
-	new_bp = xfs_buf_allocate(flags);
+	new_bp = xfs_buf_alloc(target, ioff << BBSHIFT, isize << BBSHIFT,
+			       flags);
 	if (unlikely(!new_bp))
 		return NULL;
 
-	_xfs_buf_initialize(new_bp, target,
-			    ioff << BBSHIFT, isize << BBSHIFT, flags);
-
 	bp = _xfs_buf_find(target, ioff, isize, flags, new_bp);
 	if (!bp) {
-		xfs_buf_deallocate(new_bp);
+		kmem_zone_free(xfs_buf_zone, new_bp);
 		return NULL;
 	}
 
@@ -557,7 +557,7 @@ xfs_buf_get(
 		if (error)
 			goto no_buffer;
 	} else
-		xfs_buf_deallocate(new_bp);
+		kmem_zone_free(xfs_buf_zone, new_bp);
 
 	/*
 	 * Now we have a workable buffer, fill in the block number so
@@ -694,19 +694,6 @@ xfs_buf_read_uncached(
 	return bp;
 }
 
-xfs_buf_t *
-xfs_buf_get_empty(
-	size_t			len,
-	xfs_buftarg_t		*target)
-{
-	xfs_buf_t		*bp;
-
-	bp = xfs_buf_allocate(0);
-	if (bp)
-		_xfs_buf_initialize(bp, target, 0, len, 0);
-	return bp;
-}
-
 /*
  * Return a buffer allocated as an empty buffer and associated to external
  * memory via xfs_buf_associate_memory() back to it's empty state.
@@ -792,10 +779,9 @@ xfs_buf_get_uncached(
 	int			error, i;
 	xfs_buf_t		*bp;
 
-	bp = xfs_buf_allocate(0);
+	bp = xfs_buf_alloc(target, 0, len, 0);
 	if (unlikely(bp == NULL))
 		goto fail;
-	_xfs_buf_initialize(bp, target, 0, len, 0);
 
 	error = _xfs_buf_get_pages(bp, page_count, 0);
 	if (error)
@@ -823,7 +809,7 @@ xfs_buf_get_uncached(
 		__free_page(bp->b_pages[i]);
 	_xfs_buf_free_pages(bp);
  fail_free_buf:
-	xfs_buf_deallocate(bp);
+	kmem_zone_free(xfs_buf_zone, bp);
  fail:
 	return NULL;
 }
Index: xfs/fs/xfs/xfs_buf.h
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.h	2011-10-02 16:15:08.656771306 +0200
+++ xfs/fs/xfs/xfs_buf.h	2011-10-02 16:16:39.771770418 +0200
@@ -175,7 +175,8 @@ extern xfs_buf_t *xfs_buf_get(xfs_buftar
 extern xfs_buf_t *xfs_buf_read(xfs_buftarg_t *, xfs_off_t, size_t,
 				xfs_buf_flags_t);
 
-extern xfs_buf_t *xfs_buf_get_empty(size_t, xfs_buftarg_t *);
+struct xfs_buf *xfs_buf_alloc(struct xfs_buftarg *, xfs_off_t, size_t,
+			      xfs_buf_flags_t);
 extern void xfs_buf_set_empty(struct xfs_buf *bp, size_t len);
 extern xfs_buf_t *xfs_buf_get_uncached(struct xfs_buftarg *, size_t, int);
 extern int xfs_buf_associate_memory(xfs_buf_t *, void *, size_t);
Index: xfs/fs/xfs/xfs_log.c
===================================================================
--- xfs.orig/fs/xfs/xfs_log.c	2011-10-02 16:15:08.636789023 +0200
+++ xfs/fs/xfs/xfs_log.c	2011-10-02 16:15:36.039418844 +0200
@@ -1035,7 +1035,7 @@ xlog_alloc_log(xfs_mount_t	*mp,
 	xlog_get_iclog_buffer_size(mp, log);
 
 	error = ENOMEM;
-	bp = xfs_buf_get_empty(log->l_iclog_size, mp->m_logdev_targp);
+	bp = xfs_buf_alloc(mp->m_logdev_targp, 0, log->l_iclog_size, 0);
 	if (!bp)
 		goto out_free_log;
 	bp->b_iodone = xlog_iodone;

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 7/9] xfs: clean up xfs_ioerror_alert
  2011-10-06 21:06 [PATCH 0/9] a couple of buffer cache cleanups Christoph Hellwig
                   ` (5 preceding siblings ...)
  2011-10-06 21:06 ` [PATCH 6/9] xfs: clean up buffer allocation Christoph Hellwig
@ 2011-10-06 21:06 ` Christoph Hellwig
  2011-10-07  1:54   ` Dave Chinner
  2011-10-07 19:37   ` Alex Elder
  2011-10-06 21:06 ` [PATCH 8/9] xfs: use xfs_ioerror_alert in xfs_buf_iodone_callbacks Christoph Hellwig
  2011-10-06 21:06 ` [PATCH 9/9] xfs: remove xfs_buf_target_name Christoph Hellwig
  8 siblings, 2 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-06 21:06 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-cleanup-xfs_ioerror_alert --]
[-- Type: text/plain, Size: 9658 bytes --]

Instead of passing the block number and mount structure explicitly
get them off the bp and fix make the argument order more natural.

Also move it to xfs_buf.c and stop printing the device name given
that we already get the fs name as part of xfs_alert, and we know
what device is operates on because of the caller that gets printed.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/xfs_buf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.c	2011-10-06 14:37:14.990917966 -0400
+++ xfs/fs/xfs/xfs_buf.c	2011-10-06 14:44:36.051418694 -0400
@@ -1004,6 +1004,17 @@ xfs_buf_ioerror(
 	trace_xfs_buf_ioerror(bp, error, _RET_IP_);
 }
 
+void
+xfs_ioerror_alert(
+	struct xfs_buf		*bp,
+	char			*func)
+{
+	xfs_alert(bp->b_target->bt_mount,
+"metadata I/O error: block 0x%llx (\"%s\") error %d buf count %zd",
+		(__uint64_t)XFS_BUF_ADDR(bp), func,
+		bp->b_error, XFS_BUF_COUNT(bp));
+}
+
 int
 xfs_bwrite(
 	struct xfs_buf		*bp)
Index: xfs/fs/xfs/xfs_buf.h
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.h	2011-10-06 14:37:14.994920309 -0400
+++ xfs/fs/xfs/xfs_buf.h	2011-10-06 14:44:38.642962780 -0400
@@ -205,6 +205,7 @@ extern int xfs_bdstrat_cb(struct xfs_buf
 
 extern void xfs_buf_ioend(xfs_buf_t *,	int);
 extern void xfs_buf_ioerror(xfs_buf_t *, int);
+extern void xfs_ioerror_alert(struct xfs_buf *, char *func);
 extern int xfs_buf_iorequest(xfs_buf_t *);
 extern int xfs_buf_iowait(xfs_buf_t *);
 extern void xfs_buf_iomove(xfs_buf_t *, size_t, size_t, void *,
Index: xfs/fs/xfs/xfs_log.c
===================================================================
--- xfs.orig/fs/xfs/xfs_log.c	2011-10-06 14:37:14.994920309 -0400
+++ xfs/fs/xfs/xfs_log.c	2011-10-06 14:37:16.146918698 -0400
@@ -868,7 +868,7 @@ xlog_iodone(xfs_buf_t *bp)
 	 */
 	if (XFS_TEST_ERROR((xfs_buf_geterror(bp)), l->l_mp,
 			XFS_ERRTAG_IODONE_IOERR, XFS_RANDOM_IODONE_IOERR)) {
-		xfs_ioerror_alert("xlog_iodone", l->l_mp, bp, XFS_BUF_ADDR(bp));
+		xfs_ioerror_alert(bp, "xlog_iodone");
 		xfs_buf_stale(bp);
 		xfs_force_shutdown(l->l_mp, SHUTDOWN_LOG_IO_ERROR);
 		/*
@@ -1376,8 +1376,7 @@ xlog_sync(xlog_t		*log,
 	XFS_BUF_WRITE(bp);
 
 	if ((error = xlog_bdstrat(bp))) {
-		xfs_ioerror_alert("xlog_sync", log->l_mp, bp,
-				  XFS_BUF_ADDR(bp));
+		xfs_ioerror_alert(bp, "xlog_sync");
 		return error;
 	}
 	if (split) {
@@ -1412,8 +1411,7 @@ xlog_sync(xlog_t		*log,
 		XFS_BUF_SET_ADDR(bp, XFS_BUF_ADDR(bp) + log->l_logBBstart);
 		XFS_BUF_WRITE(bp);
 		if ((error = xlog_bdstrat(bp))) {
-			xfs_ioerror_alert("xlog_sync (split)", log->l_mp,
-					  bp, XFS_BUF_ADDR(bp));
+			xfs_ioerror_alert(bp, "xlog_sync (split)");
 			return error;
 		}
 	}
Index: xfs/fs/xfs/xfs_log_recover.c
===================================================================
--- xfs.orig/fs/xfs/xfs_log_recover.c	2011-10-06 14:37:11.026919015 -0400
+++ xfs/fs/xfs/xfs_log_recover.c	2011-10-06 14:37:16.150917922 -0400
@@ -183,8 +183,7 @@ xlog_bread_noalign(
 	xfsbdstrat(log->l_mp, bp);
 	error = xfs_buf_iowait(bp);
 	if (error)
-		xfs_ioerror_alert("xlog_bread", log->l_mp,
-				  bp, XFS_BUF_ADDR(bp));
+		xfs_ioerror_alert(bp, "xlog_bread");
 	return error;
 }
 
@@ -269,10 +268,8 @@ xlog_bwrite(
 	XFS_BUF_SET_COUNT(bp, BBTOB(nbblks));
 
 	error = xfs_bwrite(bp);
-	if (error) {
-		xfs_ioerror_alert("xlog_bwrite", log->l_mp,
-				  bp, XFS_BUF_ADDR(bp));
-	}
+	if (error)
+		xfs_ioerror_alert(bp, "xlog_bwrite");
 	xfs_buf_relse(bp);
 	return error;
 }
@@ -364,9 +361,7 @@ xlog_recover_iodone(
 		 * We're not going to bother about retrying
 		 * this during recovery. One strike!
 		 */
-		xfs_ioerror_alert("xlog_recover_iodone",
-					bp->b_target->bt_mount, bp,
-					XFS_BUF_ADDR(bp));
+		xfs_ioerror_alert(bp, "xlog_recover_iodone");
 		xfs_force_shutdown(bp->b_target->bt_mount,
 					SHUTDOWN_META_IO_ERROR);
 	}
@@ -2138,8 +2133,7 @@ xlog_recover_buffer_pass2(
 		return XFS_ERROR(ENOMEM);
 	error = bp->b_error;
 	if (error) {
-		xfs_ioerror_alert("xlog_recover_do..(read#1)", mp,
-				  bp, buf_f->blf_blkno);
+		xfs_ioerror_alert(bp, "xlog_recover_do..(read#1)");
 		xfs_buf_relse(bp);
 		return error;
 	}
@@ -2234,8 +2228,7 @@ xlog_recover_inode_pass2(
 	}
 	error = bp->b_error;
 	if (error) {
-		xfs_ioerror_alert("xlog_recover_do..(read#2)", mp,
-				  bp, in_f->ilf_blkno);
+		xfs_ioerror_alert(bp, "xlog_recover_do..(read#2)");
 		xfs_buf_relse(bp);
 		goto error;
 	}
@@ -2542,8 +2535,7 @@ xlog_recover_dquot_pass2(
 			     XFS_FSB_TO_BB(mp, dq_f->qlf_len),
 			     0, &bp);
 	if (error) {
-		xfs_ioerror_alert("xlog_recover_do..(read#3)", mp,
-				  bp, dq_f->qlf_blkno);
+		xfs_ioerror_alert(bp, "xlog_recover_do..(read#3)");
 		return error;
 	}
 	ASSERT(bp);
@@ -3695,8 +3687,7 @@ xlog_do_recover(
 	xfsbdstrat(log->l_mp, bp);
 	error = xfs_buf_iowait(bp);
 	if (error) {
-		xfs_ioerror_alert("xlog_do_recover",
-				  log->l_mp, bp, XFS_BUF_ADDR(bp));
+		xfs_ioerror_alert(bp, "xlog_do_recover");
 		ASSERT(0);
 		xfs_buf_relse(bp);
 		return error;
Index: xfs/fs/xfs/xfs_mount.c
===================================================================
--- xfs.orig/fs/xfs/xfs_mount.c	2011-10-06 14:36:42.798967363 -0400
+++ xfs/fs/xfs/xfs_mount.c	2011-10-06 14:37:16.154918042 -0400
@@ -1610,8 +1610,7 @@ xfs_unmountfs_writesb(xfs_mount_t *mp)
 		xfsbdstrat(mp, sbp);
 		error = xfs_buf_iowait(sbp);
 		if (error)
-			xfs_ioerror_alert("xfs_unmountfs_writesb",
-					  mp, sbp, XFS_BUF_ADDR(sbp));
+			xfs_ioerror_alert(sbp, "xfs_unmountfs_writesb");
 		xfs_buf_relse(sbp);
 	}
 	return error;
Index: xfs/fs/xfs/xfs_rw.c
===================================================================
--- xfs.orig/fs/xfs/xfs_rw.c	2011-10-06 14:37:13.682917913 -0400
+++ xfs/fs/xfs/xfs_rw.c	2011-10-06 14:37:16.154918042 -0400
@@ -92,24 +92,6 @@ xfs_do_force_shutdown(
 }
 
 /*
- * Prints out an ALERT message about I/O error.
- */
-void
-xfs_ioerror_alert(
-	char			*func,
-	struct xfs_mount	*mp,
-	xfs_buf_t		*bp,
-	xfs_daddr_t		blkno)
-{
-	xfs_alert(mp,
-		 "I/O error occurred: meta-data dev %s block 0x%llx"
-		 "       (\"%s\") error %d buf count %zd",
-		xfs_buf_target_name(bp->b_target),
-		(__uint64_t)blkno, func,
-		bp->b_error, XFS_BUF_COUNT(bp));
-}
-
-/*
  * This isn't an absolute requirement, but it is
  * just a good idea to call xfs_read_buf instead of
  * directly doing a read_buf call. For one, we shouldn't
@@ -143,7 +125,7 @@ xfs_read_buf(
 	} else {
 		*bpp = NULL;
 		if (error) {
-			xfs_ioerror_alert("xfs_read_buf", mp, bp, XFS_BUF_ADDR(bp));
+			xfs_ioerror_alert(bp, "xfs_read_buf");
 		} else {
 			error = XFS_ERROR(EIO);
 		}
Index: xfs/fs/xfs/xfs_rw.h
===================================================================
--- xfs.orig/fs/xfs/xfs_rw.h	2011-10-04 16:05:09.378969777 -0400
+++ xfs/fs/xfs/xfs_rw.h	2011-10-06 14:37:16.154918042 -0400
@@ -42,8 +42,6 @@ xfs_fsb_to_db(struct xfs_inode *ip, xfs_
 extern int xfs_read_buf(struct xfs_mount *mp, xfs_buftarg_t *btp,
 			xfs_daddr_t blkno, int len, uint flags,
 			struct xfs_buf **bpp);
-extern void xfs_ioerror_alert(char *func, struct xfs_mount *mp,
-				xfs_buf_t *bp, xfs_daddr_t blkno);
 extern xfs_extlen_t xfs_get_extsz_hint(struct xfs_inode *ip);
 
 #endif /* __XFS_RW_H__ */
Index: xfs/fs/xfs/xfs_trans_buf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_trans_buf.c	2011-10-06 14:37:13.686917964 -0400
+++ xfs/fs/xfs/xfs_trans_buf.c	2011-10-06 14:37:16.158920043 -0400
@@ -296,8 +296,7 @@ xfs_trans_read_buf(
 
 		if (bp->b_error) {
 			error = bp->b_error;
-			xfs_ioerror_alert("xfs_trans_read_buf", mp,
-					  bp, blkno);
+			xfs_ioerror_alert(bp, "xfs_trans_read_buf");
 			xfs_buf_relse(bp);
 			return error;
 		}
@@ -339,8 +338,7 @@ xfs_trans_read_buf(
 			xfsbdstrat(tp->t_mountp, bp);
 			error = xfs_buf_iowait(bp);
 			if (error) {
-				xfs_ioerror_alert("xfs_trans_read_buf", mp,
-						  bp, blkno);
+				xfs_ioerror_alert(bp, "xfs_trans_read_buf");
 				xfs_buf_relse(bp);
 				/*
 				 * We can gracefully recover from most read
@@ -391,8 +389,7 @@ xfs_trans_read_buf(
 		error = bp->b_error;
 		xfs_buf_stale(bp);
 		XFS_BUF_DONE(bp);
-		xfs_ioerror_alert("xfs_trans_read_buf", mp,
-				  bp, blkno);
+		xfs_ioerror_alert(bp, "xfs_trans_read_buf");
 		if (tp->t_flags & XFS_TRANS_DIRTY)
 			xfs_force_shutdown(tp->t_mountp, SHUTDOWN_META_IO_ERROR);
 		xfs_buf_relse(bp);
Index: xfs/fs/xfs/xfs_vnodeops.c
===================================================================
--- xfs.orig/fs/xfs/xfs_vnodeops.c	2011-10-06 14:36:42.855920118 -0400
+++ xfs/fs/xfs/xfs_vnodeops.c	2011-10-06 14:37:16.162917089 -0400
@@ -87,8 +87,7 @@ xfs_readlink_bmap(
 			return XFS_ERROR(ENOMEM);
 		error = bp->b_error;
 		if (error) {
-			xfs_ioerror_alert("xfs_readlink",
-				  ip->i_mount, bp, XFS_BUF_ADDR(bp));
+			xfs_ioerror_alert(bp, "xfs_readlink");
 			xfs_buf_relse(bp);
 			goto out;
 		}
@@ -1993,8 +1992,7 @@ xfs_zero_remaining_bytes(
 		xfsbdstrat(mp, bp);
 		error = xfs_buf_iowait(bp);
 		if (error) {
-			xfs_ioerror_alert("xfs_zero_remaining_bytes(read)",
-					  mp, bp, XFS_BUF_ADDR(bp));
+			xfs_ioerror_alert(bp, "xfs_zero_remaining_bytes(read)");
 			break;
 		}
 		memset(bp->b_addr +
@@ -2006,8 +2004,7 @@ xfs_zero_remaining_bytes(
 		xfsbdstrat(mp, bp);
 		error = xfs_buf_iowait(bp);
 		if (error) {
-			xfs_ioerror_alert("xfs_zero_remaining_bytes(write)",
-					  mp, bp, XFS_BUF_ADDR(bp));
+			xfs_ioerror_alert(bp, "xfs_zero_remaining_bytes(write)");
 			break;
 		}
 	}

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 8/9] xfs: use xfs_ioerror_alert in xfs_buf_iodone_callbacks
  2011-10-06 21:06 [PATCH 0/9] a couple of buffer cache cleanups Christoph Hellwig
                   ` (6 preceding siblings ...)
  2011-10-06 21:06 ` [PATCH 7/9] xfs: clean up xfs_ioerror_alert Christoph Hellwig
@ 2011-10-06 21:06 ` Christoph Hellwig
  2011-10-07  1:55   ` Dave Chinner
  2011-10-07 19:37   ` Alex Elder
  2011-10-06 21:06 ` [PATCH 9/9] xfs: remove xfs_buf_target_name Christoph Hellwig
  8 siblings, 2 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-06 21:06 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-cleanup-xfs_buf_iodone_callbacks --]
[-- Type: text/plain, Size: 864 bytes --]

Use xfs_ioerror_alert instead of opencoding a very similar error
message.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/xfs_buf_item.c
===================================================================
--- xfs.orig/fs/xfs/xfs_buf_item.c	2011-10-06 16:56:55.324148672 -0400
+++ xfs/fs/xfs/xfs_buf_item.c	2011-10-06 16:57:04.444144227 -0400
@@ -976,9 +976,7 @@ xfs_buf_iodone_callbacks(
 	if (bp->b_target != lasttarg ||
 	    time_after(jiffies, (lasttime + 5*HZ))) {
 		lasttime = jiffies;
-		xfs_alert(mp, "Device %s: metadata write error block 0x%llx",
-			xfs_buf_target_name(bp->b_target),
-		      (__uint64_t)XFS_BUF_ADDR(bp));
+		xfs_ioerror_alert(bp, "xfs_buf_iodone_callbacks");
 	}
 	lasttarg = bp->b_target;
 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [PATCH 9/9] xfs: remove xfs_buf_target_name
  2011-10-06 21:06 [PATCH 0/9] a couple of buffer cache cleanups Christoph Hellwig
                   ` (7 preceding siblings ...)
  2011-10-06 21:06 ` [PATCH 8/9] xfs: use xfs_ioerror_alert in xfs_buf_iodone_callbacks Christoph Hellwig
@ 2011-10-06 21:06 ` Christoph Hellwig
  2011-10-07  1:57   ` Dave Chinner
  2011-10-07 19:37   ` Alex Elder
  8 siblings, 2 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-06 21:06 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: xfs-kill-xfs_buf_target_name --]
[-- Type: text/plain, Size: 1560 bytes --]

The calling convention that returns a pointer to a static buffer is
fairly nasty, so just opencode it in the only caller that is left.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: xfs/fs/xfs/xfs_buf.c
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.c	2011-10-06 14:37:16.142921041 -0400
+++ xfs/fs/xfs/xfs_buf.c	2011-10-06 14:37:17.846921461 -0400
@@ -1457,9 +1457,13 @@ xfs_setsize_buftarg_flags(
 	btp->bt_smask = sectorsize - 1;
 
 	if (set_blocksize(btp->bt_bdev, sectorsize)) {
+		static char name[BDEVNAME_SIZE];
+
+		bdevname(btp->bt_bdev, name);
+
 		xfs_warn(btp->bt_mount,
 			"Cannot set_blocksize to %u on device %s\n",
-			sectorsize, xfs_buf_target_name(btp));
+			sectorsize, name);
 		return EINVAL;
 	}
 
Index: xfs/fs/xfs/xfs_buf.h
===================================================================
--- xfs.orig/fs/xfs/xfs_buf.h	2011-10-06 14:37:16.142921041 -0400
+++ xfs/fs/xfs/xfs_buf.h	2011-10-06 14:37:17.850917164 -0400
@@ -230,15 +230,6 @@ extern void xfs_buf_delwri_promote(struc
 extern int xfs_buf_init(void);
 extern void xfs_buf_terminate(void);
 
-static inline const char *
-xfs_buf_target_name(struct xfs_buftarg *target)
-{
-	static char __b[BDEVNAME_SIZE];
-
-	return bdevname(target->bt_bdev, __b);
-}
-
-
 #define XFS_BUF_ZEROFLAGS(bp) \
 	((bp)->b_flags &= ~(XBF_READ|XBF_WRITE|XBF_ASYNC|XBF_DELWRI| \
 			    XBF_SYNCIO|XBF_FUA|XBF_FLUSH))

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/9] xfs: remove xfs_get_buftarg_list
  2011-10-06 21:06 ` [PATCH 1/9] xfs: remove xfs_get_buftarg_list Christoph Hellwig
@ 2011-10-07  1:38   ` Dave Chinner
  2011-10-07 19:36   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Dave Chinner @ 2011-10-07  1:38 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, Oct 06, 2011 at 05:06:08PM -0400, Christoph Hellwig wrote:
> The code is unused and under a config option that doesn't exist, remove it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/9] xfs: remove XFS_BUF_FINISH_IOWAIT
  2011-10-06 21:06 ` [PATCH 2/9] xfs: remove XFS_BUF_FINISH_IOWAIT Christoph Hellwig
@ 2011-10-07  1:38   ` Dave Chinner
  2011-10-07 19:36   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Dave Chinner @ 2011-10-07  1:38 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, Oct 06, 2011 at 05:06:09PM -0400, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Dave Chinner <david@fromorbit.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/9] xfs: remove XFS_BUF_SET_VTYPE and XFS_BUF_SET_VTYPE_REF
  2011-10-06 21:06 ` [PATCH 3/9] xfs: remove XFS_BUF_SET_VTYPE and XFS_BUF_SET_VTYPE_REF Christoph Hellwig
@ 2011-10-07  1:40   ` Dave Chinner
  2011-10-07 19:36   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Dave Chinner @ 2011-10-07  1:40 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, Oct 06, 2011 at 05:06:10PM -0400, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Yeah, we don't need the type for the CRC code as I thought we might,
so getting rid of it is fine.

Reviewed-by: Dave Chinner <david@fromorbit.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/9] xfs: remove XFS_BUF_STALE and XFS_BUF_SUPER_STALE
  2011-10-06 21:06 ` [PATCH 4/9] xfs: remove XFS_BUF_STALE and XFS_BUF_SUPER_STALE Christoph Hellwig
@ 2011-10-07  1:41   ` Dave Chinner
  2011-10-07 19:36   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Dave Chinner @ 2011-10-07  1:41 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, Oct 06, 2011 at 05:06:11PM -0400, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 5/9] xfs: remove buffers from the delwri list in xfs_buf_stale
  2011-10-06 21:06 ` [PATCH 5/9] xfs: remove buffers from the delwri list in xfs_buf_stale Christoph Hellwig
@ 2011-10-07  1:45   ` Dave Chinner
  2011-10-07 19:36   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Dave Chinner @ 2011-10-07  1:45 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, Oct 06, 2011 at 05:06:12PM -0400, Christoph Hellwig wrote:
> For each call to xfs_buf_stale we call xfs_buf_delwri_dequeue either
> directly before or after it, or are guaranteed by the surrounding
> conditionals that we are never called on delwri buffers.  Simply
> this situation by moving the call to xfs_buf_delwri_dequeue into
> xfs_buf_stale.

Makes sense, and delwri-dequeue is safe to call on non-delwri
buffers.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 6/9] xfs: clean up buffer allocation
  2011-10-06 21:06 ` [PATCH 6/9] xfs: clean up buffer allocation Christoph Hellwig
@ 2011-10-07  1:48   ` Dave Chinner
  2011-10-07 19:37   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Dave Chinner @ 2011-10-07  1:48 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, Oct 06, 2011 at 05:06:13PM -0400, Christoph Hellwig wrote:
> Change _xfs_buf_initialize to allocate the buffer directly and rename it to
> xfs_buf_alloc now that is the only buffer allocation routine.  Also remove
> the xfs_buf_deallocate wrapper around the kmem_zone_free calls for buffers.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Cleans up the flow of the code quite a bit. Nice.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 7/9] xfs: clean up xfs_ioerror_alert
  2011-10-06 21:06 ` [PATCH 7/9] xfs: clean up xfs_ioerror_alert Christoph Hellwig
@ 2011-10-07  1:54   ` Dave Chinner
  2011-10-07 14:17     ` Christoph Hellwig
  2011-10-07 19:37   ` Alex Elder
  1 sibling, 1 reply; 30+ messages in thread
From: Dave Chinner @ 2011-10-07  1:54 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, Oct 06, 2011 at 05:06:14PM -0400, Christoph Hellwig wrote:
> Instead of passing the block number and mount structure explicitly
> get them off the bp and fix make the argument order more natural.
> 
> Also move it to xfs_buf.c and stop printing the device name given
> that we already get the fs name as part of xfs_alert, and we know
> what device is operates on because of the caller that gets printed.
> 

Only thing I'm wondering about is whether is should be renamed
xfs_buf_ioerror_alert(), now that it really is a xfs_buf specific
function?

Also, many of the callers could probably pass __func__ rather than a
manually set string...

Otherwise, another nice cleanup.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 8/9] xfs: use xfs_ioerror_alert in xfs_buf_iodone_callbacks
  2011-10-06 21:06 ` [PATCH 8/9] xfs: use xfs_ioerror_alert in xfs_buf_iodone_callbacks Christoph Hellwig
@ 2011-10-07  1:55   ` Dave Chinner
  2011-10-07 19:37   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Dave Chinner @ 2011-10-07  1:55 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, Oct 06, 2011 at 05:06:15PM -0400, Christoph Hellwig wrote:
> Use xfs_ioerror_alert instead of opencoding a very similar error
> message.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 9/9] xfs: remove xfs_buf_target_name
  2011-10-06 21:06 ` [PATCH 9/9] xfs: remove xfs_buf_target_name Christoph Hellwig
@ 2011-10-07  1:57   ` Dave Chinner
  2011-10-07 19:37   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Dave Chinner @ 2011-10-07  1:57 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, Oct 06, 2011 at 05:06:16PM -0400, Christoph Hellwig wrote:
> The calling convention that returns a pointer to a static buffer is
> fairly nasty, so just opencode it in the only caller that is left.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 7/9] xfs: clean up xfs_ioerror_alert
  2011-10-07  1:54   ` Dave Chinner
@ 2011-10-07 14:17     ` Christoph Hellwig
  0 siblings, 0 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-07 14:17 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Christoph Hellwig, xfs

On Fri, Oct 07, 2011 at 12:54:41PM +1100, Dave Chinner wrote:
> Only thing I'm wondering about is whether is should be renamed
> xfs_buf_ioerror_alert(), now that it really is a xfs_buf specific
> function?

That probably is a better name.  There are a few other functions in the
buffer code that are misnamed like that e.g. xfs_incore and to a lesser
extent xfs_bwrite or XFS_bflush.

> Also, many of the callers could probably pass __func__ rather than a
> manually set string...

True.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 1/9] xfs: remove xfs_get_buftarg_list
  2011-10-06 21:06 ` [PATCH 1/9] xfs: remove xfs_get_buftarg_list Christoph Hellwig
  2011-10-07  1:38   ` Dave Chinner
@ 2011-10-07 19:36   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Alex Elder @ 2011-10-07 19:36 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, 2011-10-06 at 17:06 -0400, Christoph Hellwig wrote:
> The code is unused and under a config option that doesn't exist, remove it.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good.

Reviewed-by: Alex Elder <aelder@sgi.com>


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 2/9] xfs: remove XFS_BUF_FINISH_IOWAIT
  2011-10-06 21:06 ` [PATCH 2/9] xfs: remove XFS_BUF_FINISH_IOWAIT Christoph Hellwig
  2011-10-07  1:38   ` Dave Chinner
@ 2011-10-07 19:36   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Alex Elder @ 2011-10-07 19:36 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, 2011-10-06 at 17:06 -0400, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good.

Reviewed-by: Alex Elder <aelder@sgi.com>


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 3/9] xfs: remove XFS_BUF_SET_VTYPE and XFS_BUF_SET_VTYPE_REF
  2011-10-06 21:06 ` [PATCH 3/9] xfs: remove XFS_BUF_SET_VTYPE and XFS_BUF_SET_VTYPE_REF Christoph Hellwig
  2011-10-07  1:40   ` Dave Chinner
@ 2011-10-07 19:36   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Alex Elder @ 2011-10-07 19:36 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, 2011-10-06 at 17:06 -0400, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good.

Reviewed-by: Alex Elder <aelder@sgi.com>


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 4/9] xfs: remove XFS_BUF_STALE and XFS_BUF_SUPER_STALE
  2011-10-06 21:06 ` [PATCH 4/9] xfs: remove XFS_BUF_STALE and XFS_BUF_SUPER_STALE Christoph Hellwig
  2011-10-07  1:41   ` Dave Chinner
@ 2011-10-07 19:36   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Alex Elder @ 2011-10-07 19:36 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, 2011-10-06 at 17:06 -0400, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good.

Reviewed-by: Alex Elder <aelder@sgi.com>


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 5/9] xfs: remove buffers from the delwri list in xfs_buf_stale
  2011-10-06 21:06 ` [PATCH 5/9] xfs: remove buffers from the delwri list in xfs_buf_stale Christoph Hellwig
  2011-10-07  1:45   ` Dave Chinner
@ 2011-10-07 19:36   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Alex Elder @ 2011-10-07 19:36 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, 2011-10-06 at 17:06 -0400, Christoph Hellwig wrote:
> For each call to xfs_buf_stale we call xfs_buf_delwri_dequeue either
> directly before or after it, or are guaranteed by the surrounding
> conditionals that we are never called on delwri buffers.  Simply
> this situation by moving the call to xfs_buf_delwri_dequeue into
> xfs_buf_stale.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

I see 6 or so spots where xfs_buf_stale() is (was) called with no call
to xfs_buf_delwri_dequeue().  This adds such a call, but it looks to me
like that's OK.

Looks good.

Reviewed-by: Alex Elder <aelder@sgi.com>


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 6/9] xfs: clean up buffer allocation
  2011-10-06 21:06 ` [PATCH 6/9] xfs: clean up buffer allocation Christoph Hellwig
  2011-10-07  1:48   ` Dave Chinner
@ 2011-10-07 19:37   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Alex Elder @ 2011-10-07 19:37 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, 2011-10-06 at 17:06 -0400, Christoph Hellwig wrote:
> Change _xfs_buf_initialize to allocate the buffer directly and rename it to
> xfs_buf_alloc now that is the only buffer allocation routine.  Also remove
> the xfs_buf_deallocate wrapper around the kmem_zone_free calls for buffers.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good.

Reviewed-by: Alex Elder <aelder@sgi.com>


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 7/9] xfs: clean up xfs_ioerror_alert
  2011-10-06 21:06 ` [PATCH 7/9] xfs: clean up xfs_ioerror_alert Christoph Hellwig
  2011-10-07  1:54   ` Dave Chinner
@ 2011-10-07 19:37   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Alex Elder @ 2011-10-07 19:37 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, 2011-10-06 at 17:06 -0400, Christoph Hellwig wrote:
> Instead of passing the block number and mount structure explicitly
> get them off the bp and fix make the argument order more natural.
> 
> Also move it to xfs_buf.c and stop printing the device name given
> that we already get the fs name as part of xfs_alert, and we know
> what device is operates on because of the caller that gets printed.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

I agree on the name change suggestion, possibly to
xfs_buf_error_alert().  Also, with just one exception
it seems that the "func" argument is simply the name
of the calling function.  I would favor adding that
via passing __func__ in a macro.  If distinguishing
between the cases in xlog_sync(), xfs_trans_read_buf(),
and xfs_zero_remaining_bytes() were important then
the line number could be included.

Anyway, looks good.

Reviewed-by: Alex Elder <aelder@sgi.com>


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 8/9] xfs: use xfs_ioerror_alert in xfs_buf_iodone_callbacks
  2011-10-06 21:06 ` [PATCH 8/9] xfs: use xfs_ioerror_alert in xfs_buf_iodone_callbacks Christoph Hellwig
  2011-10-07  1:55   ` Dave Chinner
@ 2011-10-07 19:37   ` Alex Elder
  1 sibling, 0 replies; 30+ messages in thread
From: Alex Elder @ 2011-10-07 19:37 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, 2011-10-06 at 17:06 -0400, Christoph Hellwig wrote:
> Use xfs_ioerror_alert instead of opencoding a very similar error
> message.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good.

Reviewed-by: Alex Elder <aelder@sgi.com>


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 9/9] xfs: remove xfs_buf_target_name
  2011-10-06 21:06 ` [PATCH 9/9] xfs: remove xfs_buf_target_name Christoph Hellwig
  2011-10-07  1:57   ` Dave Chinner
@ 2011-10-07 19:37   ` Alex Elder
  2011-10-07 20:10     ` Christoph Hellwig
  1 sibling, 1 reply; 30+ messages in thread
From: Alex Elder @ 2011-10-07 19:37 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Thu, 2011-10-06 at 17:06 -0400, Christoph Hellwig wrote:
> The calling convention that returns a pointer to a static buffer is
> fairly nasty, so just opencode it in the only caller that is left.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Yay!  The name buffer needs not to be static any more though.
I will remove it for you unless you want to re-post it.

Other than that, looks good.

Reviewed-by: Alex Elder <aelder@sgi.com>


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [PATCH 9/9] xfs: remove xfs_buf_target_name
  2011-10-07 19:37   ` Alex Elder
@ 2011-10-07 20:10     ` Christoph Hellwig
  0 siblings, 0 replies; 30+ messages in thread
From: Christoph Hellwig @ 2011-10-07 20:10 UTC (permalink / raw)
  To: Alex Elder; +Cc: xfs

On Fri, Oct 07, 2011 at 02:37:23PM -0500, Alex Elder wrote:
> On Thu, 2011-10-06 at 17:06 -0400, Christoph Hellwig wrote:
> > The calling convention that returns a pointer to a static buffer is
> > fairly nasty, so just opencode it in the only caller that is left.
> > 
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Yay!  The name buffer needs not to be static any more though.
> I will remove it for you unless you want to re-post it.
> 
> Other than that, looks good.

I'll resping the series with this and the naming change.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2011-10-07 20:10 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-06 21:06 [PATCH 0/9] a couple of buffer cache cleanups Christoph Hellwig
2011-10-06 21:06 ` [PATCH 1/9] xfs: remove xfs_get_buftarg_list Christoph Hellwig
2011-10-07  1:38   ` Dave Chinner
2011-10-07 19:36   ` Alex Elder
2011-10-06 21:06 ` [PATCH 2/9] xfs: remove XFS_BUF_FINISH_IOWAIT Christoph Hellwig
2011-10-07  1:38   ` Dave Chinner
2011-10-07 19:36   ` Alex Elder
2011-10-06 21:06 ` [PATCH 3/9] xfs: remove XFS_BUF_SET_VTYPE and XFS_BUF_SET_VTYPE_REF Christoph Hellwig
2011-10-07  1:40   ` Dave Chinner
2011-10-07 19:36   ` Alex Elder
2011-10-06 21:06 ` [PATCH 4/9] xfs: remove XFS_BUF_STALE and XFS_BUF_SUPER_STALE Christoph Hellwig
2011-10-07  1:41   ` Dave Chinner
2011-10-07 19:36   ` Alex Elder
2011-10-06 21:06 ` [PATCH 5/9] xfs: remove buffers from the delwri list in xfs_buf_stale Christoph Hellwig
2011-10-07  1:45   ` Dave Chinner
2011-10-07 19:36   ` Alex Elder
2011-10-06 21:06 ` [PATCH 6/9] xfs: clean up buffer allocation Christoph Hellwig
2011-10-07  1:48   ` Dave Chinner
2011-10-07 19:37   ` Alex Elder
2011-10-06 21:06 ` [PATCH 7/9] xfs: clean up xfs_ioerror_alert Christoph Hellwig
2011-10-07  1:54   ` Dave Chinner
2011-10-07 14:17     ` Christoph Hellwig
2011-10-07 19:37   ` Alex Elder
2011-10-06 21:06 ` [PATCH 8/9] xfs: use xfs_ioerror_alert in xfs_buf_iodone_callbacks Christoph Hellwig
2011-10-07  1:55   ` Dave Chinner
2011-10-07 19:37   ` Alex Elder
2011-10-06 21:06 ` [PATCH 9/9] xfs: remove xfs_buf_target_name Christoph Hellwig
2011-10-07  1:57   ` Dave Chinner
2011-10-07 19:37   ` Alex Elder
2011-10-07 20:10     ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.