[lkml]   [2001]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectb_dev vs. b_rdev confusion
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

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...

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:55    [W:0.024 / U:1.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site