img_req 641 drivers/block/rbd.c static void rbd_img_handle_request(struct rbd_img_request *img_req, int result); img_req 1512 drivers/block/rbd.c static bool rbd_img_is_write(struct rbd_img_request *img_req) img_req 1514 drivers/block/rbd.c switch (img_req->op_type) { img_req 2514 drivers/block/rbd.c struct rbd_img_request *img_req = obj_req->img_request; img_req 2516 drivers/block/rbd.c switch (img_req->op_type) { img_req 2518 drivers/block/rbd.c if (!use_object_map(img_req->rbd_dev) || img_req 2561 drivers/block/rbd.c static int __rbd_img_fill_request(struct rbd_img_request *img_req) img_req 2566 drivers/block/rbd.c for_each_obj_request_safe(img_req, obj_req, next_obj_req) { img_req 2567 drivers/block/rbd.c switch (img_req->op_type) { img_req 2586 drivers/block/rbd.c rbd_img_obj_request_del(img_req, obj_req); img_req 2591 drivers/block/rbd.c img_req->state = RBD_IMG_START; img_req 2611 drivers/block/rbd.c struct rbd_img_request *img_req = arg; img_req 2618 drivers/block/rbd.c rbd_img_obj_request_add(img_req, obj_req); img_req 2634 drivers/block/rbd.c static int rbd_img_fill_request_nocopy(struct rbd_img_request *img_req, img_req 2642 drivers/block/rbd.c img_req->data_type = fctx->pos_type; img_req 2650 drivers/block/rbd.c ret = ceph_file_to_extents(&img_req->rbd_dev->layout, img_req 2653 drivers/block/rbd.c &img_req->object_extents, img_req 2654 drivers/block/rbd.c alloc_object_extent, img_req, img_req 2660 drivers/block/rbd.c return __rbd_img_fill_request(img_req); img_req 2676 drivers/block/rbd.c static int rbd_img_fill_request(struct rbd_img_request *img_req, img_req 2681 drivers/block/rbd.c struct rbd_device *rbd_dev = img_req->rbd_dev; img_req 2688 drivers/block/rbd.c return rbd_img_fill_request_nocopy(img_req, img_extents, img_req 2691 drivers/block/rbd.c img_req->data_type = OBJ_REQUEST_OWN_BVECS; img_req 2705 drivers/block/rbd.c &img_req->object_extents, img_req 2706 drivers/block/rbd.c alloc_object_extent, img_req, img_req 2712 drivers/block/rbd.c for_each_obj_request(img_req, obj_req) { img_req 2729 drivers/block/rbd.c &img_req->object_extents, img_req 2735 drivers/block/rbd.c return __rbd_img_fill_request(img_req); img_req 2738 drivers/block/rbd.c static int rbd_img_fill_nodata(struct rbd_img_request *img_req, img_req 2748 drivers/block/rbd.c return rbd_img_fill_request(img_req, &ex, 1, &fctx); img_req 2788 drivers/block/rbd.c static int __rbd_img_fill_from_bio(struct rbd_img_request *img_req, img_req 2801 drivers/block/rbd.c return rbd_img_fill_request(img_req, img_extents, num_img_extents, img_req 2805 drivers/block/rbd.c static int rbd_img_fill_from_bio(struct rbd_img_request *img_req, img_req 2811 drivers/block/rbd.c return __rbd_img_fill_from_bio(img_req, &ex, 1, &it); img_req 2848 drivers/block/rbd.c static int __rbd_img_fill_from_bvecs(struct rbd_img_request *img_req, img_req 2861 drivers/block/rbd.c return rbd_img_fill_request(img_req, img_extents, num_img_extents, img_req 2865 drivers/block/rbd.c static int rbd_img_fill_from_bvecs(struct rbd_img_request *img_req, img_req 2876 drivers/block/rbd.c return __rbd_img_fill_from_bvecs(img_req, img_extents, num_img_extents, img_req 2882 drivers/block/rbd.c struct rbd_img_request *img_req = img_req 2885 drivers/block/rbd.c rbd_img_handle_request(img_req, img_req->work_result); img_req 2888 drivers/block/rbd.c static void rbd_img_schedule(struct rbd_img_request *img_req, int result) img_req 2890 drivers/block/rbd.c INIT_WORK(&img_req->work, rbd_img_handle_request_work); img_req 2891 drivers/block/rbd.c img_req->work_result = result; img_req 2892 drivers/block/rbd.c queue_work(rbd_wq, &img_req->work); img_req 2933 drivers/block/rbd.c struct rbd_img_request *img_req = obj_req->img_request; img_req 2937 drivers/block/rbd.c child_img_req = rbd_img_request_create(img_req->rbd_dev->parent, img_req 2948 drivers/block/rbd.c if (!rbd_img_is_write(img_req)) { img_req 2949 drivers/block/rbd.c switch (img_req->data_type) { img_req 3521 drivers/block/rbd.c struct rbd_img_request *img_req = obj_req->img_request; img_req 3522 drivers/block/rbd.c struct rbd_device *rbd_dev = img_req->rbd_dev; img_req 3526 drivers/block/rbd.c if (!rbd_img_is_write(img_req)) img_req 3535 drivers/block/rbd.c obj_op_name(img_req->op_type), obj_req->ex.oe_objno, img_req 3551 drivers/block/rbd.c static bool need_exclusive_lock(struct rbd_img_request *img_req) img_req 3553 drivers/block/rbd.c struct rbd_device *rbd_dev = img_req->rbd_dev; img_req 3561 drivers/block/rbd.c rbd_assert(!test_bit(IMG_REQ_CHILD, &img_req->flags)); img_req 3566 drivers/block/rbd.c return rbd_img_is_write(img_req); img_req 3569 drivers/block/rbd.c static bool rbd_lock_add_request(struct rbd_img_request *img_req) img_req 3571 drivers/block/rbd.c struct rbd_device *rbd_dev = img_req->rbd_dev; img_req 3577 drivers/block/rbd.c rbd_assert(list_empty(&img_req->lock_item)); img_req 3579 drivers/block/rbd.c list_add_tail(&img_req->lock_item, &rbd_dev->acquiring_list); img_req 3581 drivers/block/rbd.c list_add_tail(&img_req->lock_item, &rbd_dev->running_list); img_req 3586 drivers/block/rbd.c static void rbd_lock_del_request(struct rbd_img_request *img_req) img_req 3588 drivers/block/rbd.c struct rbd_device *rbd_dev = img_req->rbd_dev; img_req 3593 drivers/block/rbd.c rbd_assert(!list_empty(&img_req->lock_item)); img_req 3594 drivers/block/rbd.c list_del_init(&img_req->lock_item); img_req 3602 drivers/block/rbd.c static int rbd_img_exclusive_lock(struct rbd_img_request *img_req) img_req 3604 drivers/block/rbd.c struct rbd_device *rbd_dev = img_req->rbd_dev; img_req 3606 drivers/block/rbd.c if (!need_exclusive_lock(img_req)) img_req 3609 drivers/block/rbd.c if (rbd_lock_add_request(img_req)) img_req 3626 drivers/block/rbd.c static void rbd_img_object_requests(struct rbd_img_request *img_req) img_req 3630 drivers/block/rbd.c rbd_assert(!img_req->pending.result && !img_req->pending.num_pending); img_req 3632 drivers/block/rbd.c for_each_obj_request(img_req, obj_req) { img_req 3637 drivers/block/rbd.c img_req->pending.result = result; img_req 3641 drivers/block/rbd.c img_req->pending.num_pending++; img_req 3646 drivers/block/rbd.c static bool rbd_img_advance(struct rbd_img_request *img_req, int *result) img_req 3648 drivers/block/rbd.c struct rbd_device *rbd_dev = img_req->rbd_dev; img_req 3652 drivers/block/rbd.c switch (img_req->state) { img_req 3656 drivers/block/rbd.c ret = rbd_img_exclusive_lock(img_req); img_req 3661 drivers/block/rbd.c img_req->state = RBD_IMG_EXCLUSIVE_LOCK; img_req 3669 drivers/block/rbd.c rbd_assert(!need_exclusive_lock(img_req) || img_req 3672 drivers/block/rbd.c rbd_img_object_requests(img_req); img_req 3673 drivers/block/rbd.c if (!img_req->pending.num_pending) { img_req 3674 drivers/block/rbd.c *result = img_req->pending.result; img_req 3675 drivers/block/rbd.c img_req->state = RBD_IMG_OBJECT_REQUESTS; img_req 3678 drivers/block/rbd.c img_req->state = __RBD_IMG_OBJECT_REQUESTS; img_req 3681 drivers/block/rbd.c if (!pending_result_dec(&img_req->pending, result)) img_req 3694 drivers/block/rbd.c static bool __rbd_img_handle_request(struct rbd_img_request *img_req, img_req 3697 drivers/block/rbd.c struct rbd_device *rbd_dev = img_req->rbd_dev; img_req 3700 drivers/block/rbd.c if (need_exclusive_lock(img_req)) { img_req 3702 drivers/block/rbd.c mutex_lock(&img_req->state_mutex); img_req 3703 drivers/block/rbd.c done = rbd_img_advance(img_req, result); img_req 3705 drivers/block/rbd.c rbd_lock_del_request(img_req); img_req 3706 drivers/block/rbd.c mutex_unlock(&img_req->state_mutex); img_req 3709 drivers/block/rbd.c mutex_lock(&img_req->state_mutex); img_req 3710 drivers/block/rbd.c done = rbd_img_advance(img_req, result); img_req 3711 drivers/block/rbd.c mutex_unlock(&img_req->state_mutex); img_req 3717 drivers/block/rbd.c test_bit(IMG_REQ_CHILD, &img_req->flags) ? "child " : "", img_req 3718 drivers/block/rbd.c obj_op_name(img_req->op_type), *result); img_req 3723 drivers/block/rbd.c static void rbd_img_handle_request(struct rbd_img_request *img_req, int result) img_req 3726 drivers/block/rbd.c if (!__rbd_img_handle_request(img_req, &result)) img_req 3729 drivers/block/rbd.c if (test_bit(IMG_REQ_CHILD, &img_req->flags)) { img_req 3730 drivers/block/rbd.c struct rbd_obj_request *obj_req = img_req->obj_request; img_req 3732 drivers/block/rbd.c rbd_img_request_put(img_req); img_req 3734 drivers/block/rbd.c img_req = obj_req->img_request; img_req 3738 drivers/block/rbd.c struct request *rq = img_req->rq; img_req 3740 drivers/block/rbd.c rbd_img_request_put(img_req); img_req 3963 drivers/block/rbd.c struct rbd_img_request *img_req; img_req 3977 drivers/block/rbd.c list_for_each_entry(img_req, &rbd_dev->acquiring_list, lock_item) { img_req 3978 drivers/block/rbd.c mutex_lock(&img_req->state_mutex); img_req 3979 drivers/block/rbd.c rbd_assert(img_req->state == RBD_IMG_EXCLUSIVE_LOCK); img_req 3980 drivers/block/rbd.c rbd_img_schedule(img_req, result); img_req 3981 drivers/block/rbd.c mutex_unlock(&img_req->state_mutex);