]> Pileus Git - ~andy/linux/commit
rbd: update in-core header directly
authorAlex Elder <elder@inktank.com>
Mon, 6 May 2013 14:51:29 +0000 (09:51 -0500)
committerAlex Elder <elder@inktank.com>
Wed, 8 May 2013 22:00:37 +0000 (17:00 -0500)
commit662518b128c27def65e9af4bea2b56a1e04b3251
tree195365fca5ff452ad5364fb876f2b9a720e8ee5a
parentbb23e37acb2ae9604130c4819fb8ae0f784a3a2b
rbd: update in-core header directly

Now that rbd_header_from_disk() only fills in one-time fields once,
we can extend it slightly so it releases the other fields before
replacing their values.  This way there's no need to pass a
temporary buffer and then copy all the results in.  Just use the rbd
device header structure in rbd_header_from_disk() so its values get
updated directly.

Note that this means we need to take the header semaphore at the
point we update things.  So pass the rbd_dev rather than the address
of its header as its first argument to rbd_header_from_disk(), and
have it return an error code.

As a result, rbd_dev_v1_header_read() does all the work,
rbd_read_header() becomes unnecessary, and rbd_dev_v1_refresh()
becomes a very simple wrapper.

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