diff options
author | David Quigley <[email protected]> | 2016-07-22 11:52:49 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-11-29 14:34:27 -0800 |
commit | a6255b7fce400d485a0e87cbe369aa0ed7dc5dc4 (patch) | |
tree | 520198dbeb4bbe1783726a195ba1b66b12acea0b /module/zfs/vdev_file.c | |
parent | 616fa7c02b0cc373f011998f56ed53bb37742d13 (diff) |
DLPX-44812 integrate EP-220 large memory scalability
Diffstat (limited to 'module/zfs/vdev_file.c')
-rw-r--r-- | module/zfs/vdev_file.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/module/zfs/vdev_file.c b/module/zfs/vdev_file.c index a0a23598b..c78f2f421 100644 --- a/module/zfs/vdev_file.c +++ b/module/zfs/vdev_file.c @@ -31,6 +31,7 @@ #include <sys/zio.h> #include <sys/fs/zfs.h> #include <sys/fm/fs/zfs.h> +#include <sys/abd.h> /* * Virtual device vector for files. @@ -150,11 +151,21 @@ vdev_file_io_strategy(void *arg) vdev_t *vd = zio->io_vd; vdev_file_t *vf = vd->vdev_tsd; ssize_t resid; + void *buf; + + if (zio->io_type == ZIO_TYPE_READ) + buf = abd_borrow_buf(zio->io_abd, zio->io_size); + else + buf = abd_borrow_buf_copy(zio->io_abd, zio->io_size); zio->io_error = vn_rdwr(zio->io_type == ZIO_TYPE_READ ? - UIO_READ : UIO_WRITE, vf->vf_vnode, zio->io_data, - zio->io_size, zio->io_offset, UIO_SYSSPACE, - 0, RLIM64_INFINITY, kcred, &resid); + UIO_READ : UIO_WRITE, vf->vf_vnode, buf, zio->io_size, + zio->io_offset, UIO_SYSSPACE, 0, RLIM64_INFINITY, kcred, &resid); + + if (zio->io_type == ZIO_TYPE_READ) + abd_return_buf_copy(zio->io_abd, buf, zio->io_size); + else + abd_return_buf(zio->io_abd, buf, zio->io_size); if (resid != 0 && zio->io_error == 0) zio->io_error = SET_ERROR(ENOSPC); |