* [PATCH] blkmapd: Use getconf(_SC_PAGE_SIZE)
@ 2011-10-02 17:27 Luk Claes
2011-10-03 12:54 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: Luk Claes @ 2011-10-02 17:27 UTC (permalink / raw)
To: Steve Dickson, linux-nfs; +Cc: Luk Claes
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 <luk@debian.org>
---
utils/blkmapd/device-process.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
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);
--
1.7.6.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] blkmapd: Use getconf(_SC_PAGE_SIZE)
2011-10-02 17:27 [PATCH] blkmapd: Use getconf(_SC_PAGE_SIZE) Luk Claes
@ 2011-10-03 12:54 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2011-10-03 12:54 UTC (permalink / raw)
To: Luk Claes; +Cc: linux-nfs
On 10/02/2011 01:27 PM, Luk Claes wrote:
> 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 <luk@debian.org>
Committed...
steved.
> ---
> utils/blkmapd/device-process.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> 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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-10-03 12:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-02 17:27 [PATCH] blkmapd: Use getconf(_SC_PAGE_SIZE) Luk Claes
2011-10-03 12:54 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).