[PATCH v4 08/12] rbd: introduce IMG_REQ_NOLOCK flag for image request state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When we are going to replay an journal event, we don't need
to acquire exclusive_lock, as we are in lock acquiring.

Signed-off-by: Dongsheng Yang <dongsheng.yang@xxxxxxxxxxxx>
---
 drivers/block/rbd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 8a8914a..6b387d9 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -318,6 +318,7 @@ struct rbd_obj_request {
 enum img_req_flags {
 	IMG_REQ_CHILD,		/* initiator: block = 0, child image = 1 */
 	IMG_REQ_LAYERED,	/* ENOENT handling: normal = 0, layered = 1 */
+	IMG_REQ_NOLOCK,		/* don't need exclusive lock and ->lock_rwsem */
 };
 
 enum rbd_img_state {
@@ -3550,6 +3551,9 @@ static bool need_exclusive_lock(struct rbd_img_request *img_req)
 	if (rbd_dev->spec->snap_id != CEPH_NOSNAP)
 		return false;
 
+	if (test_bit(IMG_REQ_NOLOCK, &img_req->flags))
+		return false;
+
 	rbd_assert(!test_bit(IMG_REQ_CHILD, &img_req->flags));
 	if (rbd_dev->opts->lock_on_read ||
 	    (rbd_dev->header.features & RBD_FEATURE_OBJECT_MAP))
-- 
1.8.3.1





[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux