btrfs-progs: remove unnecessary linux/*.h includes

Decrease dependency on system headers, remove where they're not needed
or became stale after code moved. The path-utils.h encapsulate path
operations so include linux/limits.h here, that's where PATH_MAX is
defined.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2021-04-29 19:17:35 +02:00
parent aa56bf3a31
commit b19a603d62
9 changed files with 1 additions and 11 deletions

View File

@ -25,7 +25,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <ftw.h> #include <ftw.h>
#include <mntent.h> #include <mntent.h>
#include <linux/limits.h>
#include <linux/version.h> #include <linux/version.h>
#include <getopt.h> #include <getopt.h>
#include <limits.h> #include <limits.h>

View File

@ -27,7 +27,6 @@
#include <limits.h> #include <limits.h>
#include <getopt.h> #include <getopt.h>
#include <uuid/uuid.h> #include <uuid/uuid.h>
#include <linux/magic.h>
#include <btrfsutil.h> #include <btrfsutil.h>

View File

@ -23,7 +23,6 @@
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <dirent.h> #include <dirent.h>
#include <linux/limits.h>
#include <blkid/blkid.h> #include <blkid/blkid.h>
#include <uuid/uuid.h> #include <uuid/uuid.h>
#include "kernel-lib/overflow.h" #include "kernel-lib/overflow.h"

View File

@ -18,6 +18,7 @@
#define __BTRFS_PATH_UTILS_H__ #define __BTRFS_PATH_UTILS_H__
#include <sys/types.h> #include <sys/types.h>
#include <linux/limits.h>
char *path_canonicalize_dm_name(const char *ptname); char *path_canonicalize_dm_name(const char *ptname);
char *path_canonicalize(const char *path); char *path_canonicalize(const char *path);

View File

@ -30,9 +30,6 @@
#include <unistd.h> #include <unistd.h>
#include <mntent.h> #include <mntent.h>
#include <ctype.h> #include <ctype.h>
#include <linux/loop.h>
#include <linux/major.h>
#include <linux/kdev_t.h>
#include <limits.h> #include <limits.h>
#include <blkid/blkid.h> #include <blkid/blkid.h>
#include <sys/vfs.h> #include <sys/vfs.h>

View File

@ -18,8 +18,6 @@
#define __BTRFS_CONVERT_SOURCE_FS_H__ #define __BTRFS_CONVERT_SOURCE_FS_H__
#include "kerncompat.h" #include "kerncompat.h"
#include <linux/kdev_t.h>
#include <sys/types.h>
#include <pthread.h> #include <pthread.h>
#include <sys/types.h> #include <sys/types.h>

View File

@ -17,7 +17,6 @@
#if BTRFSCONVERT_REISERFS #if BTRFSCONVERT_REISERFS
#include "kerncompat.h" #include "kerncompat.h"
#include <linux/limits.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <limits.h> #include <limits.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -1,7 +1,6 @@
#ifndef _PERF_LINUX_BITOPS_H_ #ifndef _PERF_LINUX_BITOPS_H_
#define _PERF_LINUX_BITOPS_H_ #define _PERF_LINUX_BITOPS_H_
#include <linux/kernel.h>
#include <endian.h> #include <endian.h>
#include "common/internal.h" #include "common/internal.h"

View File

@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <linux/fs.h>
#include <unistd.h> #include <unistd.h>
#include "kernel-lib/list.h" #include "kernel-lib/list.h"