diff options
author | Christoph Hellwig <hch@infradead.org> | 2007-05-14 04:23:50 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-07-14 01:21:14 -0400 |
commit | 1fa40b01ae4d1b00e366d4949edcc230f5cd6d99 (patch) | |
tree | 66059d8f37bfafc6cce57509829ee253b3269252 /fs/xfs/xfs_log.c | |
parent | 4eb6bf6bfb580afaf1e1a1d30cba17a078530cf4 (diff) |
[XFS] Only use refcounted pages for I/O
Many block drivers (aoe, iscsi) really want refcountable pages in bios,
which is what almost everyone send down. XFS unfortunately has a few
places where it sends down buffers that may come from kmalloc, which
breaks them.
Fix the places that use kmalloc()d buffers.
SGI-PV: 964546
SGI-Modid: xfs-linux-melb:xfs-kern:28562a
Signed-Off-By: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log.c')
-rw-r--r-- | fs/xfs/xfs_log.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index c48bf61f17bd..635f99e6302f 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -1199,11 +1199,18 @@ xlog_alloc_log(xfs_mount_t *mp, | |||
1199 | *iclogp = (xlog_in_core_t *) | 1199 | *iclogp = (xlog_in_core_t *) |
1200 | kmem_zalloc(sizeof(xlog_in_core_t), KM_SLEEP); | 1200 | kmem_zalloc(sizeof(xlog_in_core_t), KM_SLEEP); |
1201 | iclog = *iclogp; | 1201 | iclog = *iclogp; |
1202 | iclog->hic_data = (xlog_in_core_2_t *) | ||
1203 | kmem_zalloc(iclogsize, KM_SLEEP | KM_LARGE); | ||
1204 | |||
1205 | iclog->ic_prev = prev_iclog; | 1202 | iclog->ic_prev = prev_iclog; |
1206 | prev_iclog = iclog; | 1203 | prev_iclog = iclog; |
1204 | |||
1205 | bp = xfs_buf_get_noaddr(log->l_iclog_size, mp->m_logdev_targp); | ||
1206 | if (!XFS_BUF_CPSEMA(bp)) | ||
1207 | ASSERT(0); | ||
1208 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone); | ||
1209 | XFS_BUF_SET_BDSTRAT_FUNC(bp, xlog_bdstrat_cb); | ||
1210 | XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)1); | ||
1211 | iclog->ic_bp = bp; | ||
1212 | iclog->hic_data = bp->b_addr; | ||
1213 | |||
1207 | log->l_iclog_bak[i] = (xfs_caddr_t)&(iclog->ic_header); | 1214 | log->l_iclog_bak[i] = (xfs_caddr_t)&(iclog->ic_header); |
1208 | 1215 | ||
1209 | head = &iclog->ic_header; | 1216 | head = &iclog->ic_header; |
@@ -1216,11 +1223,6 @@ xlog_alloc_log(xfs_mount_t *mp, | |||
1216 | INT_SET(head->h_fmt, ARCH_CONVERT, XLOG_FMT); | 1223 | INT_SET(head->h_fmt, ARCH_CONVERT, XLOG_FMT); |
1217 | memcpy(&head->h_fs_uuid, &mp->m_sb.sb_uuid, sizeof(uuid_t)); | 1224 | memcpy(&head->h_fs_uuid, &mp->m_sb.sb_uuid, sizeof(uuid_t)); |
1218 | 1225 | ||
1219 | bp = xfs_buf_get_empty(log->l_iclog_size, mp->m_logdev_targp); | ||
1220 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone); | ||
1221 | XFS_BUF_SET_BDSTRAT_FUNC(bp, xlog_bdstrat_cb); | ||
1222 | XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)1); | ||
1223 | iclog->ic_bp = bp; | ||
1224 | 1226 | ||
1225 | iclog->ic_size = XFS_BUF_SIZE(bp) - log->l_iclog_hsize; | 1227 | iclog->ic_size = XFS_BUF_SIZE(bp) - log->l_iclog_hsize; |
1226 | iclog->ic_state = XLOG_STATE_ACTIVE; | 1228 | iclog->ic_state = XLOG_STATE_ACTIVE; |
@@ -1528,7 +1530,6 @@ xlog_dealloc_log(xlog_t *log) | |||
1528 | } | 1530 | } |
1529 | #endif | 1531 | #endif |
1530 | next_iclog = iclog->ic_next; | 1532 | next_iclog = iclog->ic_next; |
1531 | kmem_free(iclog->hic_data, log->l_iclog_size); | ||
1532 | kmem_free(iclog, sizeof(xlog_in_core_t)); | 1533 | kmem_free(iclog, sizeof(xlog_in_core_t)); |
1533 | iclog = next_iclog; | 1534 | iclog = next_iclog; |
1534 | } | 1535 | } |