kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: fser@code-libre.org (François)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Reading disks sectors
Date: Tue, 29 Mar 2016 14:39:34 +0200	[thread overview]
Message-ID: <CAAn988YOoFiKW2P3ijtuOpv4HAbi2aqFjWjkOk8eeXeYYbGCTw@mail.gmail.com> (raw)

Hello,

I'm trying to read raw disks sectors using bio requests.
I found a sample in a stackoverflow answer which seems to do exactly
what I'm trying to : http://stackoverflow.com/a/17527300/51760
Reading this, a few questions came to me:


1/ The API is outdated, and bio struct no longer have bi_sector for instance.
Those fields are now in bvec_iter (see
http://lxr.free-electrons.com/source/include/linux/blk_types.h?v=3.19).

bio struct do have  bi_iter field, so I was wondering wether it's safe
to populate the bi_iter directly ie:

- bio->bi_sector = sector;
+ bio->bi_iter.bi_sector = sector;

2/ There is a generic bi_endio function in bio.c.
What should readComplete implement? IMO it should just complete the
"event" (of type struct completion), and then I can just call the
bio_endio function provided by bio.c. Is that correct?

Thanks in advance!

---
Fran?ois

             reply	other threads:[~2016-03-29 12:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 12:39 François [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-03-30  5:27 Reading disks sectors Manoj Nayak

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=CAAn988YOoFiKW2P3ijtuOpv4HAbi2aqFjWjkOk8eeXeYYbGCTw@mail.gmail.com \
    --to=fser@code-libre.org \
    --cc=kernelnewbies@lists.kernelnewbies.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 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).