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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/