Commit 66fc591f authored by Jim Harris's avatar Jim Harris
Browse files

blob: change spdk_bs_io_xxx_blob functions to spdk_blob_io_xxx



These new names are much more clear and are aligned with other
functions such as spdk_blob_close.

Keep the old names around for now but deprecate them.  We will
remove them in next release.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: Idc60fd0b19fa2a8b0247a1f5835774d342e721f9

Reviewed-on: https://review.gerrithub.io/400884


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent e14cdc7d
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -20,6 +20,19 @@ experimental pending a functional allocator to free and reallocate CMB buffers.
Namespaces may now be assigned unique identifiers via new optional "eui64" and "nguid" parameters
to the `nvmf_subsystem_add_ns` RPC method.

### Blobstore

A number of functions have been renamed:

- spdk_bs_io_write_blob() => spdk_blob_io_write()
- spdk_bs_io_read_blob() => spdk_blob_io_read()
- spdk_bs_io_writev_blob() => spdk_blob_io_writev()
- spdk_bs_io_readv_blob() => spdk_blob_io_readv()
- spdk_bs_io_unmap_blob() => spdk_blob_io_unmap()
- spdk_bs_io_write_zeroes_blob() => spdk_blob_io_write_zeroes()

The old names still exist but are deprecated.  They will be removed in the v18.07 release.

## v18.01: Blobstore Thin Provisioning

### Build System
+18 −18
Original line number Diff line number Diff line
@@ -595,7 +595,7 @@ read_dump_cb(void *arg1, int bserrno)
	printf(".");
	if (++cli_context->page_count < cli_context->blob_pages) {
		/* perform another read */
		spdk_bs_io_read_blob(cli_context->blob, cli_context->channel,
		spdk_blob_io_read(cli_context->blob, cli_context->channel,
				  cli_context->buff, cli_context->page_count,
				  NUM_PAGES, read_dump_cb, cli_context);
	} else {
@@ -643,7 +643,7 @@ write_imp_cb(void *arg1, int bserrno)
	}
	if (++cli_context->page_count < cli_context->blob_pages) {
		printf(".");
		spdk_bs_io_write_blob(cli_context->blob, cli_context->channel,
		spdk_blob_io_write(cli_context->blob, cli_context->channel,
				   cli_context->buff, cli_context->page_count,
				   NUM_PAGES, write_imp_cb, cli_context);
	} else {
@@ -695,7 +695,7 @@ dump_imp_open_cb(void *cb_arg, struct spdk_blob *blob, int bserrno)
		}

		/* read a page of data from the blob */
		spdk_bs_io_read_blob(cli_context->blob, cli_context->channel,
		spdk_blob_io_read(cli_context->blob, cli_context->channel,
				  cli_context->buff, cli_context->page_count,
				  NUM_PAGES, read_dump_cb, cli_context);
	} else {
@@ -723,7 +723,7 @@ dump_imp_open_cb(void *cb_arg, struct spdk_blob *blob, int bserrno)
			       cli_context->page_size - cli_context->filesize);
		}

		spdk_bs_io_write_blob(cli_context->blob, cli_context->channel,
		spdk_blob_io_write(cli_context->blob, cli_context->channel,
				   cli_context->buff, cli_context->page_count,
				   NUM_PAGES, write_imp_cb, cli_context);
	}
@@ -744,7 +744,7 @@ write_cb(void *arg1, int bserrno)
	}
	printf(".");
	if (++cli_context->page_count < cli_context->blob_pages) {
		spdk_bs_io_write_blob(cli_context->blob, cli_context->channel,
		spdk_blob_io_write(cli_context->blob, cli_context->channel,
				   cli_context->buff, cli_context->page_count,
				   NUM_PAGES, write_cb, cli_context);
	} else {
@@ -782,7 +782,7 @@ fill_blob_cb(void *arg1, struct spdk_blob *blob, int bserrno)
	memset(cli_context->buff, cli_context->fill_value,
	       cli_context->page_size);
	printf("Working");
	spdk_bs_io_write_blob(cli_context->blob, cli_context->channel,
	spdk_blob_io_write(cli_context->blob, cli_context->channel,
			   cli_context->buff,
			   STARTING_PAGE, NUM_PAGES, write_cb, cli_context);
}
+6 −6
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ read_blob(struct hello_context_t *hello_context)
	}

	/* Issue the read and compare the results in the callback. */
	spdk_bs_io_read_blob(hello_context->blob, hello_context->channel,
	spdk_blob_io_read(hello_context->blob, hello_context->channel,
			  hello_context->read_buff, 0, 1, read_complete,
			  hello_context);
}
@@ -242,7 +242,7 @@ blob_write(struct hello_context_t *hello_context)
	}

	/* Let's perform the write, 1 page at offset 0. */
	spdk_bs_io_write_blob(hello_context->blob, hello_context->channel,
	spdk_blob_io_write(hello_context->blob, hello_context->channel,
			   hello_context->write_buff,
			   0, 1, write_complete, hello_context);
}
+39 −16
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@
 * The metadata thread is the thread which called spdk_bs_init() or
 * spdk_bs_load().
 *
 * Functions starting with the prefix "spdk_bs_io" are passed a channel
 * Functions starting with the prefix "spdk_blob_io" are passed a channel
 * as an argument, and channels may only be used from the thread they were
 * created on. See \ref spdk_bs_alloc_io_channel.
 *
