diff options
author | mav <mav@FreeBSD.org> | 2016-04-02 08:34:15 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2016-04-02 08:34:15 +0000 |
commit | 4c1345f8596b6345eb8ad548cdda52b8dc6d41ad (patch) | |
tree | 27f8135d05fc3f131a426259b740c02a86b0127b /cddl/contrib/opensolaris/lib | |
parent | 73011e007a62a6f39330d239445cee09e18edcd1 (diff) | |
download | FreeBSD-src-4c1345f8596b6345eb8ad548cdda52b8dc6d41ad.zip FreeBSD-src-4c1345f8596b6345eb8ad548cdda52b8dc6d41ad.tar.gz |
MFV r297505:
6739 userland version of cv_timedwait_hires() always assumes absolute time
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>
illumos/illumos-gate@41c6413cb54bf338d7a59ed789ec2e0e44c35e6f
Diffstat (limited to 'cddl/contrib/opensolaris/lib')
-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 | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c index 126a7c1..56d7bf3 100644 --- a/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c +++ b/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c @@ -366,10 +366,13 @@ cv_timedwait_hires(kcondvar_t *cv, kmutex_t *mp, hrtime_t tim, hrtime_t res, timestruc_t ts; hrtime_t delta; - ASSERT(flag == 0); + ASSERT(flag == 0 || flag == CALLOUT_FLAG_ABSOLUTE); top: - delta = tim - gethrtime(); + delta = tim; + if (flag & CALLOUT_FLAG_ABSOLUTE) + delta -= gethrtime(); + if (delta <= 0) return (-1); 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 22774af..f11174f 100644 --- a/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h +++ b/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ /* @@ -324,6 +324,7 @@ extern gid_t *crgetgroups(cred_t *cr); typedef cond_t kcondvar_t; #define CV_DEFAULT USYNC_THREAD +#define CALLOUT_FLAG_ABSOLUTE 0x2 extern void cv_init(kcondvar_t *cv, char *name, int type, void *arg); extern void cv_destroy(kcondvar_t *cv); |