rbd: introduce RBD_DEV_FLAG_READONLY
authorIlya Dryomov <idryomov@gmail.com>
Thu, 7 Nov 2019 16:16:23 +0000 (17:16 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 25 Nov 2019 10:44:02 +0000 (11:44 +0100)
commit39258aa2db8175271d8079b7685a6e328a8c1a63
tree13cfc7040e31e587f193509ebd800b80e96fb310
parentf3c0e45900a60e1de1a03f74327ea341e713ea45
rbd: introduce RBD_DEV_FLAG_READONLY

rbd_dev->opts is not available for parent images, making checking
rbd_dev->opts->read_only in various places (rbd_dev_image_probe(),
need_exclusive_lock(), use_object_map() in the following patches)
harder than it needs to be.

Keeping rbd_dev_image_probe() in mind, move the initialization in
do_rbd_add() up.  snap_id isn't filled in at that point, so replace
rbd_is_snap() with a snap_name comparison.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
drivers/block/rbd.c