Whamcloud - gitweb
b=2811
authorphil <phil>
Tue, 1 Mar 2005 00:12:35 +0000 (00:12 +0000)
committerphil <phil>
Tue, 1 Mar 2005 00:12:35 +0000 (00:12 +0000)
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
lustre/utils/obd.c

index e91b1b2..7d51bd0 100644 (file)
@@ -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') {
index 4444fea..24bd1eb 100644 (file)
@@ -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);
                 }