From: Alex Elder Date: Mon, 6 May 2013 14:51:29 +0000 (-0500) Subject: rbd: update in-core header directly X-Git-Tag: v3.10-rc2~28^2~21 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=662518b128c27def65e9af4bea2b56a1e04b3251;p=pandora-kernel.git 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 Reviewed-by: Josh Durgin --- Reading git-diff-tree failed