diff mbox

block: Add comment to submit_bio_wait()

Message ID 20170802082521.3925-1-jack@suse.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kara Aug. 2, 2017, 8:25 a.m. UTC
submit_bio_wait() does not consume bio reference. Add comment about
that.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 block/bio.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jens Axboe Aug. 2, 2017, 2:25 p.m. UTC | #1
On 08/02/2017 02:25 AM, Jan Kara wrote:
> submit_bio_wait() does not consume bio reference. Add comment about
> that.

Thanks, added for 4.14.
diff mbox

Patch

diff --git a/block/bio.c b/block/bio.c
index 9a63597aaacc..e241bbc49f14 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -936,6 +936,10 @@  static void submit_bio_wait_endio(struct bio *bio)
  *
  * Simple wrapper around submit_bio(). Returns 0 on success, or the error from
  * bio_endio() on failure.
+ *
+ * WARNING: Unlike to how submit_bio() is usually used, this function does not
+ * result in bio reference to be consumed. The caller must drop the reference
+ * on his own.
  */
 int submit_bio_wait(struct bio *bio)
 {