mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 11:18:52 +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:
+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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user