diff options
author | simokawa <simokawa@FreeBSD.org> | 2007-04-14 14:39:38 +0000 |
---|---|---|
committer | simokawa <simokawa@FreeBSD.org> | 2007-04-14 14:39:38 +0000 |
commit | 2867905cf5fd8d436fd8a9bb7324edcef658356f (patch) | |
tree | 8450952ca5592b3871e5e9279a71177b2d593ed6 /cddl/contrib/opensolaris/lib/libzpool | |
parent | 1104f500b1ed9bd4128dbccf68442967d2a5f066 (diff) | |
download | FreeBSD-src-2867905cf5fd8d436fd8a9bb7324edcef658356f.zip FreeBSD-src-2867905cf5fd8d436fd8a9bb7324edcef658356f.tar.gz |
In FreeBSD,
- cv_timedwait() takes delta instead of absolute time,
- we need ioctl() for mediasize.
Reviewed by: pjd
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzpool')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzpool/common/kernel.c | 7 | ||||
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c index 1fafe5f..30c5a0c 100644 --- a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c +++ b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c @@ -291,7 +291,7 @@ cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime) ASSERT(abstime > 0); top: - delta = abstime - lbolt; + delta = abstime; if (delta <= 0) return (-1); @@ -413,7 +413,10 @@ vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3) *vpp = vp = umem_zalloc(sizeof (vnode_t), UMEM_NOFAIL); vp->v_fd = fd; - vp->v_size = st.st_size; + if (S_ISCHR(st.st_mode)) + ioctl(fd, DIOCGMEDIASIZE, &vp->v_size); + else + vp->v_size = st.st_size; vp->v_path = spa_strdup(path); return (0); diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h b/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h index d46948e..82a0767 100644 --- a/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h +++ b/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h @@ -80,6 +80,7 @@ extern "C" { #include <sys/sdt.h> #include <sys/kstat.h> #include <sys/kernel.h> +#include <sys/disk.h> #include <machine/atomic.h> #define ZFS_EXPORTS_PATH "/etc/zfs/exports" |