linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Dominique Martinet <asmadeus@codewreck.org>
Cc: dhowells@redhat.com, Eric Van Hensbergen <ericvh@gmail.com>,
	Latchesar Ionkov <lucho@ionkov.net>,
	v9fs-developer@lists.sourceforge.net, linux-cachefs@redhat.com,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] 9p: Convert to new fscache API
Date: Wed, 18 Nov 2020 12:00:47 +0000	[thread overview]
Message-ID: <1553535.1605700847@warthog.procyon.org.uk> (raw)
In-Reply-To: <1517306.1605699813@warthog.procyon.org.uk>

David Howells <dhowells@redhat.com> wrote:

> +static void v9fs_req_issue_op(struct netfs_read_subrequest *subreq)
>  {
> +	struct netfs_read_request *rreq = subreq->rreq;
> +	struct p9_fid *fid = rreq->netfs_priv;
>  	struct iov_iter to;
> +	loff_t pos = subreq->start + subreq->transferred;
> +	size_t len = subreq->len   - subreq->transferred;
>  	int retval, err;
>  
> +	iov_iter_xarray(&to, READ, &rreq->mapping->i_pages, pos, len);
>  
> +	retval = p9_client_read(fid, pos, &to, &err);
> +	if (retval)
> +		subreq->error = retval;

I forgot something: netfs_subreq_terminated() needs to be called when the read
is complete.  If p9_client_read() is synchronous, then that would be here,
probably something like:

	retval = p9_client_read(fid, pos, &to, &err);
	netfs_subreq_terminated(subreq, retval);

is what's required.  Manually setting subreq->error can then be removed.

David


  parent reply	other threads:[~2020-11-18 12:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 11:02 [PATCH] 9p: Convert to new fscache API David Howells
2020-11-18 11:43 ` David Howells
2020-11-18 12:00 ` David Howells [this message]
2020-11-18 12:48 ` Dominique Martinet
2020-11-18 13:38 ` David Howells
2020-11-18 14:16   ` Dominique Martinet
2020-11-18 15:02   ` David Howells
2020-11-18 14:59 ` David Howells

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=1553535.1605700847@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=asmadeus@codewreck.org \
    --cc=ericvh@gmail.com \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=lucho@ionkov.net \
    --cc=v9fs-developer@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;
as well as URLs for NNTP newsgroup(s).