@@ -280,33 +280,56 @@ struct spdk_io_channel *spdk_bs_alloc_io_channel(struct spdk_blob_store *bs);
void spdk_bs_free_io_channel(struct spdk_io_channel *channel);

/* Write data to a blob. Offset is in pages from the beginning of the blob. */
void spdk_bs_io_write_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
void spdk_blob_io_write(struct spdk_blob *blob, struct spdk_io_channel *channel,
			void *payload, uint64_t offset, uint64_t length,
			spdk_blob_op_complete cb_fn, void *cb_arg);

/* Read data from a blob. Offset is in pages from the beginning of the blob. */
void spdk_bs_io_read_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
void spdk_blob_io_read(struct spdk_blob *blob, struct spdk_io_channel *channel,
		       void *payload, uint64_t offset, uint64_t length,
		       spdk_blob_op_complete cb_fn, void *cb_arg);

/* Write data to a blob. Offset is in pages from the beginning of the blob. */
void spdk_bs_io_writev_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
void spdk_blob_io_writev(struct spdk_blob *blob, struct spdk_io_channel *channel,
			 struct iovec *iov, int iovcnt, uint64_t offset, uint64_t length,
			 spdk_blob_op_complete cb_fn, void *cb_arg);

/* Read data from a blob. Offset is in pages from the beginning of the blob. */
void spdk_bs_io_readv_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
void spdk_blob_io_readv(struct spdk_blob *blob, struct spdk_io_channel *channel,
			struct iovec *iov, int iovcnt, uint64_t offset, uint64_t length,
			spdk_blob_op_complete cb_fn, void *cb_arg);

/* Unmap area of a blob. Offset is in pages from the beginning of the blob. */
void spdk_bs_io_unmap_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
void spdk_blob_io_unmap(struct spdk_blob *blob, struct spdk_io_channel *channel,
			uint64_t offset, uint64_t length, spdk_blob_op_complete cb_fn, void *cb_arg);

/* Write zeros into area of a blob. Offset is in pages from the beginning of the blob. */
void spdk_bs_io_write_zeroes_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
void spdk_blob_io_write_zeroes(struct spdk_blob *blob, struct spdk_io_channel *channel,
			       uint64_t offset, uint64_t length, spdk_blob_op_complete cb_fn, void *cb_arg);

/*
 * The following spdk_bs_io prefixed functions are deprecated in favor of their corresponding spdk_blob_io
 * function above.
 */
void spdk_bs_io_write_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
			   void *payload, uint64_t offset, uint64_t length,
			   spdk_blob_op_complete cb_fn, void *cb_arg) __attribute__((deprecated));
void spdk_bs_io_read_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
			  void *payload, uint64_t offset, uint64_t length,
			  spdk_blob_op_complete cb_fn, void *cb_arg) __attribute__((deprecated));
void spdk_bs_io_writev_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
			    struct iovec *iov, int iovcnt, uint64_t offset, uint64_t length,
			    spdk_blob_op_complete cb_fn, void *cb_arg) __attribute__((deprecated));
void spdk_bs_io_readv_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
			   struct iovec *iov, int iovcnt, uint64_t offset, uint64_t length,
			   spdk_blob_op_complete cb_fn, void *cb_arg) __attribute__((deprecated));
void spdk_bs_io_unmap_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
			   uint64_t offset, uint64_t length,
			   spdk_blob_op_complete cb_fn, void *cb_arg)  __attribute__((deprecated));
void spdk_bs_io_write_zeroes_blob(struct spdk_blob *blob, struct spdk_io_channel *channel,
				  uint64_t offset, uint64_t length,
				  spdk_blob_op_complete cb_fn, void *cb_arg)  __attribute__((deprecated));

/* Iterate through all blobs */
void spdk_bs_iter_first(struct spdk_blob_store *bs,
			spdk_blob_op_with_handle_complete cb_fn, void *cb_arg);
+6 −7
Original line number Diff line number Diff line
@@ -604,7 +604,7 @@ lvol_unmap(struct spdk_lvol *lvol, struct spdk_io_channel *ch, struct spdk_bdev_
	SPDK_INFOLOG(SPDK_LOG_VBDEV_LVOL,
		     "Vbdev doing unmap at offset %" PRIu64 " using %" PRIu64 " pages on device %s\n", start_page,
		     num_pages, bdev_io->bdev->name);
	spdk_bs_io_unmap_blob(blob, ch, start_page, num_pages, lvol_op_comp, task);
	spdk_blob_io_unmap(blob, ch, start_page, num_pages, lvol_op_comp, task);
}

static void
@@ -622,7 +622,7 @@ lvol_write_zeroes(struct spdk_lvol *lvol, struct spdk_io_channel *ch, struct spd
	SPDK_INFOLOG(SPDK_LOG_VBDEV_LVOL,
		     "Vbdev doing write zeros at offset %" PRIu64 " using %" PRIu64 " pages on device %s\n", start_page,
		     num_pages, bdev_io->bdev->name);
	spdk_bs_io_write_zeroes_blob(blob, ch, start_page, num_pages, lvol_op_comp, task);
	spdk_blob_io_write_zeroes(blob, ch, start_page, num_pages, lvol_op_comp, task);
}

static void
@@ -641,9 +641,8 @@ lvol_read(struct spdk_io_channel *ch, struct spdk_bdev_io *bdev_io)
	SPDK_INFOLOG(SPDK_LOG_VBDEV_LVOL,
		     "Vbdev doing read at offset %" PRIu64 " using %" PRIu64 " pages on device %s\n", start_page,
		     num_pages, bdev_io->bdev->name);
	spdk_bs_io_readv_blob(blob, ch, bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt, start_page,
			      num_pages,
			      lvol_op_comp, task);
	spdk_blob_io_readv(blob, ch, bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt, start_page,
			   num_pages, lvol_op_comp, task);
}

static void
@@ -661,7 +660,7 @@ lvol_write(struct spdk_lvol *lvol, struct spdk_io_channel *ch, struct spdk_bdev_
	SPDK_INFOLOG(SPDK_LOG_VBDEV_LVOL,
		     "Vbdev doing write at offset %" PRIu64 " using %" PRIu64 " pages on device %s\n", start_page,
		     num_pages, bdev_io->bdev->name);
	spdk_bs_io_writev_blob(blob, ch, bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt, start_page,
	spdk_blob_io_writev(blob, ch, bdev_io->u.bdev.iovs, bdev_io->u.bdev.iovcnt, start_page,
			    num_pages, lvol_op_comp, task);
}

Loading