fibmap: include f2fs_fs.h before other header files

GCC 7.2.0 is unhappy with the usage of major/minor:

fibmap.c: In function ‘print_stat’:
fibmap.c:70:13: warning: In the GNU C Library, "major" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "major", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "major", you should undefine it after including <sys/types.h>.
  printf("dev       [%d:%d]\n", major(st->st_dev), minor(st->st_dev));
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is because config.h is not included first, as a result, macros
defined in config.h is not recognized. So let's include f2fs_fs.h
before other header files.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Sheng Yong 2018-02-27 16:39:33 +08:00 committed by Jaegeuk Kim
parent c265813af3
commit 4d4a9f2d45

View File

@ -15,6 +15,7 @@
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#endif
#include <f2fs_fs.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
@ -38,7 +39,6 @@
#include <linux/fs.h>
#endif
#include <inttypes.h>
#include <f2fs_fs.h>
#ifndef FIBMAP
#define FIBMAP _IO(0x00, 1) /* bmap access */