summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2013-12-31 19:39:15 +0000
committerdelphij <delphij@FreeBSD.org>2013-12-31 19:39:15 +0000
commitab4bdae837cae2d6d62a83ee3d2de722fa6da351 (patch)
tree25259cca882bd57d5a1fa10b9f0e1d6a98b3554e /cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
parentd0ccfff2c55a8ce2eedf9d4e22b80ba48deb8bb2 (diff)
downloadFreeBSD-src-ab4bdae837cae2d6d62a83ee3d2de722fa6da351.zip
FreeBSD-src-ab4bdae837cae2d6d62a83ee3d2de722fa6da351.tar.gz
MFV r242733:
3306 zdb should be able to issue reads in parallel 3321 'zpool reopen' command should be documented in the man page and help message illumos/illumos-gate@31d7e8fa33fae995f558673adb22641b5aa8b6e1 FreeBSD porting notes: the kernel part of this changeset depends on Solaris buf(9S) interfaces and are not really applicable for our use. vdev_disk.c is patched as-is to reduce diverge from upstream, but vdev_file.c is left intact. MFC after: 2 weeks
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzpool/common/kernel.c')
-rw-r--r--cddl/contrib/opensolaris/lib/libzpool/common/kernel.c49
1 files changed, 48 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
index c4e2d2e..19fbf4f 100644
--- a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
+++ b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c
@@ -661,7 +661,7 @@ __dprintf(const char *file, const char *func, int line, const char *fmt, ...)
if (dprintf_find_string("pid"))
(void) printf("%d ", getpid());
if (dprintf_find_string("tid"))
- (void) printf("%u ", thr_self());
+ (void) printf("%ul ", thr_self());
#if 0
if (dprintf_find_string("cpu"))
(void) printf("%u ", getcpuid());
@@ -1125,3 +1125,50 @@ zvol_create_minors(const char *name)
return (0);
}
#endif
+
+#ifdef illumos
+void
+bioinit(buf_t *bp)
+{
+ bzero(bp, sizeof (buf_t));
+}
+
+void
+biodone(buf_t *bp)
+{
+ if (bp->b_iodone != NULL) {
+ (*(bp->b_iodone))(bp);
+ return;
+ }
+ ASSERT((bp->b_flags & B_DONE) == 0);
+ bp->b_flags |= B_DONE;
+}
+
+void
+bioerror(buf_t *bp, int error)
+{
+ ASSERT(bp != NULL);
+ ASSERT(error >= 0);
+
+ if (error != 0) {
+ bp->b_flags |= B_ERROR;
+ } else {
+ bp->b_flags &= ~B_ERROR;
+ }
+ bp->b_error = error;
+}
+
+
+int
+geterror(struct buf *bp)
+{
+ int error = 0;
+
+ if (bp->b_flags & B_ERROR) {
+ error = bp->b_error;
+ if (!error)
+ error = EIO;
+ }
+ return (error);
+}
+#endif
OpenPOWER on IntegriCloud