rbd: only get snap context for write requests
authorAlex Elder <elder@inktank.com>
Fri, 9 Nov 2012 14:43:15 +0000 (08:43 -0600)
committerAlex Elder <elder@inktank.com>
Thu, 17 Jan 2013 21:52:00 +0000 (15:52 -0600)
commita7b4c65f4f15aa657b09d13da8f45ba0b72ec0df
treeb97da31aa196d5cad28ef5ae0f9e25bcc9d5e735
parentd78b650a595e23e5a115d332e3c37e019baf7703
rbd: only get snap context for write requests

Right now we get the snapshot context for an rbd image (under
protection of the header semaphore) for every request processed.

There's no need to get the snap context if we're doing a read,
so avoid doing so in that case.

Note that we no longer need to hold the header semaphore to
check the rbd_dev's existence flag.

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