]> git.baikalelectronics.ru Git - kernel.git/commit
rbd: separate reading header from decoding it
authorAlex Elder <elder@inktank.com>
Thu, 2 Aug 2012 16:29:46 +0000 (11:29 -0500)
committerAlex Elder <elder@inktank.com>
Mon, 1 Oct 2012 19:30:49 +0000 (14:30 -0500)
commitcb2d29d99031178060437d0f6dca57cf0fe641af
treea7ba73b249097f4e836b7582bf0785a477dc162a
parent3a07cac8aea589b947e9f4bb9f36aafe86426b42
rbd: separate reading header from decoding it

Right now rbd_read_header() both reads the header object for an rbd
image and decodes its contents.  It does this repeatedly if needed,
in order to ensure a complete and intact header is obtained.

Separate this process into two steps--reading of the raw header
data (in new function, rbd_dev_v1_header_read()) and separately
decoding its contents (in rbd_header_from_disk()).  As a result,
the latter function no longer requires its allocated_snaps argument.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
drivers/block/rbd.c