nvme: add nvme opcodes, structures and helper functions
[fio.git] / t / memlock.c
index ebedb91d4eb67417563fd4e969e52d6b9bf3feec..9f5a3ea8a731f5f4870e53e32a3baffe6f8e5189 100644 (file)
@@ -22,7 +22,7 @@ static void *worker(void *data)
                for (index = 0; index + 4096 < size; index += 4096)
                        memset(&buf[index+512], 0x89, 512);
                if (first) {
-                       printf("loop%d: did %lu MiB\n", i+1, size/(1024UL*1024UL));
+                       printf("loop%d: did %lu MiB\n", i+1, td->mib);
                        first = 0;
                }
        }
@@ -43,6 +43,10 @@ int main(int argc, char *argv[])
 
        mib = strtoul(argv[1], NULL, 10);
        threads = strtoul(argv[2], NULL, 10);
+       if (threads < 1 || threads > 65536) {
+               printf("%s: invalid 'threads' argument\n", argv[0]);
+               return 1;
+       }
 
        pthreads = calloc(threads, sizeof(pthread_t));
        td.mib = mib;