mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Extending FreeBSD UIO Struct
In FreeBSD the struct uio was just a typedef to uio_t. In order to extend this struct, outside of the definition for the struct uio, the struct uio has been embedded inside of a uio_t struct. Also renamed all the uio_* interfaces to be zfs_uio_* to make it clear this is a ZFS interface. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Jorgen Lundman <lundman@lundman.net> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Brian Atkinson <batkinson@lanl.gov> Closes #11438
This commit is contained in:
+22
-30
@@ -1170,7 +1170,7 @@ dmu_redact(objset_t *os, uint64_t object, uint64_t offset, uint64_t size,
|
||||
|
||||
#ifdef _KERNEL
|
||||
int
|
||||
dmu_read_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size)
|
||||
dmu_read_uio_dnode(dnode_t *dn, zfs_uio_t *uio, uint64_t size)
|
||||
{
|
||||
dmu_buf_t **dbp;
|
||||
int numbufs, i, err;
|
||||
@@ -1179,7 +1179,7 @@ dmu_read_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size)
|
||||
* NB: we could do this block-at-a-time, but it's nice
|
||||
* to be reading in parallel.
|
||||
*/
|
||||
err = dmu_buf_hold_array_by_dnode(dn, uio_offset(uio), size,
|
||||
err = dmu_buf_hold_array_by_dnode(dn, zfs_uio_offset(uio), size,
|
||||
TRUE, FTAG, &numbufs, &dbp, 0);
|
||||
if (err)
|
||||
return (err);
|
||||
@@ -1191,16 +1191,12 @@ dmu_read_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size)
|
||||
|
||||
ASSERT(size > 0);
|
||||
|
||||
bufoff = uio_offset(uio) - db->db_offset;
|
||||
bufoff = zfs_uio_offset(uio) - db->db_offset;
|
||||
tocpy = MIN(db->db_size - bufoff, size);
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
err = vn_io_fault_uiomove((char *)db->db_data + bufoff,
|
||||
tocpy, uio);
|
||||
#else
|
||||
err = uiomove((char *)db->db_data + bufoff, tocpy,
|
||||
UIO_READ, uio);
|
||||
#endif
|
||||
err = zfs_uio_fault_move((char *)db->db_data + bufoff, tocpy,
|
||||
UIO_READ, uio);
|
||||
|
||||
if (err)
|
||||
break;
|
||||
|
||||
@@ -1214,14 +1210,14 @@ dmu_read_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size)
|
||||
/*
|
||||
* Read 'size' bytes into the uio buffer.
|
||||
* From object zdb->db_object.
|
||||
* Starting at offset uio->uio_loffset.
|
||||
* Starting at zfs_uio_offset(uio).
|
||||
*
|
||||
* If the caller already has a dbuf in the target object
|
||||
* (e.g. its bonus buffer), this routine is faster than dmu_read_uio(),
|
||||
* because we don't have to find the dnode_t for the object.
|
||||
*/
|
||||
int
|
||||
dmu_read_uio_dbuf(dmu_buf_t *zdb, uio_t *uio, uint64_t size)
|
||||
dmu_read_uio_dbuf(dmu_buf_t *zdb, zfs_uio_t *uio, uint64_t size)
|
||||
{
|
||||
dmu_buf_impl_t *db = (dmu_buf_impl_t *)zdb;
|
||||
dnode_t *dn;
|
||||
@@ -1241,10 +1237,10 @@ dmu_read_uio_dbuf(dmu_buf_t *zdb, uio_t *uio, uint64_t size)
|
||||
/*
|
||||
* Read 'size' bytes into the uio buffer.
|
||||
* From the specified object
|
||||
* Starting at offset uio->uio_loffset.
|
||||
* Starting at offset zfs_uio_offset(uio).
|
||||
*/
|
||||
int
|
||||
dmu_read_uio(objset_t *os, uint64_t object, uio_t *uio, uint64_t size)
|
||||
dmu_read_uio(objset_t *os, uint64_t object, zfs_uio_t *uio, uint64_t size)
|
||||
{
|
||||
dnode_t *dn;
|
||||
int err;
|
||||
@@ -1264,14 +1260,14 @@ dmu_read_uio(objset_t *os, uint64_t object, uio_t *uio, uint64_t size)
|
||||
}
|
||||
|
||||
int
|
||||
dmu_write_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size, dmu_tx_t *tx)
|
||||
dmu_write_uio_dnode(dnode_t *dn, zfs_uio_t *uio, uint64_t size, dmu_tx_t *tx)
|
||||
{
|
||||
dmu_buf_t **dbp;
|
||||
int numbufs;
|
||||
int err = 0;
|
||||
int i;
|
||||
|
||||
err = dmu_buf_hold_array_by_dnode(dn, uio_offset(uio), size,
|
||||
err = dmu_buf_hold_array_by_dnode(dn, zfs_uio_offset(uio), size,
|
||||
FALSE, FTAG, &numbufs, &dbp, DMU_READ_PREFETCH);
|
||||
if (err)
|
||||
return (err);
|
||||
@@ -1283,7 +1279,7 @@ dmu_write_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size, dmu_tx_t *tx)
|
||||
|
||||
ASSERT(size > 0);
|
||||
|
||||
bufoff = uio_offset(uio) - db->db_offset;
|
||||
bufoff = zfs_uio_offset(uio) - db->db_offset;
|
||||
tocpy = MIN(db->db_size - bufoff, size);
|
||||
|
||||
ASSERT(i == 0 || i == numbufs-1 || tocpy == db->db_size);
|
||||
@@ -1294,18 +1290,14 @@ dmu_write_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size, dmu_tx_t *tx)
|
||||
dmu_buf_will_dirty(db, tx);
|
||||
|
||||
/*
|
||||
* XXX uiomove could block forever (eg.nfs-backed
|
||||
* XXX zfs_uiomove could block forever (eg.nfs-backed
|
||||
* pages). There needs to be a uiolockdown() function
|
||||
* to lock the pages in memory, so that uiomove won't
|
||||
* to lock the pages in memory, so that zfs_uiomove won't
|
||||
* block.
|
||||
*/
|
||||
#ifdef __FreeBSD__
|
||||
err = vn_io_fault_uiomove((char *)db->db_data + bufoff,
|
||||
tocpy, uio);
|
||||
#else
|
||||
err = uiomove((char *)db->db_data + bufoff, tocpy,
|
||||
UIO_WRITE, uio);
|
||||
#endif
|
||||
err = zfs_uio_fault_move((char *)db->db_data + bufoff,
|
||||
tocpy, UIO_WRITE, uio);
|
||||
|
||||
if (tocpy == db->db_size)
|
||||
dmu_buf_fill_done(db, tx);
|
||||
|
||||
@@ -1322,14 +1314,14 @@ dmu_write_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size, dmu_tx_t *tx)
|
||||
/*
|
||||
* Write 'size' bytes from the uio buffer.
|
||||
* To object zdb->db_object.
|
||||
* Starting at offset uio->uio_loffset.
|
||||
* Starting at offset zfs_uio_offset(uio).
|
||||
*
|
||||
* If the caller already has a dbuf in the target object
|
||||
* (e.g. its bonus buffer), this routine is faster than dmu_write_uio(),
|
||||
* because we don't have to find the dnode_t for the object.
|
||||
*/
|
||||
int
|
||||
dmu_write_uio_dbuf(dmu_buf_t *zdb, uio_t *uio, uint64_t size,
|
||||
dmu_write_uio_dbuf(dmu_buf_t *zdb, zfs_uio_t *uio, uint64_t size,
|
||||
dmu_tx_t *tx)
|
||||
{
|
||||
dmu_buf_impl_t *db = (dmu_buf_impl_t *)zdb;
|
||||
@@ -1350,10 +1342,10 @@ dmu_write_uio_dbuf(dmu_buf_t *zdb, uio_t *uio, uint64_t size,
|
||||
/*
|
||||
* Write 'size' bytes from the uio buffer.
|
||||
* To the specified object.
|
||||
* Starting at offset uio->uio_loffset.
|
||||
* Starting at offset zfs_uio_offset(uio).
|
||||
*/
|
||||
int
|
||||
dmu_write_uio(objset_t *os, uint64_t object, uio_t *uio, uint64_t size,
|
||||
dmu_write_uio(objset_t *os, uint64_t object, zfs_uio_t *uio, uint64_t size,
|
||||
dmu_tx_t *tx)
|
||||
{
|
||||
dnode_t *dn;
|
||||
|
||||
+3
-3
@@ -1502,7 +1502,7 @@ sa_lookup(sa_handle_t *hdl, sa_attr_type_t attr, void *buf, uint32_t buflen)
|
||||
|
||||
#ifdef _KERNEL
|
||||
int
|
||||
sa_lookup_uio(sa_handle_t *hdl, sa_attr_type_t attr, uio_t *uio)
|
||||
sa_lookup_uio(sa_handle_t *hdl, sa_attr_type_t attr, zfs_uio_t *uio)
|
||||
{
|
||||
int error;
|
||||
sa_bulk_attr_t bulk;
|
||||
@@ -1515,8 +1515,8 @@ sa_lookup_uio(sa_handle_t *hdl, sa_attr_type_t attr, uio_t *uio)
|
||||
|
||||
mutex_enter(&hdl->sa_lock);
|
||||
if ((error = sa_attr_op(hdl, &bulk, 1, SA_LOOKUP, NULL)) == 0) {
|
||||
error = uiomove((void *)bulk.sa_addr, MIN(bulk.sa_size,
|
||||
uio_resid(uio)), UIO_READ, uio);
|
||||
error = zfs_uiomove((void *)bulk.sa_addr, MIN(bulk.sa_size,
|
||||
zfs_uio_resid(uio)), UIO_READ, uio);
|
||||
}
|
||||
mutex_exit(&hdl->sa_lock);
|
||||
return (error);
|
||||
|
||||
+6
-5
@@ -71,7 +71,7 @@ sa_attr_reg_t zfs_attr_table[ZPL_END+1] = {
|
||||
|
||||
#ifdef _KERNEL
|
||||
int
|
||||
zfs_sa_readlink(znode_t *zp, uio_t *uio)
|
||||
zfs_sa_readlink(znode_t *zp, zfs_uio_t *uio)
|
||||
{
|
||||
dmu_buf_t *db = sa_get_db(zp->z_sa_hdl);
|
||||
size_t bufsz;
|
||||
@@ -79,15 +79,16 @@ zfs_sa_readlink(znode_t *zp, uio_t *uio)
|
||||
|
||||
bufsz = zp->z_size;
|
||||
if (bufsz + ZFS_OLD_ZNODE_PHYS_SIZE <= db->db_size) {
|
||||
error = uiomove((caddr_t)db->db_data +
|
||||
error = zfs_uiomove((caddr_t)db->db_data +
|
||||
ZFS_OLD_ZNODE_PHYS_SIZE,
|
||||
MIN((size_t)bufsz, uio_resid(uio)), UIO_READ, uio);
|
||||
MIN((size_t)bufsz, zfs_uio_resid(uio)), UIO_READ, uio);
|
||||
} else {
|
||||
dmu_buf_t *dbp;
|
||||
if ((error = dmu_buf_hold(ZTOZSB(zp)->z_os, zp->z_id,
|
||||
0, FTAG, &dbp, DMU_READ_NO_PREFETCH)) == 0) {
|
||||
error = uiomove(dbp->db_data,
|
||||
MIN((size_t)bufsz, uio_resid(uio)), UIO_READ, uio);
|
||||
error = zfs_uiomove(dbp->db_data,
|
||||
MIN((size_t)bufsz, zfs_uio_resid(uio)), UIO_READ,
|
||||
uio);
|
||||
dmu_buf_rele(dbp, FTAG);
|
||||
}
|
||||
}
|
||||
|
||||
+34
-33
@@ -187,7 +187,7 @@ static unsigned long zfs_vnops_read_chunk_size = 1024 * 1024; /* Tunable */
|
||||
*/
|
||||
/* ARGSUSED */
|
||||
int
|
||||
zfs_read(struct znode *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
zfs_read(struct znode *zp, zfs_uio_t *uio, int ioflag, cred_t *cr)
|
||||
{
|
||||
int error = 0;
|
||||
boolean_t frsync = B_FALSE;
|
||||
@@ -210,7 +210,7 @@ zfs_read(struct znode *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
/*
|
||||
* Validate file offset
|
||||
*/
|
||||
if (uio->uio_loffset < (offset_t)0) {
|
||||
if (zfs_uio_offset(uio) < (offset_t)0) {
|
||||
ZFS_EXIT(zfsvfs);
|
||||
return (SET_ERROR(EINVAL));
|
||||
}
|
||||
@@ -218,7 +218,7 @@ zfs_read(struct znode *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
/*
|
||||
* Fasttrack empty reads
|
||||
*/
|
||||
if (uio->uio_resid == 0) {
|
||||
if (zfs_uio_resid(uio) == 0) {
|
||||
ZFS_EXIT(zfsvfs);
|
||||
return (0);
|
||||
}
|
||||
@@ -242,26 +242,26 @@ zfs_read(struct znode *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
* Lock the range against changes.
|
||||
*/
|
||||
zfs_locked_range_t *lr = zfs_rangelock_enter(&zp->z_rangelock,
|
||||
uio->uio_loffset, uio->uio_resid, RL_READER);
|
||||
zfs_uio_offset(uio), zfs_uio_resid(uio), RL_READER);
|
||||
|
||||
/*
|
||||
* If we are reading past end-of-file we can skip
|
||||
* to the end; but we might still need to set atime.
|
||||
*/
|
||||
if (uio->uio_loffset >= zp->z_size) {
|
||||
if (zfs_uio_offset(uio) >= zp->z_size) {
|
||||
error = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ASSERT(uio->uio_loffset < zp->z_size);
|
||||
ssize_t n = MIN(uio->uio_resid, zp->z_size - uio->uio_loffset);
|
||||
ASSERT(zfs_uio_offset(uio) < zp->z_size);
|
||||
ssize_t n = MIN(zfs_uio_resid(uio), zp->z_size - zfs_uio_offset(uio));
|
||||
ssize_t start_resid = n;
|
||||
|
||||
while (n > 0) {
|
||||
ssize_t nbytes = MIN(n, zfs_vnops_read_chunk_size -
|
||||
P2PHASE(uio->uio_loffset, zfs_vnops_read_chunk_size));
|
||||
P2PHASE(zfs_uio_offset(uio), zfs_vnops_read_chunk_size));
|
||||
#ifdef UIO_NOCOPY
|
||||
if (uio->uio_segflg == UIO_NOCOPY)
|
||||
if (zfs_uio_segflg(uio) == UIO_NOCOPY)
|
||||
error = mappedread_sf(zp, nbytes, uio);
|
||||
else
|
||||
#endif
|
||||
@@ -314,10 +314,10 @@ out:
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
zfs_write(znode_t *zp, zfs_uio_t *uio, int ioflag, cred_t *cr)
|
||||
{
|
||||
int error = 0;
|
||||
ssize_t start_resid = uio->uio_resid;
|
||||
ssize_t start_resid = zfs_uio_resid(uio);
|
||||
|
||||
/*
|
||||
* Fasttrack empty write
|
||||
@@ -354,7 +354,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
*/
|
||||
if ((zp->z_pflags & (ZFS_IMMUTABLE | ZFS_READONLY)) ||
|
||||
((zp->z_pflags & ZFS_APPENDONLY) && !(ioflag & O_APPEND) &&
|
||||
(uio->uio_loffset < zp->z_size))) {
|
||||
(zfs_uio_offset(uio) < zp->z_size))) {
|
||||
ZFS_EXIT(zfsvfs);
|
||||
return (SET_ERROR(EPERM));
|
||||
}
|
||||
@@ -362,7 +362,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
/*
|
||||
* Validate file offset
|
||||
*/
|
||||
offset_t woff = ioflag & O_APPEND ? zp->z_size : uio->uio_loffset;
|
||||
offset_t woff = ioflag & O_APPEND ? zp->z_size : zfs_uio_offset(uio);
|
||||
if (woff < 0) {
|
||||
ZFS_EXIT(zfsvfs);
|
||||
return (SET_ERROR(EINVAL));
|
||||
@@ -375,7 +375,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
* don't hold up txg.
|
||||
* Skip this if uio contains loaned arc_buf.
|
||||
*/
|
||||
if (uio_prefaultpages(MIN(n, max_blksz), uio)) {
|
||||
if (zfs_uio_prefaultpages(MIN(n, max_blksz), uio)) {
|
||||
ZFS_EXIT(zfsvfs);
|
||||
return (SET_ERROR(EFAULT));
|
||||
}
|
||||
@@ -399,7 +399,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
*/
|
||||
woff = zp->z_size;
|
||||
}
|
||||
uio->uio_loffset = woff;
|
||||
zfs_uio_setoffset(uio, woff);
|
||||
} else {
|
||||
/*
|
||||
* Note that if the file block size will change as a result of
|
||||
@@ -409,7 +409,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
lr = zfs_rangelock_enter(&zp->z_rangelock, woff, n, RL_WRITER);
|
||||
}
|
||||
|
||||
if (zn_rlimit_fsize(zp, uio, uio->uio_td)) {
|
||||
if (zn_rlimit_fsize(zp, uio)) {
|
||||
zfs_rangelock_exit(lr);
|
||||
ZFS_EXIT(zfsvfs);
|
||||
return (SET_ERROR(EFBIG));
|
||||
@@ -439,7 +439,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
* and allows us to do more fine-grained space accounting.
|
||||
*/
|
||||
while (n > 0) {
|
||||
woff = uio->uio_loffset;
|
||||
woff = zfs_uio_offset(uio);
|
||||
|
||||
if (zfs_id_overblockquota(zfsvfs, DMU_USERUSED_OBJECT, uid) ||
|
||||
zfs_id_overblockquota(zfsvfs, DMU_GROUPUSED_OBJECT, gid) ||
|
||||
@@ -467,7 +467,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
max_blksz);
|
||||
ASSERT(abuf != NULL);
|
||||
ASSERT(arc_buf_size(abuf) == max_blksz);
|
||||
if ((error = uiocopy(abuf->b_data, max_blksz,
|
||||
if ((error = zfs_uiocopy(abuf->b_data, max_blksz,
|
||||
UIO_WRITE, uio, &cbytes))) {
|
||||
dmu_return_arcbuf(abuf);
|
||||
break;
|
||||
@@ -528,11 +528,11 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
|
||||
ssize_t tx_bytes;
|
||||
if (abuf == NULL) {
|
||||
tx_bytes = uio->uio_resid;
|
||||
uio_fault_disable(uio, B_TRUE);
|
||||
tx_bytes = zfs_uio_resid(uio);
|
||||
zfs_uio_fault_disable(uio, B_TRUE);
|
||||
error = dmu_write_uio_dbuf(sa_get_db(zp->z_sa_hdl),
|
||||
uio, nbytes, tx);
|
||||
uio_fault_disable(uio, B_FALSE);
|
||||
zfs_uio_fault_disable(uio, B_FALSE);
|
||||
#ifdef __linux__
|
||||
if (error == EFAULT) {
|
||||
dmu_tx_commit(tx);
|
||||
@@ -540,12 +540,13 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
* Account for partial writes before
|
||||
* continuing the loop.
|
||||
* Update needs to occur before the next
|
||||
* uio_prefaultpages, or prefaultpages may
|
||||
* zfs_uio_prefaultpages, or prefaultpages may
|
||||
* error, and we may break the loop early.
|
||||
*/
|
||||
if (tx_bytes != uio->uio_resid)
|
||||
n -= tx_bytes - uio->uio_resid;
|
||||
if (uio_prefaultpages(MIN(n, max_blksz), uio)) {
|
||||
if (tx_bytes != zfs_uio_resid(uio))
|
||||
n -= tx_bytes - zfs_uio_resid(uio);
|
||||
if (zfs_uio_prefaultpages(MIN(n, max_blksz),
|
||||
uio)) {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
@@ -555,7 +556,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
dmu_tx_commit(tx);
|
||||
break;
|
||||
}
|
||||
tx_bytes -= uio->uio_resid;
|
||||
tx_bytes -= zfs_uio_resid(uio);
|
||||
} else {
|
||||
/* Implied by abuf != NULL: */
|
||||
ASSERT3S(n, >=, max_blksz);
|
||||
@@ -580,8 +581,8 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
dmu_tx_commit(tx);
|
||||
break;
|
||||
}
|
||||
ASSERT3S(nbytes, <=, uio->uio_resid);
|
||||
uioskip(uio, nbytes);
|
||||
ASSERT3S(nbytes, <=, zfs_uio_resid(uio));
|
||||
zfs_uioskip(uio, nbytes);
|
||||
tx_bytes = nbytes;
|
||||
}
|
||||
if (tx_bytes && zn_has_cached_data(zp) &&
|
||||
@@ -631,9 +632,9 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
* Update the file size (zp_size) if it has changed;
|
||||
* account for possible concurrent updates.
|
||||
*/
|
||||
while ((end_size = zp->z_size) < uio->uio_loffset) {
|
||||
while ((end_size = zp->z_size) < zfs_uio_offset(uio)) {
|
||||
(void) atomic_cas_64(&zp->z_size, end_size,
|
||||
uio->uio_loffset);
|
||||
zfs_uio_offset(uio));
|
||||
ASSERT(error == 0);
|
||||
}
|
||||
/*
|
||||
@@ -656,7 +657,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
n -= nbytes;
|
||||
|
||||
if (n > 0) {
|
||||
if (uio_prefaultpages(MIN(n, max_blksz), uio)) {
|
||||
if (zfs_uio_prefaultpages(MIN(n, max_blksz), uio)) {
|
||||
error = SET_ERROR(EFAULT);
|
||||
break;
|
||||
}
|
||||
@@ -671,7 +672,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
* uio data is inaccessible return an error. Otherwise, it's
|
||||
* at least a partial write, so it's successful.
|
||||
*/
|
||||
if (zfsvfs->z_replay || uio->uio_resid == start_resid ||
|
||||
if (zfsvfs->z_replay || zfs_uio_resid(uio) == start_resid ||
|
||||
error == EFAULT) {
|
||||
ZFS_EXIT(zfsvfs);
|
||||
return (error);
|
||||
@@ -681,7 +682,7 @@ zfs_write(znode_t *zp, uio_t *uio, int ioflag, cred_t *cr)
|
||||
zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)
|
||||
zil_commit(zilog, zp->z_id);
|
||||
|
||||
const int64_t nwritten = start_resid - uio->uio_resid;
|
||||
const int64_t nwritten = start_resid - zfs_uio_resid(uio);
|
||||
dataset_kstats_update_write_kstats(&zfsvfs->z_kstat, nwritten);
|
||||
task_io_account_write(nwritten);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user