linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: NeilBrown <neilb@suse.de>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] sunrpc: Simplify cache_defer_req and related functions.
Date: Mon, 11 Oct 2010 20:07:18 -0400	[thread overview]
Message-ID: <20101012000718.GF16442@fieldses.org> (raw)
In-Reply-To: <20101007042946.26629.7991.stgit@localhost.localdomain>

On Thu, Oct 07, 2010 at 03:29:46PM +1100, NeilBrown wrote:
> The return value from cache_defer_req is somewhat confusing.
> Various different error codes are returned, but the single caller is
> only interested in success or failure.
> 
> In fact it can measure this success or failure itself by checking
> CACHE_PENDING, which makes the point of the code more explicit.
> 
> So change cache_defer_req to return 'void' and test CACHE_PENDING
> after it completes, to see if the request was actually deferred or
> not.
> 
> Similarly setup_deferral and cache_wait_req don't need a return value,
> so make them void and remove some code.
> 
> The call to cache_revisit_request (to guard against a race) is only
> needed for the second call to setup_deferral, so move it out of
> setup_deferral to after that second call.  With the first call the
> race is handled differently (by explicitly calling
> 'wait_for_completion').

Thanks, applied both of these.  But, this:

> -static int cache_wait_req(struct cache_req *req, struct cache_head *item)
...
> +		cache_wait_req(req, item, timeout);

suggests this version of the patch wasn't really tested!  Would you mind
doing some testing on the version I've just pushed out?

--b.

  reply	other threads:[~2010-10-12  0:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07  4:29 [PATCH 0/2] revised sunrpc deferral patches NeilBrown
2010-10-07  4:29 ` [PATCH 1/2] sunrpc: Simplify cache_defer_req and related functions NeilBrown
2010-10-12  0:07   ` J. Bruce Fields [this message]
2010-10-07  4:29 ` [PATCH 2/2] sunrpc/cache: centralise handling of size limit on deferred list NeilBrown

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=20101012000718.GF16442@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).