From 61a9bb6151793c4d06e325c6682233da89b4dac9 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 5 Dec 2008 12:23:10 -0800 Subject: [PATCH 1/2] Refresh linux-have-uio-rw --- .topdeps | 2 +- .topmsg | 4 ++-- zfs/lib/libzpool/dmu.c | 2 +- zfs/lib/libzpool/include/sys/dmu.h | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.topdeps b/.topdeps index 736703fbec..a8059c3552 100644 --- a/.topdeps +++ b/.topdeps @@ -1 +1 @@ -linux-kernel-module +linux-debug-zerocopy diff --git a/.topmsg b/.topmsg index 63a8108fc5..39952c5d9c 100644 --- a/.topmsg +++ b/.topmsg @@ -1,6 +1,6 @@ From: Brian Behlendorf -Subject: [PATCH] linux debug zerocopy +Subject: [PATCH] linux have uio rw -Add debug ONLY option for zerocopy +Use uio-rw if HAVE_UIO_RW defined Signed-off-by: Brian Behlendorf diff --git a/zfs/lib/libzpool/dmu.c b/zfs/lib/libzpool/dmu.c index 3d6a99c57a..1033540c53 100644 --- a/zfs/lib/libzpool/dmu.c +++ b/zfs/lib/libzpool/dmu.c @@ -675,7 +675,7 @@ dmu_write(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, dmu_write_impl(os, object, offset, size, buf, tx, 0); } -#ifdef _KERNEL +#if defined(_KERNEL) && defined(HAVE_UIO_RW) int dmu_read_uio(objset_t *os, uint64_t object, uio_t *uio, uint64_t size) { diff --git a/zfs/lib/libzpool/include/sys/dmu.h b/zfs/lib/libzpool/include/sys/dmu.h index fa2f8eff57..15da305d78 100644 --- a/zfs/lib/libzpool/include/sys/dmu.h +++ b/zfs/lib/libzpool/include/sys/dmu.h @@ -484,11 +484,13 @@ void dmu_write(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, const void *buf, dmu_tx_t *tx); void dmu_prealloc(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, dmu_tx_t *tx); +#if defined(_KERNEL) && defined(HAVE_UIO_RW) int dmu_read_uio(objset_t *os, uint64_t object, struct uio *uio, uint64_t size); int dmu_write_uio(objset_t *os, uint64_t object, struct uio *uio, uint64_t size, dmu_tx_t *tx); int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset, uint64_t size, struct page *pp, dmu_tx_t *tx); +#endif extern int zfs_prefetch_disable; From ffb877324120674b7ddd5d462a52c1e182ba25c2 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 23 Dec 2008 13:47:22 -0800 Subject: [PATCH 2/2] Take out page map functions for now --- module/zfs/include/sys/zfs_znode.h | 2 ++ module/zfs/zfs_vnops.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/module/zfs/include/sys/zfs_znode.h b/module/zfs/include/sys/zfs_znode.h index db40968fa2..57fd8d6dfa 100644 --- a/module/zfs/include/sys/zfs_znode.h +++ b/module/zfs/include/sys/zfs_znode.h @@ -338,8 +338,10 @@ extern void zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, znode_t *zp, extern void zfs_xvattr_set(znode_t *zp, xvattr_t *xvap); extern void zfs_upgrade(zfsvfs_t *zfsvfs, dmu_tx_t *tx); +#if defined(HAVE_UIO_RW) extern caddr_t zfs_map_page(page_t *, enum seg_rw); extern void zfs_unmap_page(page_t *, caddr_t); +#endif /* HAVE_UIO_RW */ extern zil_get_data_t zfs_get_data; extern zil_replay_func_t *zfs_replay_vector[TX_MAX_TYPE]; diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 8e0037e37d..c1dc7b5509 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -317,6 +317,7 @@ zfs_ioctl(vnode_t *vp, int com, intptr_t data, int flag, cred_t *cred, return (ENOTTY); } +#if defined(_KERNEL) && defined(HAVE_UIO_RW) /* * Utility functions to map and unmap a single physical page. These * are used to manage the mappable copies of ZFS file data, and therefore @@ -341,6 +342,7 @@ zfs_unmap_page(page_t *pp, caddr_t addr) ppmapout(addr); } } +#endif /* _KERNEL && HAVE_UIO_RW */ /* * When a file is memory mapped, we must keep the IO data synchronized