From d03ffd3b79b9a83c7279c1f62baab9a42b8d94fb Mon Sep 17 00:00:00 2001 From: phil Date: Tue, 1 Mar 2005 00:12:35 +0000 Subject: [PATCH] b=2811 HP's utils_pagesize_issues.patch: Info: HP SFS 1678 Enhance the lfs command to warn if stripe size is not an exact multiple of page size. HP SFS 211/CFS 2811 Fix the lctl command to use dynamically calculated page size rather than compiled in page size setting. This means the command doesn't need to be rebuilt/re-installed if we reboot on a kernel with a different page size. --- lustre/utils/lfs.c | 7 +++++++ lustre/utils/obd.c | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index e91b1b2..7d51bd0 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -87,6 +87,7 @@ static int lfs_setstripe(int argc, char **argv) long st_size; int st_offset, st_count; char *end; + int page_size; if (argc != 5) return CMD_HELP; @@ -98,6 +99,12 @@ static int lfs_setstripe(int argc, char **argv) argv[0], argv[2]); return CMD_HELP; } + page_size = getpagesize(); + if (st_size % page_size) + fprintf(stderr, + "WARNING: stripe size %d is not an increment of page size %d\n", + st_size, page_size); + // get the stripe offset st_offset = strtoul(argv[3], &end, 0); if (*end != '\0') { diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 4444fea..24bd1eb 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -1495,11 +1495,11 @@ int jt_obd_test_brw(int argc, char **argv) jt_cmdname(argv[0]), argv[6]); return CMD_HELP; } - data.ioc_plen1 *= PAGE_SIZE; + data.ioc_plen1 *= getpagesize(); } - len = pages * PAGE_SIZE; - thr_offset = offset_pages * PAGE_SIZE; + len = pages * getpagesize(); + thr_offset = offset_pages * getpagesize(); stride = len; if (thread) { @@ -1559,7 +1559,7 @@ int jt_obd_test_brw(int argc, char **argv) printf("%s: %s number %d @ "LPD64":"LPU64" for %d\n", jt_cmdname(argv[0]), write ? "write" : "read", i, data.ioc_obdo1.o_id, data.ioc_offset, - (int)(pages * PAGE_SIZE)); + (int)(pages * getpagesize())); pthread_mutex_unlock (&shared_data->mutex); } -- 1.8.3.1