diff options
Diffstat (limited to 'usr/src/uts/common/fs/sockfs')
-rw-r--r-- | usr/src/uts/common/fs/sockfs/nl7chttp.c | 7 | ||||
-rw-r--r-- | usr/src/uts/common/fs/sockfs/nl7curi.c | 3 | ||||
-rw-r--r-- | usr/src/uts/common/fs/sockfs/sockcommon_subr.c | 19 | ||||
-rw-r--r-- | usr/src/uts/common/fs/sockfs/sockstr.c | 7 | ||||
-rw-r--r-- | usr/src/uts/common/fs/sockfs/socksyscalls.c | 6 |
5 files changed, 18 insertions, 24 deletions
diff --git a/usr/src/uts/common/fs/sockfs/nl7chttp.c b/usr/src/uts/common/fs/sockfs/nl7chttp.c index 81dd8a99a5..8019295836 100644 --- a/usr/src/uts/common/fs/sockfs/nl7chttp.c +++ b/usr/src/uts/common/fs/sockfs/nl7chttp.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1797,10 +1797,11 @@ done: goto pass; } /* Have a valid expire and date so calc an lbolt expire */ - uri->expire = lbolt + SEC_TO_TICK(http->expire - http->date); + uri->expire = ddi_get_lbolt() + SEC_TO_TICK(http->expire - + http->date); } else if (nl7c_uri_ttl != -1) { /* No valid expire speced and we have a TTL */ - uri->expire = lbolt + SEC_TO_TICK(nl7c_uri_ttl); + uri->expire = ddi_get_lbolt() + SEC_TO_TICK(nl7c_uri_ttl); } chunked: diff --git a/usr/src/uts/common/fs/sockfs/nl7curi.c b/usr/src/uts/common/fs/sockfs/nl7curi.c index f0ba55de87..ae133979fa 100644 --- a/usr/src/uts/common/fs/sockfs/nl7curi.c +++ b/usr/src/uts/common/fs/sockfs/nl7curi.c @@ -821,7 +821,8 @@ nexthash: * of requested URI, check for expire or request no cache * purge. */ - if (uri->expire >= 0 && uri->expire <= lbolt || ruri->nocache) { + if (uri->expire >= 0 && uri->expire <= ddi_get_lbolt() || + ruri->nocache) { /* * URI has expired or request specified to not use * the cached version, unlink the URI from the hash diff --git a/usr/src/uts/common/fs/sockfs/sockcommon_subr.c b/usr/src/uts/common/fs/sockfs/sockcommon_subr.c index 9b806d0a4a..98cb194037 100644 --- a/usr/src/uts/common/fs/sockfs/sockcommon_subr.c +++ b/usr/src/uts/common/fs/sockfs/sockcommon_subr.c @@ -311,11 +311,8 @@ so_snd_wait_qnotfull_locked(struct sonode *so, boolean_t dontblock) */ error = cv_wait_sig(&so->so_snd_cv, &so->so_lock); } else { - clock_t now; - - time_to_wait(&now, so->so_sndtimeo); - error = cv_timedwait_sig(&so->so_snd_cv, &so->so_lock, - now); + error = cv_reltimedwait_sig(&so->so_snd_cv, + &so->so_lock, so->so_sndtimeo, TR_CLOCK_TICK); } if (error == 0) return (EINTR); @@ -971,10 +968,9 @@ try_again: error = cv_wait_sig(&so->so_rcv_cv, &so->so_lock); } else { - clock_t now; - time_to_wait(&now, so->so_rcvtimeo); - error = cv_timedwait_sig(&so->so_rcv_cv, - &so->so_lock, now); + error = cv_reltimedwait_sig( + &so->so_rcv_cv, &so->so_lock, + so->so_rcvtimeo, TR_CLOCK_TICK); } so->so_rcv_wakeup = B_FALSE; so->so_rcv_wanted = 0; @@ -1558,6 +1554,7 @@ so_strioc_nread(struct sonode *so, intptr_t arg, int mode, int32_t *rvalp) int retval; int count = 0; mblk_t *mp; + clock_t wakeup = drv_usectohz(10); if (so->so_downcalls == NULL || so->so_downcalls->sd_recv_uio != NULL) @@ -1575,8 +1572,8 @@ so_strioc_nread(struct sonode *so, intptr_t arg, int mode, int32_t *rvalp) so->so_flag |= SOWANT; /* Do a timed sleep, in case the reader goes to sleep. */ - (void) cv_timedwait(&so->so_state_cv, &so->so_lock, - lbolt + drv_usectohz(10)); + (void) cv_reltimedwait(&so->so_state_cv, &so->so_lock, wakeup, + TR_CLOCK_TICK); } /* diff --git a/usr/src/uts/common/fs/sockfs/sockstr.c b/usr/src/uts/common/fs/sockfs/sockstr.c index 26f3d4bd91..dc2af07a93 100644 --- a/usr/src/uts/common/fs/sockfs/sockstr.c +++ b/usr/src/uts/common/fs/sockfs/sockstr.c @@ -1078,11 +1078,8 @@ sowaitack(struct sonode *so, mblk_t **mpp, clock_t wait) /* * Only wait for the time limit. */ - clock_t now; - - time_to_wait(&now, wait); - if (cv_timedwait(&sti->sti_ack_cv, &so->so_lock, - now) == -1) { + if (cv_reltimedwait(&sti->sti_ack_cv, &so->so_lock, + wait, TR_CLOCK_TICK) == -1) { eprintsoline(so, ETIME); return (ETIME); } diff --git a/usr/src/uts/common/fs/sockfs/socksyscalls.c b/usr/src/uts/common/fs/sockfs/socksyscalls.c index bab4753591..9a25a7362d 100644 --- a/usr/src/uts/common/fs/sockfs/socksyscalls.c +++ b/usr/src/uts/common/fs/sockfs/socksyscalls.c @@ -1986,7 +1986,6 @@ snf_async_thread(void) snf_req_t *sr; callb_cpr_t cprinfo; clock_t time_left = 1; - clock_t now; CALLB_CPR_INIT(&cprinfo, &snfq->snfq_lock, callb_generic_cpr, "snfq"); @@ -2006,9 +2005,8 @@ snf_async_thread(void) } snfq->snfq_idle_cnt++; - time_to_wait(&now, snfq_timeout); - time_left = cv_timedwait(&snfq->snfq_cv, - &snfq->snfq_lock, now); + time_left = cv_reltimedwait(&snfq->snfq_cv, + &snfq->snfq_lock, snfq_timeout, TR_CLOCK_TICK); snfq->snfq_idle_cnt--; CALLB_CPR_SAFE_END(&cprinfo, &snfq->snfq_lock); |