linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolaus Rath <Nikolaus@rath.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org,
	fuse-devel <fuse-devel@lists.sourceforge.net>
Subject: Re: [fuse-devel] [fuse] Getting visibility into reads from page cache
Date: Fri, 08 May 2020 18:04:34 +0100	[thread overview]
Message-ID: <871rnu4au5.fsf@vostro.rath.org> (raw)
In-Reply-To: <874ksq4fa9.fsf@vostro.rath.org> (Nikolaus Rath's message of "Fri, 08 May 2020 16:28:30 +0100")

On May 08 2020, Nikolaus Rath <Nikolaus@rath.org> wrote:
>>
>>   sudo bpftrace -e 'kretprobe:fuse_file_read_iter { printf ("fuse
>> read: %d\n", retval); }'
>
>
> - I believe that (struct kiocb*)arg0)->ki_pos will give me the offset
>   within the file, but where can I see how much data is being read?

Looking at the code in fuse_file_read_iter, it seems the length is in
((struct iov_iter*)arg1)->count, but I do not really understand why.

The definiton of this parameter is:

struct iov_iter {
	int type;
	const struct iovec *iov;
	unsigned long nr_segs;
	size_t iov_offset;
	size_t count;
};

..so I would think that *count* is the number of `iovec` elements hiding
behind the `iov` pointer, not some total number of bytes.

Furthermore, there is a function iov_length() that is documented to
return the "total number of bytes covered by an iovec" and doesn't look
at `count` at all.

Can someone elucidate why the number of bytes to be read from the file
is in iov_iter.count?


Best,
-Nikolaus

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«

  reply	other threads:[~2020-05-08 17:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-25 17:06 [fuse] Getting visibility into reads from page cache Nikolaus Rath
2020-04-27  9:26 ` Miklos Szeredi
2020-05-08 15:28   ` [fuse-devel] " Nikolaus Rath
2020-05-08 17:04     ` Nikolaus Rath [this message]
2020-05-11 12:12     ` Miklos Szeredi

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=871rnu4au5.fsf@vostro.rath.org \
    --to=nikolaus@rath.org \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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).