X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fcheckfiemap.c;h=2dea8128057cbd0976ea03d667663d6c80fe848c;hb=8520cfb2f77b6fc89a9c0e174f783d745dbaf2e3;hp=b28beb6ef6783c6c4d84ed87d159afaff7ad4930;hpb=1b2547843817b4b7adbeb87ea9b070d9cac35c90;p=fs%2Flustre-release.git diff --git a/lustre/tests/checkfiemap.c b/lustre/tests/checkfiemap.c index b28beb6..2dea812 100644 --- a/lustre/tests/checkfiemap.c +++ b/lustre/tests/checkfiemap.c @@ -38,16 +38,12 @@ #include #include #include +#include +#include +#include -#ifndef HAVE_FIEMAP -# include -# include -#endif - -#ifdef __linux__ -# ifndef FS_IOC_FIEMAP -# define FS_IOC_FIEMAP (_IOWR('f', 11, struct fiemap)) -# endif +#ifndef FS_IOC_FIEMAP +# define FS_IOC_FIEMAP (_IOWR('f', 11, struct fiemap)) #endif #define ONEMB 1048576 @@ -69,7 +65,7 @@ int check_fiemap(int fd, long long orig_size) memset(&fiemap_buf, 0, sizeof(fiemap_buf)); fiemap->fm_start = 0; - fiemap->fm_flags = FIEMAP_FLAG_SYNC; + fiemap->fm_flags = (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_DEVICE_ORDER); fiemap->fm_extent_count = count; fiemap->fm_length = FIEMAP_MAX_OFFSET; @@ -105,8 +101,8 @@ int main(int argc, char **argv) { int c; struct option long_opts[] = { - {"test", no_argument, 0, 't'}, - {NULL, 0, NULL, 0} + { .name = "test", .has_arg = no_argument, .val = 't' }, + { .name = NULL } }; int fd; int rc;