From owner-svn-src-projects@freebsd.org Fri Jul 8 10:27:45 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 081B0B76F6A for ; Fri, 8 Jul 2016 10:27:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA6DD1D2E; Fri, 8 Jul 2016 10:27:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u68ARhj1025727; Fri, 8 Jul 2016 10:27:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u68ARhZh025725; Fri, 8 Jul 2016 10:27:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201607081027.u68ARhZh025725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 8 Jul 2016 10:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302426 - in projects/hps_head: share/man/man9 sys/kern X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 10:27:45 -0000 Author: hselasky Date: Fri Jul 8 10:27:43 2016 New Revision: 302426 URL: https://svnweb.freebsd.org/changeset/base/302426 Log: Update the callout_stop() return values as done by r302350 and update the timeout(9) manual page. Differential Revision: https://reviews.freebsd.org/D7042 Modified: projects/hps_head/share/man/man9/timeout.9 projects/hps_head/sys/kern/kern_timeout.c Modified: projects/hps_head/share/man/man9/timeout.9 ============================================================================== --- projects/hps_head/share/man/man9/timeout.9 Fri Jul 8 10:06:02 2016 (r302425) +++ projects/hps_head/share/man/man9/timeout.9 Fri Jul 8 10:27:43 2016 (r302426) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 3, 2015 +.Dd July 8, 2015 .Dt TIMEOUT 9 .Os .Sh NAME @@ -312,6 +312,15 @@ This function returns either .Dv CALLOUT_RET_CANCELLED or .Dv CALLOUT_RET_DRAINING . +If the callout was scheduled regardless of being serviced or not, +.Dv CALLOUT_RET_CANCELLED +is returned. +If the callout was stopped and is still being serviced +.Dv CALLOUT_RET_DRAINING +is returned. +If the callout was stopped and is no longer being serviced +.Dv CALLOUT_RET_STOPPED +is returned. If a lock is associated with the callout given by the .Fa c argument and it is exclusivly locked when this function is called, this @@ -546,12 +555,22 @@ is undefined. This function is used to stop a timeout function invocation associated with the callout pointed to by the .Fa c argument, in a non-blocking fashion. -This function can be called multiple times in a row with no side effects, even if the callout is already stopped. This function however should not be called before the callout has been initialized. +This function can be called multiple times in a row with no side effects, even if the callout is already stopped. +This function however should not be called before the callout has been initialized. This function returns either .Dv CALLOUT_RET_STOPPED , .Dv CALLOUT_RET_CANCELLED or .Dv CALLOUT_RET_DRAINING . +If the callout is being serviced regardless of being scheduled or not, +.Dv CALLOUT_RET_DRAINING +is returned. +If the callout is not being serviced and was already stopped +.Dv CALLOUT_RET_STOPPED +is returned. +If the callout is not being serviced and was scheduled +.Dv CALLOUT_RET_CANCELLED +is returned. If a lock is associated with the callout given by the .Fa c argument and it is exclusivly locked when this function is called, the Modified: projects/hps_head/sys/kern/kern_timeout.c ============================================================================== --- projects/hps_head/sys/kern/kern_timeout.c Fri Jul 8 10:06:02 2016 (r302425) +++ projects/hps_head/sys/kern/kern_timeout.c Fri Jul 8 10:27:43 2016 (r302426) @@ -1036,7 +1036,10 @@ callout_restart_async(struct callout *c, } else if (cc_exec_cancel(cc, direct) == false || cc_exec_restart(cc, direct) == true) { cc_exec_cancel(cc, direct) = true; - retval = CALLOUT_RET_CANCELLED; + if (coa != NULL) + retval = CALLOUT_RET_CANCELLED; + else + retval = CALLOUT_RET_DRAINING; } else { retval = CALLOUT_RET_DRAINING; }