From 7a9af3cd0e609e10840202ae1754ab76b6add511 Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Mon, 22 Jan 2018 16:56:25 +0000 Subject: [PATCH] device: Add flag to indicate that a code path can support AIO Until the whole source supports AIO, library code can check for AIO_SUPPORTED_CODE_PATH to determine whether or not it is OK to use AIO. --- WHATS_NEW | 1 + lib/cache/lvmcache.c | 2 +- lib/device/device.h | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index 911a6e340..87d7de825 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.178 - ===================================== + Add AIO_SUPPORTED_CODE_PATH to indicate whether AIO may be used. Configure ensures /usr/bin dir is checked for dmpd tools. Restore pvmove support for wide-clustered active volumes (2.02.177). Avoid non-exclusive activation of exclusive segment types. diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index 65728fd81..2eaf479d2 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -1156,7 +1156,7 @@ int lvmcache_label_scan(struct cmd_context *cmd) while ((dev = dev_iter_get(iter))) { nr_labels_outstanding++; - if (!label_read_callback(dev, UINT64_C(0), 0, _process_label_data, &nr_labels_outstanding)) + if (!label_read_callback(dev, UINT64_C(0), AIO_SUPPORTED_CODE_PATH, _process_label_data, &nr_labels_outstanding)) nr_labels_outstanding--; dev_count++; } diff --git a/lib/device/device.h b/lib/device/device.h index d5b076f95..2dea689c0 100644 --- a/lib/device/device.h +++ b/lib/device/device.h @@ -32,6 +32,11 @@ #define DEV_ASSUMED_FOR_LV 0x00000200 /* Is device assumed for an LV */ #define DEV_NOT_O_NOATIME 0x00000400 /* Don't use O_NOATIME */ +/* ioflags */ +#define AIO_SUPPORTED_CODE_PATH 0x00000001 /* Set if the code path supports AIO */ + +#define aio_supported_code_path(ioflags) (((ioflags) & AIO_SUPPORTED_CODE_PATH) ? 1 : 0) + /* * Standard format for callback functions. * When provided, callback functions are called exactly once.