aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-03-08 20:35:23 -0600
committerEric Sandeen <sandeen@redhat.com>2018-03-08 20:35:23 -0600
commita440f87737944bc2b4f1ce0b4dae7698703f0fdc (patch)
treef58b80e3cdbd341d0312bb6a5acd213e457d8eb5
parentc767c5aee0427c117b9338a62a5f140befd15aaa (diff)
downloadxfsprogs-dev-a440f87737944bc2b4f1ce0b4dae7698703f0fdc.tar.gz
xfs_scrub: fix #include ordering to avoid build failure
Fix the ordering of the header includes in all the scrub source. We put xfs.h first so that it will pull in include/linux.h which pulls in linux/fs.h + whatever overrides are necessary (currently limited to struct fsxattr) to make things work on this platform, and then we remove the #includes for anything that will get pulled (directly or indirectly) by xfs.h for cleanliness. Without this, a user compiling new xfsprogs on a system with a 4.7 kernel gets this: Building scrub [CC] disk.o In file included from ../include/xfs.h:37:0, from disk.c:40: ../include/xfs/linux.h:185:8: error: redefinition of 'struct fsxattr' struct fsxattr { ^~~~~~~ In file included from disk.c:31:0: /usr/include/linux/fs.h:155:8: note: originally defined here struct fsxattr { ^~~~~~~ gmake[2]: *** [../include/buildrules:60: disk.o] Error 1 gmake[1]: *** [include/buildrules:36: scrub] Error 2 make: *** [Makefile:77: default] Error 2 Reported-by: Mikael Magnusson <mikachu@gmail.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--scrub/bitmap.c5
-rw-r--r--scrub/common.c5
-rw-r--r--scrub/counter.c2
-rw-r--r--scrub/disk.c9
-rw-r--r--scrub/filemap.c6
-rw-r--r--scrub/fscounters.c5
-rw-r--r--scrub/inodes.c4
-rw-r--r--scrub/phase1.c10
-rw-r--r--scrub/phase2.c5
-rw-r--r--scrub/phase3.c5
-rw-r--r--scrub/phase4.c6
-rw-r--r--scrub/phase5.c5
-rw-r--r--scrub/phase6.c5
-rw-r--r--scrub/phase7.c5
-rw-r--r--scrub/progress.c4
-rw-r--r--scrub/read_verify.c5
-rw-r--r--scrub/scrub.c6
-rw-r--r--scrub/spacemap.c5
-rw-r--r--scrub/unicrash.c5
-rw-r--r--scrub/vfs.c4
-rw-r--r--scrub/xfs_scrub.c5
21 files changed, 21 insertions, 90 deletions
diff --git a/scrub/bitmap.c b/scrub/bitmap.c
index a88fd0ef68..212c3b8086 100644
--- a/scrub/bitmap.c
+++ b/scrub/bitmap.c
@@ -17,13 +17,10 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
-#include <stdbool.h>
+#include "xfs.h"
#include <stdint.h>
#include <stdlib.h>
-#include <errno.h>
#include <assert.h>
-#include <inttypes.h>
#include <pthread.h>
#include "platform_defs.h"
#include "avl64.h"
diff --git a/scrub/common.c b/scrub/common.c
index 4f26bf8d9b..5a37a984b2 100644
--- a/scrub/common.c
+++ b/scrub/common.c
@@ -17,14 +17,11 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <pthread.h>
-#include <stdbool.h>
#include <sys/statvfs.h>
#include <syslog.h>
#include "platform_defs.h"
-#include "xfs.h"
-#include "xfs_fs.h"
#include "path.h"
#include "xfs_scrub.h"
#include "common.h"
diff --git a/scrub/counter.c b/scrub/counter.c
index ced3cf3819..0e28f0f291 100644
--- a/scrub/counter.c
+++ b/scrub/counter.c
@@ -17,9 +17,9 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include "xfs.h"
#include <stdint.h>
#include <stdlib.h>
-#include <stdbool.h>
#include <string.h>
#include <assert.h>
#include <pthread.h>
diff --git a/scrub/disk.c b/scrub/disk.c
index e12175c865..798b4a06f0 100644
--- a/scrub/disk.c
+++ b/scrub/disk.c
@@ -17,18 +17,13 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <stdint.h>
#include <stdlib.h>
-#include <stdbool.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
#include <sys/statvfs.h>
-#include <sys/vfs.h>
-#include <linux/fs.h>
#ifdef HAVE_SG_IO
# include <scsi/sg.h>
#endif
@@ -37,9 +32,7 @@
#endif
#include "platform_defs.h"
#include "libfrog.h"
-#include "xfs.h"
#include "path.h"
-#include "xfs_fs.h"
#include "xfs_scrub.h"
#include "common.h"
#include "disk.h"
diff --git a/scrub/filemap.c b/scrub/filemap.c
index f42a6ba51c..056b3b0066 100644
--- a/scrub/filemap.c
+++ b/scrub/filemap.c
@@ -17,17 +17,13 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
-#include <stdbool.h>
+#include "xfs.h"
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/statvfs.h>
-#include "xfs.h"
-#include "xfs_fs.h"
#include "path.h"
#include "xfs_scrub.h"
#include "common.h"
diff --git a/scrub/fscounters.c b/scrub/fscounters.c
index ecdf4c6126..05bf95ef54 100644
--- a/scrub/fscounters.c
+++ b/scrub/fscounters.c
@@ -17,15 +17,12 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
-#include <stdbool.h>
+#include "xfs.h"
#include <stdint.h>
#include <stdlib.h>
#include <sys/statvfs.h>
#include "platform_defs.h"
-#include "xfs.h"
#include "xfs_arch.h"
-#include "xfs_fs.h"
#include "xfs_format.h"
#include "path.h"
#include "workqueue.h"
diff --git a/scrub/inodes.c b/scrub/inodes.c
index 744b003c33..ccfb9e05fb 100644
--- a/scrub/inodes.c
+++ b/scrub/inodes.c
@@ -17,14 +17,12 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
-#include <stdbool.h>
+#include "xfs.h"
#include <stdint.h>
#include <stdlib.h>
#include <pthread.h>
#include <sys/statvfs.h>
#include "platform_defs.h"
-#include "xfs.h"
#include "xfs_arch.h"
#include "xfs_format.h"
#include "handle.h"
diff --git a/scrub/phase1.c b/scrub/phase1.c
index 002c6425f9..992677097d 100644
--- a/scrub/phase1.c
+++ b/scrub/phase1.c
@@ -17,30 +17,22 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
-#include <mntent.h>
+#include "xfs.h"
#include <unistd.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/statvfs.h>
-#include <sys/vfs.h>
#include <fcntl.h>
#include <dirent.h>
#include <stdint.h>
-#include <stdbool.h>
#include <pthread.h>
-#include <errno.h>
-#include <linux/fs.h>
#include "libfrog.h"
#include "workqueue.h"
#include "input.h"
#include "path.h"
#include "handle.h"
#include "bitops.h"
-#include "xfs_arch.h"
-#include "xfs_format.h"
#include "avl64.h"
#include "list.h"
#include "xfs_scrub.h"
diff --git a/scrub/phase2.c b/scrub/phase2.c
index edf66df6a7..ad736bf50c 100644
--- a/scrub/phase2.c
+++ b/scrub/phase2.c
@@ -17,13 +17,10 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <stdint.h>
-#include <stdbool.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/statvfs.h>
-#include "xfs.h"
#include "list.h"
#include "path.h"
#include "workqueue.h"
diff --git a/scrub/phase3.c b/scrub/phase3.c
index a0ee5d9e3f..68c95e67b0 100644
--- a/scrub/phase3.c
+++ b/scrub/phase3.c
@@ -17,13 +17,10 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <stdint.h>
-#include <stdbool.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/statvfs.h>
-#include "xfs.h"
#include "list.h"
#include "path.h"
#include "workqueue.h"
diff --git a/scrub/phase4.c b/scrub/phase4.c
index 1fb8da9060..8573036a54 100644
--- a/scrub/phase4.c
+++ b/scrub/phase4.c
@@ -17,15 +17,11 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <stdint.h>
-#include <stdbool.h>
#include <dirent.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/statvfs.h>
-#include "xfs.h"
-#include "xfs_fs.h"
#include "list.h"
#include "path.h"
#include "workqueue.h"
diff --git a/scrub/phase5.c b/scrub/phase5.c
index 703b279818..0ef633978a 100644
--- a/scrub/phase5.c
+++ b/scrub/phase5.c
@@ -17,17 +17,14 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <stdint.h>
-#include <stdbool.h>
#include <dirent.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/statvfs.h>
#ifdef HAVE_LIBATTR
# include <attr/attributes.h>
#endif
-#include "xfs.h"
#include "handle.h"
#include "list.h"
#include "path.h"
diff --git a/scrub/phase6.c b/scrub/phase6.c
index e255eef3fe..b533cbbdd3 100644
--- a/scrub/phase6.c
+++ b/scrub/phase6.c
@@ -17,13 +17,10 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <stdint.h>
-#include <stdbool.h>
#include <dirent.h>
#include <sys/statvfs.h>
-#include "xfs.h"
-#include "xfs_fs.h"
#include "handle.h"
#include "path.h"
#include "ptvar.h"
diff --git a/scrub/phase7.c b/scrub/phase7.c
index 460ca8af82..50d04ae679 100644
--- a/scrub/phase7.c
+++ b/scrub/phase7.c
@@ -17,13 +17,10 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <stdint.h>
-#include <stdbool.h>
#include <stdlib.h>
#include <sys/statvfs.h>
-#include "xfs.h"
-#include "xfs_fs.h"
#include "path.h"
#include "ptvar.h"
#include "xfs_scrub.h"
diff --git a/scrub/progress.c b/scrub/progress.c
index 61b9c60a29..e9e720ba99 100644
--- a/scrub/progress.c
+++ b/scrub/progress.c
@@ -17,13 +17,11 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include "libxfs.h"
-#include <stdio.h>
+#include "xfs.h"
#include <dirent.h>
#include <pthread.h>
#include <sys/statvfs.h>
#include <time.h>
-#include "../repair/threads.h"
#include "path.h"
#include "disk.h"
#include "read_verify.h"
diff --git a/scrub/read_verify.c b/scrub/read_verify.c
index ae2e85fc86..d7bcc17781 100644
--- a/scrub/read_verify.c
+++ b/scrub/read_verify.c
@@ -17,15 +17,12 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <stdint.h>
-#include <stdbool.h>
#include <stdlib.h>
#include <sys/statvfs.h>
#include "workqueue.h"
#include "path.h"
-#include "xfs.h"
-#include "xfs_fs.h"
#include "xfs_scrub.h"
#include "common.h"
#include "counter.h"
diff --git a/scrub/scrub.c b/scrub/scrub.c
index ff5357c651..9e8267524c 100644
--- a/scrub/scrub.c
+++ b/scrub/scrub.c
@@ -17,17 +17,13 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
-#include <stdbool.h>
+#include "xfs.h"
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/statvfs.h>
-#include "xfs.h"
-#include "xfs_fs.h"
#include "list.h"
#include "path.h"
#include "xfs_scrub.h"
diff --git a/scrub/spacemap.c b/scrub/spacemap.c
index f631913002..36210355a3 100644
--- a/scrub/spacemap.c
+++ b/scrub/spacemap.c
@@ -17,15 +17,12 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
-#include <stdbool.h>
+#include "xfs.h"
#include <stdint.h>
#include <string.h>
#include <pthread.h>
#include <sys/statvfs.h>
#include "workqueue.h"
-#include "xfs.h"
-#include "xfs_fs.h"
#include "path.h"
#include "xfs_scrub.h"
#include "common.h"
diff --git a/scrub/unicrash.c b/scrub/unicrash.c
index ce3e7f94eb..0b5d1fac6b 100644
--- a/scrub/unicrash.c
+++ b/scrub/unicrash.c
@@ -17,17 +17,14 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <stdint.h>
-#include <stdbool.h>
#include <stdlib.h>
#include <dirent.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/statvfs.h>
#include <unistr.h>
#include <uninorm.h>
-#include "xfs.h"
#include "path.h"
#include "xfs_scrub.h"
#include "common.h"
diff --git a/scrub/vfs.c b/scrub/vfs.c
index 0c5b35351c..cfb58782f6 100644
--- a/scrub/vfs.c
+++ b/scrub/vfs.c
@@ -17,13 +17,11 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <stdint.h>
-#include <stdbool.h>
#include <dirent.h>
#include <sys/types.h>
#include <sys/statvfs.h>
-#include "xfs.h"
#include "handle.h"
#include "path.h"
#include "workqueue.h"
diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c
index 7ee02b669f..2d5528381a 100644
--- a/scrub/xfs_scrub.c
+++ b/scrub/xfs_scrub.c
@@ -17,16 +17,13 @@
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <stdio.h>
+#include "xfs.h"
#include <pthread.h>
-#include <stdbool.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/statvfs.h>
#include "platform_defs.h"
-#include "xfs.h"
-#include "xfs_fs.h"
#include "input.h"
#include "path.h"
#include "xfs_scrub.h"