From: Luk Claes Date: Mon, 3 Oct 2011 12:42:20 +0000 (-0400) Subject: blkmapd: Use getconf(_SC_PAGE_SIZE) X-Git-Tag: nfs-utils-1-2-6-rc1~1 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=fdc6e7eceb6db19bbab7928581f22ba87f257ea4;p=nfs-utils.git blkmapd: Use getconf(_SC_PAGE_SIZE) PAGE_SIZE is not exported by all architectures as it is not fixed: it can depend on the model of the machine. So it's better to query the system configuration for the actual page size on the machine. Signed-off-by: Luk Claes Signed-off-by: Steve Dickson --- diff --git a/utils/blkmapd/device-process.c b/utils/blkmapd/device-process.c index 27ff374..652a7a8 100644 --- a/utils/blkmapd/device-process.c +++ b/utils/blkmapd/device-process.c @@ -296,7 +296,7 @@ decode_blk_volume(uint32_t **pp, uint32_t *end, struct bl_volume *vols, int voln off_t stripe_unit = vol->param.bv_stripe_unit; /* Check limitations imposed by device-mapper */ if ((stripe_unit & (stripe_unit - 1)) != 0 - || stripe_unit < (off_t) (PAGE_SIZE >> 9)) + || stripe_unit < (off_t) (sysconf(_SC_PAGE_SIZE) >> 9)) return -EIO; BLK_READBUF(p, end, 4); READ32(vol->bv_vol_n);