Linux NFS development
 help / color / mirror / Atom feed
From: Fabio Olive Leite <fleite@redhat.com>
To: linux-nfs <nfs@lists.sourceforge.net>
Subject: Re: [PATCH] Attribute timeout handling and wrapping u32 jiffies
Date: Wed, 25 Jul 2007 11:28:24 -0300	[thread overview]
Message-ID: <20070725142824.GA24321@sleipnir.redhat.com> (raw)
In-Reply-To: <1185372013.6585.73.camel@localhost>

On Wed, Jul 25, 2007 at 10:00:13AM -0400, Trond Myklebust wrote:
> >  =

> > +#define timeout_or_wrap(a,b,c)	\
> > +	(typecheck(unsigned long, a) && \
> > +	 typecheck(unsigned long, b) && \
> > +	 ((a) < (b) || (a) - (b) > (c)))
> > +
> =

> Ugly name. Besides, the above macro causes problems at the wraparound
> boundary when (b) may indeed be < (a), but we're still in the allowed
> range. There is also no guarantee that (c) is unsigned. How about
> =

> #define time_in_range(a,b,c) \
> 	(time_after_eq(a,b) && \
> 	 time_before_eq(a,c))
> =

> instead?

Hmmm (a) is the "current" jiffies, (b) is the "stored" jiffies, and
both are always unsigned long. But (c) is the timeout constant, and I
thought better not to assume typing info there, as a small integer
fits in many types.

I think that in the second check you mean this:

#define time_in_range(a,b,c) \
	(time_after_eq(a,b) && \
	 time_before_eq(a,b+c))

I'll see about testing this new macro in my test box and will report
back soon.

Thanks,
F=E1bio
-- =

ex sed lex awk yacc, e pluribus unix, amem

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  reply	other threads:[~2007-07-25 14:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-25  3:08 [PATCH] Attribute timeout handling and wrapping u32 jiffies Fabio Olive Leite
2007-07-25 14:00 ` Trond Myklebust
2007-07-25 14:28   ` Fabio Olive Leite [this message]
2007-07-25 14:32     ` Trond Myklebust
2007-07-25 14:54       ` Fabio Olive Leite
2007-07-27  1:59       ` Fabio Olive Leite
2007-07-31 16:25         ` Fabio Olive Leite
2007-07-31 19:47           ` Trond Myklebust
2007-08-22 18:25             ` Fabio Olive Leite
2007-08-22 18:47               ` J. Bruce Fields
2007-08-27 13:23               ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070725142824.GA24321@sleipnir.redhat.com \
    --to=fleite@redhat.com \
    --cc=nfs@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox