linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tpepper@vato.org
To: linux-kernel@vger.kernel.org
Subject: b_dev vs. b_rdev confusion
Date: Tue, 19 Jun 2001 11:11:36 -0700	[thread overview]
Message-ID: <20010619111136.A25405@cb.vato.org> (raw)

These are probably dumb questions but I haven't been able to find
definitive answers...

Is there a set rule on when/where one should use a buffer head's b_dev
and when/where one should use b_rdev?

I'm been tracing through the kernel source quite a bit and it seems like
above ll_rw_blk.c's submit_bh() b_dev is being used.  Below there as the
request heads off into whichever block device b_rdev is used.  Is this
true?  Things read like the b_dev/b_rdev distinction was introduced to
facilitate block drivers intercepting and redirecting requests (lvm,
raid, multipathing, &tc.) and I'm trying to figure out if there's a
clean delineation of which is used where and if I can safely twiddle
b_rdev and pass the buffer head on without copying it.  (Are these what are
somtimes called "stacking drivers" here?)

All of the md code looks like it copies the buffer head, setting
b_dev=b_rdev="real device" in the new bh and leaving b_dev==b_rdev="logical
device" in the original bh.  I'm assuming they do this for a reason, but
it would be nice from a performance standpoint to just touch b_rdev and
b_end_io and be done.  Is there something I'm missing which necessitates the
copy?

And how do the inode->i_dev, i_rdev and i_bdev fit into this?  When are those
set and does anything get confused by i_rdev moving?

Thanks in advance for any suggestions/info...

Tim

             reply	other threads:[~2001-06-19 18:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-19 18:11 tpepper [this message]
2001-06-19 18:25 ` b_dev vs. b_rdev confusion Tim Pepper
2001-06-19 18:55 Andries.Brouwer

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=20010619111136.A25405@cb.vato.org \
    --to=tpepper@vato.org \
    --cc=linux-kernel@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 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).