static int rbd_obj_write_pre_object_map(struct rbd_obj_request *obj_req)
{
	struct rbd_device *rbd_dev = obj_req->img_request->rbd_dev;
	u8 new_state;

	if (!(rbd_dev->header.features & RBD_FEATURE_OBJECT_MAP))
		return 1;

	if (obj_req->flags & RBD_OBJ_FLAG_DELETION)
		new_state = OBJECT_PENDING;
	else
		new_state = OBJECT_EXISTS;

	return rbd_object_map_update(obj_req, CEPH_NOSNAP, new_state, NULL);
}
static int rbd_obj_write_pre_object_map(struct rbd_obj_request *obj_req)
{
	struct rbd_device *rbd_dev = obj_req->img_request->rbd_dev;
	u8 new_state;

	if (!(rbd_dev->header.features & RBD_FEATURE_OBJECT_MAP))
		return 1;

	if (obj_req->flags & RBD_OBJ_FLAG_DELETION)
		new_state = OBJECT_PENDING;
	else
		new_state = OBJECT_EXISTS;

	return rbd_object_map_update(obj_req, CEPH_NOSNAP, new_state, NULL);
}