From: Christoph Hellwig <hch@infradead.org>
To: xfs@oss.sgi.com
Subject: Re: [patch 15/22] replace b_fspriv with b_mount
Date: Wed, 3 Dec 2008 09:03:31 -0500 [thread overview]
Message-ID: <20081203140331.GA28361@infradead.org> (raw)
In-Reply-To: <20081202160651.749289000@bombadil.infradead.org>
Any chance to get this one reviewed?
On Tue, Dec 02, 2008 at 11:04:45AM -0500, Christoph Hellwig wrote:
> Replace the b_fspriv pointer and it's ugly accessors with a properly types
> xfs_mount pointer. Also switch log reocvery over to it instead of using
> b_fspriv for the mount pointer.
>
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_buf.c
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_buf.c 2008-11-15 15:27:32.000000000 +0100
> +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_buf.c 2008-11-15 15:28:01.000000000 +0100
> @@ -1085,7 +1085,7 @@ xfs_bawrite(
> bp->b_flags &= ~(XBF_READ | XBF_DELWRI | XBF_READ_AHEAD);
> bp->b_flags |= (XBF_WRITE | XBF_ASYNC | _XBF_RUN_QUEUES);
>
> - bp->b_fspriv3 = mp;
> + bp->b_mount = mp;
> bp->b_strat = xfs_bdstrat_cb;
> return xfs_bdstrat_cb(bp);
> }
> @@ -1098,7 +1098,7 @@ xfs_bdwrite(
> XB_TRACE(bp, "bdwrite", 0);
>
> bp->b_strat = xfs_bdstrat_cb;
> - bp->b_fspriv3 = mp;
> + bp->b_mount = mp;
>
> bp->b_flags &= ~XBF_READ;
> bp->b_flags |= (XBF_DELWRI | XBF_ASYNC);
> Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_buf.h
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_buf.h 2008-11-15 15:28:08.000000000 +0100
> +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_buf.h 2008-11-15 15:29:12.000000000 +0100
> @@ -168,7 +168,7 @@ typedef struct xfs_buf {
> struct completion b_iowait; /* queue for I/O waiters */
> void *b_fspriv;
> void *b_fspriv2;
> - void *b_fspriv3;
> + struct xfs_mount *b_mount;
> unsigned short b_error; /* error code on I/O */
> unsigned int b_page_count; /* size of page array */
> unsigned int b_offset; /* page offset in first page */
> @@ -335,8 +335,6 @@ extern void xfs_buf_trace(xfs_buf_t *, c
> #define XFS_BUF_SET_FSPRIVATE(bp, val) ((bp)->b_fspriv = (void*)(val))
> #define XFS_BUF_FSPRIVATE2(bp, type) ((type)(bp)->b_fspriv2)
> #define XFS_BUF_SET_FSPRIVATE2(bp, val) ((bp)->b_fspriv2 = (void*)(val))
> -#define XFS_BUF_FSPRIVATE3(bp, type) ((type)(bp)->b_fspriv3)
> -#define XFS_BUF_SET_FSPRIVATE3(bp, val) ((bp)->b_fspriv3 = (void*)(val))
> #define XFS_BUF_SET_START(bp) do { } while (0)
> #define XFS_BUF_SET_BRELSE_FUNC(bp, func) ((bp)->b_relse = (func))
>
> Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2008-11-15 15:25:29.000000000 +0100
> +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c 2008-11-15 15:26:27.000000000 +0100
> @@ -847,13 +847,7 @@ retry:
> int
> xfs_bdstrat_cb(struct xfs_buf *bp)
> {
> - xfs_mount_t *mp;
> -
> - mp = XFS_BUF_FSPRIVATE3(bp, xfs_mount_t *);
> - if (!XFS_FORCED_SHUTDOWN(mp)) {
> - xfs_buf_iorequest(bp);
> - return 0;
> - } else {
> + if (XFS_FORCED_SHUTDOWN(bp->b_mount)) {
> xfs_buftrace("XFS__BDSTRAT IOERROR", bp);
> /*
> * Metadata write that didn't get logged but
> @@ -866,6 +860,9 @@ xfs_bdstrat_cb(struct xfs_buf *bp)
> else
> return (xfs_bioerror(bp));
> }
> +
> + xfs_buf_iorequest(bp);
> + return 0;
> }
>
> /*
> Index: linux-2.6-xfs/fs/xfs/xfs_buf_item.c
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/xfs_buf_item.c 2008-11-15 15:24:38.000000000 +0100
> +++ linux-2.6-xfs/fs/xfs/xfs_buf_item.c 2008-11-15 15:25:05.000000000 +0100
> @@ -707,8 +707,8 @@ xfs_buf_item_init(
> * the first. If we do already have one, there is
> * nothing to do here so return.
> */
> - if (XFS_BUF_FSPRIVATE3(bp, xfs_mount_t *) != mp)
> - XFS_BUF_SET_FSPRIVATE3(bp, mp);
> + if (bp->b_mount != mp)
> + bp->b_mount = mp;
> XFS_BUF_SET_BDSTRAT_FUNC(bp, xfs_bdstrat_cb);
> if (XFS_BUF_FSPRIVATE(bp, void *) != NULL) {
> lip = XFS_BUF_FSPRIVATE(bp, xfs_log_item_t *);
> Index: linux-2.6-xfs/fs/xfs/xfs_rw.c
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/xfs_rw.c 2008-11-15 15:26:37.000000000 +0100
> +++ linux-2.6-xfs/fs/xfs/xfs_rw.c 2008-11-15 15:27:17.000000000 +0100
> @@ -406,7 +406,7 @@ xfs_bwrite(
> * XXXsup how does this work for quotas.
> */
> XFS_BUF_SET_BDSTRAT_FUNC(bp, xfs_bdstrat_cb);
> - XFS_BUF_SET_FSPRIVATE3(bp, mp);
> + bp->b_mount = mp;
> XFS_BUF_WRITE(bp);
>
> if ((error = XFS_bwrite(bp))) {
> Index: linux-2.6-xfs/fs/xfs/xfs_log_recover.c
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/xfs_log_recover.c 2008-11-15 15:31:41.000000000 +0100
> +++ linux-2.6-xfs/fs/xfs/xfs_log_recover.c 2008-11-15 15:35:12.000000000 +0100
> @@ -267,21 +267,16 @@ STATIC void
> xlog_recover_iodone(
> struct xfs_buf *bp)
> {
> - xfs_mount_t *mp;
> -
> - ASSERT(XFS_BUF_FSPRIVATE(bp, void *));
> -
> if (XFS_BUF_GETERROR(bp)) {
> /*
> * We're not going to bother about retrying
> * this during recovery. One strike!
> */
> - mp = XFS_BUF_FSPRIVATE(bp, xfs_mount_t *);
> xfs_ioerror_alert("xlog_recover_iodone",
> - mp, bp, XFS_BUF_ADDR(bp));
> - xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
> + bp->b_mount, bp, XFS_BUF_ADDR(bp));
> + xfs_force_shutdown(bp->b_mount, SHUTDOWN_META_IO_ERROR);
> }
> - XFS_BUF_SET_FSPRIVATE(bp, NULL);
> + bp->b_mount = NULL;
> XFS_BUF_CLR_IODONE_FUNC(bp);
> xfs_biodone(bp);
> }
> @@ -2225,9 +2220,8 @@ xlog_recover_do_buffer_trans(
> XFS_BUF_STALE(bp);
> error = xfs_bwrite(mp, bp);
> } else {
> - ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL ||
> - XFS_BUF_FSPRIVATE(bp, xfs_mount_t *) == mp);
> - XFS_BUF_SET_FSPRIVATE(bp, mp);
> + ASSERT(bp->b_mount == NULL || bp->b_mount == mp);
> + bp->b_mount = mp;
> XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone);
> xfs_bdwrite(mp, bp);
> }
> @@ -2490,9 +2484,8 @@ xlog_recover_do_inode_trans(
>
> write_inode_buffer:
> if (ITEM_TYPE(item) == XFS_LI_INODE) {
> - ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL ||
> - XFS_BUF_FSPRIVATE(bp, xfs_mount_t *) == mp);
> - XFS_BUF_SET_FSPRIVATE(bp, mp);
> + ASSERT(bp->b_mount == NULL || bp->b_mount == mp);
> + bp->b_mount = mp;
> XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone);
> xfs_bdwrite(mp, bp);
> } else {
> @@ -2623,9 +2616,8 @@ xlog_recover_do_dquot_trans(
> memcpy(ddq, recddq, item->ri_buf[1].i_len);
>
> ASSERT(dq_f->qlf_size == 2);
> - ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL ||
> - XFS_BUF_FSPRIVATE(bp, xfs_mount_t *) == mp);
> - XFS_BUF_SET_FSPRIVATE(bp, mp);
> + ASSERT(bp->b_mount == NULL || bp->b_mount == mp);
> + bp->b_mount = mp;
> XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone);
> xfs_bdwrite(mp, bp);
>
>
> --
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
---end quoted text---
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2008-12-03 14:03 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-02 16:04 [patch 00/22] 2.6.29 queue Christoph Hellwig
2008-12-02 16:04 ` [patch 01/22] fix compile on 32 bit systems Christoph Hellwig
2008-12-02 16:43 ` Eric Sandeen
2008-12-03 2:20 ` Eric Sandeen
2008-12-04 1:03 ` Niv Sardi
2008-12-04 12:34 ` Christoph Hellwig
2008-12-04 13:03 ` Niv Sardi
2008-12-04 13:11 ` Christoph Hellwig
2008-12-04 13:40 ` Niv Sardi
2008-12-02 16:04 ` [patch 02/22] remove useless mnt_want_write call in xfs_write Christoph Hellwig
2008-12-03 2:11 ` Dave Chinner
2008-12-02 16:04 ` [patch 03/22] remove unused behvavior cruft in xfs_super.h Christoph Hellwig
2008-12-03 2:12 ` Dave Chinner
2008-12-02 16:04 ` [patch 04/22] remove unused prototypes for xfs_ihash_init / xfs_ihash_free Christoph Hellwig
2008-12-03 2:13 ` Dave Chinner
2008-12-03 2:22 ` Eric Sandeen
2008-12-02 16:04 ` [patch 05/22] cleanup the inode reclaim path Christoph Hellwig
2008-12-03 2:29 ` Dave Chinner
2008-12-03 10:53 ` Christoph Hellwig
2008-12-02 16:04 ` [patch 06/22] kill xfs_buf_iostart Christoph Hellwig
2008-12-03 2:37 ` Dave Chinner
2008-12-02 16:04 ` [patch 07/22] stop using igrab in xfs_vn_link Christoph Hellwig
2008-12-03 2:39 ` Dave Chinner
2008-12-02 16:04 ` [patch 08/22] reduce l_icloglock roundtrips Christoph Hellwig
2008-12-03 2:56 ` Dave Chinner
2008-12-03 10:51 ` Christoph Hellwig
2008-12-02 16:04 ` [patch 09/22] remove dead code from sv_t implementation Christoph Hellwig
2008-12-03 2:56 ` Dave Chinner
2008-12-02 16:04 ` [patch 10/22] kill dead quota flags Christoph Hellwig
2008-12-03 2:57 ` Dave Chinner
2008-12-02 16:04 ` [patch 11/22] cleanup xfs_sb.h feature flag helpers Christoph Hellwig
2008-12-03 6:26 ` Donald Douwsma
2008-12-03 10:52 ` Christoph Hellwig
2008-12-02 16:04 ` [patch 12/22] kill dead inode flags Christoph Hellwig
2008-12-03 2:59 ` Dave Chinner
2008-12-04 2:24 ` Niv Sardi
2008-12-04 12:35 ` Christoph Hellwig
2008-12-02 16:04 ` [patch 13/22] remove unused m_inode_quiesce member from struct xfs_mount Christoph Hellwig
2008-12-03 2:59 ` Dave Chinner
2008-12-02 16:04 ` [patch 14/22] remove leftovers of shared read-only support Christoph Hellwig
2008-12-03 3:01 ` Dave Chinner
2008-12-03 10:57 ` Christoph Hellwig
2008-12-02 16:04 ` [patch 15/22] replace b_fspriv with b_mount Christoph Hellwig
2008-12-03 14:03 ` Christoph Hellwig [this message]
2008-12-03 21:54 ` Dave Chinner
2008-12-02 16:04 ` [patch 16/22] use xfs_trans_ijoin in xfs_trans_iget Christoph Hellwig
2008-12-03 3:03 ` Dave Chinner
2008-12-02 16:04 ` [patch 17/22] no explicit xfs_iflush for special inodes during unmount Christoph Hellwig
2008-12-03 3:06 ` Dave Chinner
2008-12-02 16:04 ` [patch 18/22] kill xfs_unmount_flush Christoph Hellwig
2008-12-03 3:08 ` Dave Chinner
2008-12-02 16:04 ` [patch 19/22] kill vn_ioerror Christoph Hellwig
2008-12-03 3:13 ` Dave Chinner
2008-12-02 16:04 ` [patch 20/22] move vn_iowait / vn_iowake into xfs_aops.c Christoph Hellwig
2008-12-03 3:17 ` Dave Chinner
2008-12-03 10:58 ` Christoph Hellwig
2008-12-03 21:48 ` Dave Chinner
2008-12-02 16:04 ` [patch 21/22] move inode tracing out of xfs_vnode Christoph Hellwig
2008-12-03 3:18 ` Dave Chinner
2008-12-02 16:04 ` [patch 22/22] use inode_change_ok for setattr permission checking Christoph Hellwig
2008-12-03 17:13 ` [patch 00/22] 2.6.29 queue Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081203140331.GA28361@infradead.org \
--to=hch@infradead.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox