diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-12-09 04:47:30 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-12-10 21:13:33 -0500 |
commit | 15ac08a8b2c129abccf1be47b6ab09491e013db2 (patch) | |
tree | 9b9b630fbd168d1683369c7a72e83daf3216301c | |
parent | e055f13a6d8448d4f23121b7b11340c3fb55cce6 (diff) |
[XFS] replace b_fspriv with b_mount
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>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 4 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.h | 4 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_lrw.c | 11 | ||||
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 26 | ||||
-rw-r--r-- | fs/xfs/xfs_rw.c | 2 |
6 files changed, 19 insertions, 32 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index cd89c56715a5..b9c304a629ee 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -1085,7 +1085,7 @@ xfs_bawrite( | |||
1085 | bp->b_flags &= ~(XBF_READ | XBF_DELWRI | XBF_READ_AHEAD); | 1085 | bp->b_flags &= ~(XBF_READ | XBF_DELWRI | XBF_READ_AHEAD); |
1086 | bp->b_flags |= (XBF_WRITE | XBF_ASYNC | _XBF_RUN_QUEUES); | 1086 | bp->b_flags |= (XBF_WRITE | XBF_ASYNC | _XBF_RUN_QUEUES); |
1087 | 1087 | ||
1088 | bp->b_fspriv3 = mp; | 1088 | bp->b_mount = mp; |
1089 | bp->b_strat = xfs_bdstrat_cb; | 1089 | bp->b_strat = xfs_bdstrat_cb; |
1090 | return xfs_bdstrat_cb(bp); | 1090 | return xfs_bdstrat_cb(bp); |
1091 | } | 1091 | } |
@@ -1098,7 +1098,7 @@ xfs_bdwrite( | |||
1098 | XB_TRACE(bp, "bdwrite", 0); | 1098 | XB_TRACE(bp, "bdwrite", 0); |
1099 | 1099 | ||
1100 | bp->b_strat = xfs_bdstrat_cb; | 1100 | bp->b_strat = xfs_bdstrat_cb; |
1101 | bp->b_fspriv3 = mp; | 1101 | bp->b_mount = mp; |
1102 | 1102 | ||
1103 | bp->b_flags &= ~XBF_READ; | 1103 | bp->b_flags &= ~XBF_READ; |
1104 | bp->b_flags |= (XBF_DELWRI | XBF_ASYNC); | 1104 | bp->b_flags |= (XBF_DELWRI | XBF_ASYNC); |
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h index 0e2aa16f5e41..af8764e02d78 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/linux-2.6/xfs_buf.h | |||
@@ -168,7 +168,7 @@ typedef struct xfs_buf { | |||
168 | struct completion b_iowait; /* queue for I/O waiters */ | 168 | struct completion b_iowait; /* queue for I/O waiters */ |
169 | void *b_fspriv; | 169 | void *b_fspriv; |
170 | void *b_fspriv2; | 170 | void *b_fspriv2; |
171 | void *b_fspriv3; | 171 | struct xfs_mount *b_mount; |
172 | unsigned short b_error; /* error code on I/O */ | 172 | unsigned short b_error; /* error code on I/O */ |
173 | unsigned int b_page_count; /* size of page array */ | 173 | unsigned int b_page_count; /* size of page array */ |
174 | unsigned int b_offset; /* page offset in first page */ | 174 | unsigned int b_offset; /* page offset in first page */ |
@@ -335,8 +335,6 @@ extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *); | |||
335 | #define XFS_BUF_SET_FSPRIVATE(bp, val) ((bp)->b_fspriv = (void*)(val)) | 335 | #define XFS_BUF_SET_FSPRIVATE(bp, val) ((bp)->b_fspriv = (void*)(val)) |
336 | #define XFS_BUF_FSPRIVATE2(bp, type) ((type)(bp)->b_fspriv2) | 336 | #define XFS_BUF_FSPRIVATE2(bp, type) ((type)(bp)->b_fspriv2) |
337 | #define XFS_BUF_SET_FSPRIVATE2(bp, val) ((bp)->b_fspriv2 = (void*)(val)) | 337 | #define XFS_BUF_SET_FSPRIVATE2(bp, val) ((bp)->b_fspriv2 = (void*)(val)) |
338 | #define XFS_BUF_FSPRIVATE3(bp, type) ((type)(bp)->b_fspriv3) | ||
339 | #define XFS_BUF_SET_FSPRIVATE3(bp, val) ((bp)->b_fspriv3 = (void*)(val)) | ||
340 | #define XFS_BUF_SET_START(bp) do { } while (0) | 338 | #define XFS_BUF_SET_START(bp) do { } while (0) |
341 | #define XFS_BUF_SET_BRELSE_FUNC(bp, func) ((bp)->b_relse = (func)) | 339 | #define XFS_BUF_SET_BRELSE_FUNC(bp, func) ((bp)->b_relse = (func)) |
342 | 340 | ||
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 59b7d5f9e64a..92ce34b3787a 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c | |||
@@ -847,13 +847,7 @@ retry: | |||
847 | int | 847 | int |
848 | xfs_bdstrat_cb(struct xfs_buf *bp) | 848 | xfs_bdstrat_cb(struct xfs_buf *bp) |
849 | { | 849 | { |
850 | xfs_mount_t *mp; | 850 | if (XFS_FORCED_SHUTDOWN(bp->b_mount)) { |
851 | |||
852 | mp = XFS_BUF_FSPRIVATE3(bp, xfs_mount_t *); | ||
853 | if (!XFS_FORCED_SHUTDOWN(mp)) { | ||
854 | xfs_buf_iorequest(bp); | ||
855 | return 0; | ||
856 | } else { | ||
857 | xfs_buftrace("XFS__BDSTRAT IOERROR", bp); | 851 | xfs_buftrace("XFS__BDSTRAT IOERROR", bp); |
858 | /* | 852 | /* |
859 | * Metadata write that didn't get logged but | 853 | * Metadata write that didn't get logged but |
@@ -866,6 +860,9 @@ xfs_bdstrat_cb(struct xfs_buf *bp) | |||
866 | else | 860 | else |
867 | return (xfs_bioerror(bp)); | 861 | return (xfs_bioerror(bp)); |
868 | } | 862 | } |
863 | |||
864 | xfs_buf_iorequest(bp); | ||
865 | return 0; | ||
869 | } | 866 | } |
870 | 867 | ||
871 | /* | 868 | /* |
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index d245d04e10ca..d74ce1134262 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -707,8 +707,8 @@ xfs_buf_item_init( | |||
707 | * the first. If we do already have one, there is | 707 | * the first. If we do already have one, there is |
708 | * nothing to do here so return. | 708 | * nothing to do here so return. |
709 | */ | 709 | */ |
710 | if (XFS_BUF_FSPRIVATE3(bp, xfs_mount_t *) != mp) | 710 | if (bp->b_mount != mp) |
711 | XFS_BUF_SET_FSPRIVATE3(bp, mp); | 711 | bp->b_mount = mp; |
712 | XFS_BUF_SET_BDSTRAT_FUNC(bp, xfs_bdstrat_cb); | 712 | XFS_BUF_SET_BDSTRAT_FUNC(bp, xfs_bdstrat_cb); |
713 | if (XFS_BUF_FSPRIVATE(bp, void *) != NULL) { | 713 | if (XFS_BUF_FSPRIVATE(bp, void *) != NULL) { |
714 | lip = XFS_BUF_FSPRIVATE(bp, xfs_log_item_t *); | 714 | lip = XFS_BUF_FSPRIVATE(bp, xfs_log_item_t *); |
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 51412cced010..35cca98bd94c 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -267,21 +267,16 @@ STATIC void | |||
267 | xlog_recover_iodone( | 267 | xlog_recover_iodone( |
268 | struct xfs_buf *bp) | 268 | struct xfs_buf *bp) |
269 | { | 269 | { |
270 | xfs_mount_t *mp; | ||
271 | |||
272 | ASSERT(XFS_BUF_FSPRIVATE(bp, void *)); | ||
273 | |||
274 | if (XFS_BUF_GETERROR(bp)) { | 270 | if (XFS_BUF_GETERROR(bp)) { |
275 | /* | 271 | /* |
276 | * We're not going to bother about retrying | 272 | * We're not going to bother about retrying |
277 | * this during recovery. One strike! | 273 | * this during recovery. One strike! |
278 | */ | 274 | */ |
279 | mp = XFS_BUF_FSPRIVATE(bp, xfs_mount_t *); | ||
280 | xfs_ioerror_alert("xlog_recover_iodone", | 275 | xfs_ioerror_alert("xlog_recover_iodone", |
281 | mp, bp, XFS_BUF_ADDR(bp)); | 276 | bp->b_mount, bp, XFS_BUF_ADDR(bp)); |
282 | xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR); | 277 | xfs_force_shutdown(bp->b_mount, SHUTDOWN_META_IO_ERROR); |
283 | } | 278 | } |
284 | XFS_BUF_SET_FSPRIVATE(bp, NULL); | 279 | bp->b_mount = NULL; |
285 | XFS_BUF_CLR_IODONE_FUNC(bp); | 280 | XFS_BUF_CLR_IODONE_FUNC(bp); |
286 | xfs_biodone(bp); | 281 | xfs_biodone(bp); |
287 | } | 282 | } |
@@ -2225,9 +2220,8 @@ xlog_recover_do_buffer_trans( | |||
2225 | XFS_BUF_STALE(bp); | 2220 | XFS_BUF_STALE(bp); |
2226 | error = xfs_bwrite(mp, bp); | 2221 | error = xfs_bwrite(mp, bp); |
2227 | } else { | 2222 | } else { |
2228 | ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL || | 2223 | ASSERT(bp->b_mount == NULL || bp->b_mount == mp); |
2229 | XFS_BUF_FSPRIVATE(bp, xfs_mount_t *) == mp); | 2224 | bp->b_mount = mp; |
2230 | XFS_BUF_SET_FSPRIVATE(bp, mp); | ||
2231 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); | 2225 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); |
2232 | xfs_bdwrite(mp, bp); | 2226 | xfs_bdwrite(mp, bp); |
2233 | } | 2227 | } |
@@ -2490,9 +2484,8 @@ xlog_recover_do_inode_trans( | |||
2490 | 2484 | ||
2491 | write_inode_buffer: | 2485 | write_inode_buffer: |
2492 | if (ITEM_TYPE(item) == XFS_LI_INODE) { | 2486 | if (ITEM_TYPE(item) == XFS_LI_INODE) { |
2493 | ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL || | 2487 | ASSERT(bp->b_mount == NULL || bp->b_mount == mp); |
2494 | XFS_BUF_FSPRIVATE(bp, xfs_mount_t *) == mp); | 2488 | bp->b_mount = mp; |
2495 | XFS_BUF_SET_FSPRIVATE(bp, mp); | ||
2496 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); | 2489 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); |
2497 | xfs_bdwrite(mp, bp); | 2490 | xfs_bdwrite(mp, bp); |
2498 | } else { | 2491 | } else { |
@@ -2623,9 +2616,8 @@ xlog_recover_do_dquot_trans( | |||
2623 | memcpy(ddq, recddq, item->ri_buf[1].i_len); | 2616 | memcpy(ddq, recddq, item->ri_buf[1].i_len); |
2624 | 2617 | ||
2625 | ASSERT(dq_f->qlf_size == 2); | 2618 | ASSERT(dq_f->qlf_size == 2); |
2626 | ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL || | 2619 | ASSERT(bp->b_mount == NULL || bp->b_mount == mp); |
2627 | XFS_BUF_FSPRIVATE(bp, xfs_mount_t *) == mp); | 2620 | bp->b_mount = mp; |
2628 | XFS_BUF_SET_FSPRIVATE(bp, mp); | ||
2629 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); | 2621 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); |
2630 | xfs_bdwrite(mp, bp); | 2622 | xfs_bdwrite(mp, bp); |
2631 | 2623 | ||
diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c index 3a82576dde9a..36f3a21c54d2 100644 --- a/fs/xfs/xfs_rw.c +++ b/fs/xfs/xfs_rw.c | |||
@@ -406,7 +406,7 @@ xfs_bwrite( | |||
406 | * XXXsup how does this work for quotas. | 406 | * XXXsup how does this work for quotas. |
407 | */ | 407 | */ |
408 | XFS_BUF_SET_BDSTRAT_FUNC(bp, xfs_bdstrat_cb); | 408 | XFS_BUF_SET_BDSTRAT_FUNC(bp, xfs_bdstrat_cb); |
409 | XFS_BUF_SET_FSPRIVATE3(bp, mp); | 409 | bp->b_mount = mp; |
410 | XFS_BUF_WRITE(bp); | 410 | XFS_BUF_WRITE(bp); |
411 | 411 | ||
412 | if ((error = XFS_bwrite(bp))) { | 412 | if ((error = XFS_bwrite(bp))) { |