* The below data structure describes the tested file-system.
*
* max_name_len: maximum file name length
+ * page_size: memory page size to use with 'mmap()'
* fstype: file-system type (e.g., "ubifs")
*/
static struct {
int max_name_len;
+ int page_size;
const char *fstype;
} fsinfo;
static int can_mmap = 1; /* Can write via mmap */
-static long mem_page_size; /* Page size for mmap */
-
static unsigned int check_run_no;
/*
for (i = 0; w && w->next && i < r; i++)
w = w->next;
- offs = (w->offset / mem_page_size) * mem_page_size;
+ offs = (w->offset / fsinfo.page_size) * fsinfo.page_size;
len = w->size + (w->offset - offs);
if (len > 1 << 24)
len = 1 << 24;
uint64_t z;
char dir_name[256];
- /* Get memory page size for mmap */
- mem_page_size = sysconf(_SC_PAGE_SIZE);
- CHECK(mem_page_size > 0);
/* Make our top directory */
pid = getpid();
normsg("pid is %u", (unsigned) pid);
fclose(f);
fsinfo.fstype = dup_string(mntent->mnt_type);
+
+ /* Get memory page size for 'mmap()' */
+ fsinfo.page_size = sysconf(_SC_PAGE_SIZE);
+ CHECK(fsinfo.page_size > 0);
}
static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION