Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2992997AbWJUM5a (ORCPT ); Sat, 21 Oct 2006 08:57:30 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S2993000AbWJUM5a (ORCPT ); Sat, 21 Oct 2006 08:57:30 -0400 Received: from mtagate5.uk.ibm.com ([195.212.29.138]:40628 "EHLO mtagate5.uk.ibm.com") by vger.kernel.org with ESMTP id S2992997AbWJUM53 (ORCPT ); Sat, 21 Oct 2006 08:57:29 -0400 Subject: [Patch 1/5] I/O statistics through request queues: timeval_to_us() From: Martin Peschke To: Andrew Morton Cc: "linux-kernel@vger.kernel.org" Content-Type: text/plain Date: Sat, 21 Oct 2006 14:57:25 +0200 Message-Id: <1161435445.3054.112.camel@dyn-9-152-230-71.boeblingen.de.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-4.fc4) Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1328 Lines: 41 The next patch requires a timeval-to-microseconds conversion. Introducing a helper function (and fixing a comment). Signed-off-by: Martin Peschke --- time.h | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletion(-) diff -urp a/include/linux/time.h b/include/linux/time.h --- a/include/linux/time.h 2006-10-03 16:25:53.000000000 +0200 +++ b/include/linux/time.h 2006-10-06 21:36:08.000000000 +0200 @@ -133,8 +133,20 @@ static inline s64 timespec_to_ns(const s } /** + * timeval_to_us - Convert timeval to microseconds + * @tv: pointer to the timeval variable to be converted + * + * Returns the scalar nanosecond representation of the timeval + * parameter. + */ +static inline s64 timeval_to_us(const struct timeval *tv) +{ + return ((s64) tv->tv_sec * USEC_PER_SEC) + tv->tv_usec; +} + +/** * timeval_to_ns - Convert timeval to nanoseconds - * @ts: pointer to the timeval variable to be converted + * @tv: pointer to the timeval variable to be converted * * Returns the scalar nanosecond representation of the timeval * parameter. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/