From a8c32ed5fea20beb9697628e14c5b0be0d154ef1 Mon Sep 17 00:00:00 2001 From: Changpeng Liu Date: Tue, 4 Jun 2019 23:47:11 -0400 Subject: [PATCH] blob: return error for write_zeroes and unmap requests Actually write/writev/write_zeroes/unmap are never be called, and we add the error code here to keep it same style with snapshot bs_bdev. Change-Id: I32ad051c1902bd7080b894e36f7c89f1c8d27434 Signed-off-by: Changpeng Liu Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/456924 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker --- lib/blob/zeroes.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/blob/zeroes.c b/lib/blob/zeroes.c index 5b482417d..a7de65410 100644 --- a/lib/blob/zeroes.c +++ b/lib/blob/zeroes.c @@ -73,8 +73,6 @@ zeroes_readv(struct spdk_bs_dev *dev, struct spdk_io_channel *channel, cb_args->cb_fn(cb_args->channel, cb_args->cb_arg, 0); } - - static void zeroes_writev(struct spdk_bs_dev *dev, struct spdk_io_channel *channel, struct iovec *iov, int iovcnt, @@ -90,7 +88,8 @@ zeroes_write_zeroes(struct spdk_bs_dev *dev, struct spdk_io_channel *channel, uint64_t lba, uint32_t lba_count, struct spdk_bs_dev_cb_args *cb_args) { - cb_args->cb_fn(cb_args->channel, cb_args->cb_arg, 0); + cb_args->cb_fn(cb_args->channel, cb_args->cb_arg, -EPERM); + assert(false); } static void @@ -98,7 +97,8 @@ zeroes_unmap(struct spdk_bs_dev *dev, struct spdk_io_channel *channel, uint64_t lba, uint32_t lba_count, struct spdk_bs_dev_cb_args *cb_args) { - cb_args->cb_fn(cb_args->channel, cb_args->cb_arg, 0); + cb_args->cb_fn(cb_args->channel, cb_args->cb_arg, -EPERM); + assert(false); } static struct spdk_bs_dev g_zeroes_bs_dev = {