aboutsummaryrefslogtreecommitdiff
path: root/tests/fs-tests
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-12 12:00:22 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-18 17:44:45 +0300
commite9906a50b9ac0ad2b8be8bf382e875df216f90d5 (patch)
tree944dc128eac8685ab6c7db692cc760f15b96001d /tests/fs-tests
parent43f5dbec6e9dc2b17e40e9c1cbb09f74fb882a8d (diff)
fs-tests: integck: move mem_page_size to fsinfo
The fsinfo structure will aggregate all the information about the tested file-system. Move 'mem_page_size' which we use for 'mmap()' there as well. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'tests/fs-tests')
-rw-r--r--tests/fs-tests/integrity/integck.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/fs-tests/integrity/integck.c b/tests/fs-tests/integrity/integck.c
index 3ee20b2..e7a3547 100644
--- a/tests/fs-tests/integrity/integck.c
+++ b/tests/fs-tests/integrity/integck.c
@@ -55,10 +55,12 @@ static struct {
* 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;
@@ -163,8 +165,6 @@ static int check_nospc_files = 1; /* Also check data in files that incurred a
static int can_mmap = 1; /* Can write via mmap */
-static long mem_page_size; /* Page size for mmap */
-
static unsigned int check_run_no;
/*
@@ -846,7 +846,7 @@ static void file_mmap_write(struct file_info *file)
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;
@@ -1958,9 +1958,6 @@ static int integck(void)
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);
@@ -2051,6 +2048,10 @@ static void get_tested_fs_info(void)
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