Commit d68459fc authored by paul luse's avatar paul luse Committed by Tomasz Zawadzki
Browse files

lib/bdev: Add comment to bdev_io_put_buf() when unsetting bounce buffer



To clarify what seems like it might be unintentional.

Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Change-Id: Id14b49e8b7bc2372ecb8dd7579e6797a395c2cf2
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/477363


Community-CI: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Community-CI: SPDK CI Jenkins <sys_sgci@intel.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent bf4db834
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -682,7 +682,7 @@ _bdev_io_unset_bounce_buf(struct spdk_bdev_io *bdev_io)
				  bdev_io->internal.bounce_iov.iov_base,
				  bdev_io->internal.bounce_iov.iov_len);
	}
	/* set orignal buffer for this io */
	/* set original buffer for this io */
	bdev_io->u.bdev.iovcnt = bdev_io->internal.orig_iovcnt;
	bdev_io->u.bdev.iovs = bdev_io->internal.orig_iovs;
	/* disable bouncing buffer for this io */
@@ -703,6 +703,9 @@ _bdev_io_unset_bounce_buf(struct spdk_bdev_io *bdev_io)
		bdev_io->internal.orig_md_buf = NULL;
	}

	/* We want to free the bounce buffer here since we know we're done with it (as opposed
	 * to waiting for the conditional free of internal.buf in spdk_bdev_free_io()).
	 */
	bdev_io_put_buf(bdev_io);
}