aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/vdev_disk.c
diff options
context:
space:
mode:
authorNed Bass <[email protected]>2017-08-02 21:16:12 -0700
committerBrian Behlendorf <[email protected]>2017-08-02 21:16:12 -0700
commitecb2b7dc7f8f7273c215fb30c984bde08e75b852 (patch)
tree55e26ef1e29163fba495ba517d8133d475169651 /module/zfs/vdev_disk.c
parent6710381680b0f551c37627e3a5a4886ccf99983f (diff)
Use SET_ERROR for constant non-zero return codes
Update many return and assignment statements to follow the convention of using the SET_ERROR macro when returning a hard-coded non-zero value from a function. This aids debugging by recording the error codes in the debug log. Reviewed-by: George Melikov <[email protected]> Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Signed-off-by: Ned Bass <[email protected]> Closes #6441
Diffstat (limited to 'module/zfs/vdev_disk.c')
-rw-r--r--module/zfs/vdev_disk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c
index f87f7913e..f671d079d 100644
--- a/module/zfs/vdev_disk.c
+++ b/module/zfs/vdev_disk.c
@@ -533,7 +533,7 @@ __vdev_disk_physio(struct block_device *bdev, zio_t *zio,
retry:
dr = vdev_disk_dio_alloc(bio_count);
if (dr == NULL)
- return (ENOMEM);
+ return (SET_ERROR(ENOMEM));
if (zio && !(zio->io_flags & (ZIO_FLAG_IO_RETRY | ZIO_FLAG_TRYHARD)))
bio_set_flags_failfast(bdev, &flags);
@@ -574,7 +574,7 @@ retry:
BIO_MAX_PAGES));
if (unlikely(dr->dr_bio[i] == NULL)) {
vdev_disk_dio_free(dr);
- return (ENOMEM);
+ return (SET_ERROR(ENOMEM));
}
/* Matching put called by vdev_disk_physio_completion */
@@ -645,12 +645,12 @@ vdev_disk_io_flush(struct block_device *bdev, zio_t *zio)
q = bdev_get_queue(bdev);
if (!q)
- return (ENXIO);
+ return (SET_ERROR(ENXIO));
bio = bio_alloc(GFP_NOIO, 0);
/* bio_alloc() with __GFP_WAIT never returns NULL */
if (unlikely(bio == NULL))
- return (ENOMEM);
+ return (SET_ERROR(ENOMEM));
bio->bi_end_io = vdev_disk_io_flush_completion;
bio->bi_private = zio;