All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jasper Surmont <surmontjasper@gmail.com>
To: linux-block@vger.kernel.org
Subject: [Question] Accessing read data in bio request
Date: Thu, 14 Apr 2022 17:15:31 +0300	[thread overview]
Message-ID: <CAH4tiUtGuZP6QnO6L9EEDFL08O-UusHihO6CbvEf-QwJM3QPCg@mail.gmail.com> (raw)

I'm writing a device mapper target, and on a bio (read) request I want
to access (for example just logging) the data that was just read (by
providing a callback to bio->bio_end_io).

I've figured out I could read the data by using bvec_kmap_local() on
each bio_vec to get a pointer to the data. However, if my
understanding is correct this seems like an unefficient way: if the
bio just finished a read then shouldn't the data already be mapped
somewhere? If so, where?

2nd question: using bio_for_each_segment(...) inside the bio_end_io
callback never loops. Is this normal, and if so why?

Thanks!

             reply	other threads:[~2022-04-14 15:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 14:15 Jasper Surmont [this message]
2022-04-18  1:59 ` [Question] Accessing read data in bio request Jens Axboe
2022-04-18 13:06   ` Jasper Surmont
2022-04-18 15:33     ` Jens Axboe

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=CAH4tiUtGuZP6QnO6L9EEDFL08O-UusHihO6CbvEf-QwJM3QPCg@mail.gmail.com \
    --to=surmontjasper@gmail.com \
    --cc=linux-block@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.