btrfs-progs: unify header file inclusion protections

There are missing ifdefs or defines with very generic names.

Signed-off-by: David Sterba <dsterba@suse.cz>
master
David Sterba 2015-01-21 17:49:26 +01:00
parent 39568fa417
commit 07ce7005fc
27 changed files with 76 additions and 54 deletions

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __BTRFS_BACKREF__
#define __BTRFS_BACKREF__
#ifndef __BTRFS_BACKREF_H__
#define __BTRFS_BACKREF_H__
#include "ulist.h"
#include "extent_io.h"

View File

@ -16,6 +16,9 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __BTRFS_LIST_H__
#define __BTRFS_LIST_H__
#if BTRFS_FLAT_INCLUDES
#include "kerncompat.h"
#else
@ -165,3 +168,5 @@ int btrfs_list_get_default_subvolume(int fd, u64 *default_id);
char *btrfs_list_path_for_root(int fd, u64 root);
int btrfs_list_get_path_rootid(int fd, u64 *treeid);
int btrfs_get_subvol(int fd, struct root_info *the_ri);
#endif

View File

@ -17,8 +17,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __CHUNK_CHECK_H__
#define __CHUNK_CHECK_H__
#ifndef __BTRFS_CHECK_H__
#define __BTRFS_CHECK_H__
#if BTRFS_FLAT_INCLUDES
#include "kerncompat.h"

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __CMDS_FI_DISK_USAGE__
#define __CMDS_FI_DISK_USAGE__
#ifndef __CMDS_FI_DISK_USAGE_H__
#define __CMDS_FI_DISK_USAGE_H__
extern const char * const cmd_filesystem_usage_usage[];
int cmd_filesystem_usage(int argc, char **argv);

View File

@ -14,6 +14,9 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __BTRFS_COMMANDS_H__
#define __BTRFS_COMMANDS_H__
struct cmd_struct {
const char *token;
int (*fn)(int, char **);
@ -121,3 +124,5 @@ int test_issubvolume(char *path);
/* send.c */
char *get_subvol_name(char *mnt, char *full_path);
#endif

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __BTRFS__
#define __BTRFS__
#ifndef __BTRFS_CTREE_H__
#define __BTRFS_CTREE_H__
#if BTRFS_FLAT_INCLUDES
#include "list.h"

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __DISKIO__
#define __DISKIO__
#ifndef __BTRFS_DISK_IO_H__
#define __BTRFS_DISK_IO_H__
#define BTRFS_SUPER_INFO_OFFSET (64 * 1024)
#define BTRFS_SUPER_INFO_SIZE 4096
@ -110,7 +110,8 @@ int verify_tree_block_csum_silent(struct extent_buffer *buf, u16 csum_size);
int btrfs_read_buffer(struct extent_buffer *buf, u64 parent_transid);
int write_and_map_eb(struct btrfs_trans_handle *trans, struct btrfs_root *root,
struct extent_buffer *eb);
#endif
/* raid6.c */
void raid6_gen_syndrome(int disks, size_t bytes, void **ptrs);
#endif

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __EXTENT_CACHE_H__
#define __EXTENT_CACHE_H__
#ifndef __BTRFS_EXTENT_CACHE_H__
#define __BTRFS_EXTENT_CACHE_H__
#if BTRFS_FLAT_INCLUDES
#include "kerncompat.h"

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __EXTENTMAP__
#define __EXTENTMAP__
#ifndef __BTRFS_EXTENT_IO_H__
#define __BTRFS_EXTENT_IO_H__
#if BTRFS_FLAT_INCLUDES
#include "kerncompat.h"

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __BTRFS_FREE_SPACE_CACHE
#define __BTRFS_FREE_SPACE_CACHE
#ifndef __BTRFS_FREE_SPACE_CACHE_H__
#define __BTRFS_FREE_SPACE_CACHE_H__
struct btrfs_free_space {
struct rb_node offset_index;

5
hash.h
View File

@ -16,8 +16,9 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __HASH__
#define __HASH__
#ifndef __BTRFS_HASH_H__
#define __BTRFS_HASH_H__
#include "crc32c.h"
static inline u64 btrfs_name_hash(const char *name, int len)

View File

@ -16,8 +16,9 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __IOCTL_
#define __IOCTL_
#ifndef __BTRFS_IOCTL_H__
#define __BTRFS_IOCTL_H__
#include <asm/types.h>
#include <linux/ioctl.h>
#include <time.h>

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __KERNCOMPAT
#define __KERNCOMPAT
#ifndef __KERNCOMPAT_H__
#define __KERNCOMPAT_H__
#include <stdio.h>
#include <stdlib.h>
@ -351,7 +351,6 @@ struct __una_u64 { __le64 x; } __attribute__((__packed__));
#define put_unaligned_le32(val,p) (((struct __una_u32 *)(p))->x = cpu_to_le32(val))
#define get_unaligned_le64(p) le64_to_cpu(((const struct __una_u64 *)(p))->x)
#define put_unaligned_le64(val,p) (((struct __una_u64 *)(p))->x = cpu_to_le64(val))
#endif
#ifndef true
#define true 1
@ -361,3 +360,5 @@ struct __una_u64 { __le64 x; } __attribute__((__packed__));
#ifndef noinline
#define noinline
#endif
#endif

View File

@ -16,8 +16,9 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __PRINT_TREE_
#define __PRINT_TREE_
#ifndef __PRINT_TREE_H__
#define __PRINT_TREE_H__
void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l);
void btrfs_print_tree(struct btrfs_root *root, struct extent_buffer *t, int follow);
void btrfs_print_key(struct btrfs_disk_key *disk_key);

View File

@ -14,8 +14,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef PROPS_H_
#define PROPS_H_
#ifndef __BTRFS_PROPS_H__
#define __BTRFS_PROPS_H__
enum prop_object_type {
prop_object_dev = (1 << 0),
@ -40,4 +40,4 @@ struct prop_handler {
extern const struct prop_handler prop_handlers[];
#endif /* PROPS_H_ */
#endif

View File

@ -16,12 +16,12 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef _BTRFS_QGROUP_VERIFY_H
#define _BTRFS_QGROUP_VERIFY_H
#ifndef __BTRFS_QGROUP_VERIFY_H__
#define __BTRFS_QGROUP_VERIFY_H__
int qgroup_verify_all(struct btrfs_fs_info *info);
void print_qgroup_report(int all);
int print_extent_state(struct btrfs_fs_info *info, u64 subvol);
#endif /* _BTRFS_QGROUP_VERIFY_H */
#endif

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef _BTRFS_QGROUP_H
#define _BTRFS_QGROUP_H
#ifndef __BTRFS_QGROUP_H__
#define __BTRFS_QGROUP_H__
#include "ioctl.h"
#include "kerncompat.h"

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __BTRFS_REPAIR__
#define __BTRFS_REPAIR__
#ifndef __BTRFS_REPAIR_H__
#define __BTRFS_REPAIR_H__
struct btrfs_corrupt_block {
struct cache_extent cache;

View File

@ -15,8 +15,9 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/
#ifndef SEND_STREAM_H_
#define SEND_STREAM_H_
#ifndef __BTRFS_SEND_STREAM_H__
#define __BTRFS_SEND_STREAM_H__
/*
* NOTE: this file is public API, any incompatible change has to update
@ -70,4 +71,4 @@ int btrfs_read_and_process_send_stream(int fd,
}
#endif
#endif /* SEND_STREAM_H_ */
#endif

View File

@ -15,8 +15,9 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/
#ifndef SEND_UTILS_H_
#define SEND_UTILS_H_
#ifndef __BTRFS_SEND_UTILS_H__
#define __BTRFS_SEND_UTILS_H__
#if BTRFS_FLAT_INCLUDES
#include "ctree.h"
@ -93,4 +94,4 @@ char *path_cat3(const char *p1, const char *p2, const char *p3);
}
#endif
#endif /* SEND_UTILS_H_ */
#endif

5
send.h
View File

@ -17,6 +17,9 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __BTRFS_SEND_H__
#define __BTRFS_SEND_H__
#include "ctree.h"
#ifdef __cplusplus
@ -140,3 +143,5 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -14,8 +14,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef STRING_TABLE_H
#define STRING_TABLE_H
#ifndef __STRING_TABLE_H__
#define __STRING_TABLE_H__
struct string_table {

View File

@ -14,8 +14,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __TASK_UTILS_H_
#define __TASK_UTILS_H_
#ifndef __TASK_UTILS_H__
#define __TASK_UTILS_H__
#include <pthread.h>

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __TRANSACTION__
#define __TRANSACTION__
#ifndef __BTRFS_TRANSACTION_H__
#define __BTRFS_TRANSACTION_H__
struct btrfs_trans_handle {
u64 transid;

View File

@ -5,8 +5,8 @@
*
*/
#ifndef __ULIST__
#define __ULIST__
#ifndef __ULIST_H__
#define __ULIST_H__
#include "kerncompat.h"
#include "list.h"

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __UTILS__
#define __UTILS__
#ifndef __BTRFS_UTILS_H__
#define __BTRFS_UTILS_H__
#include <sys/stat.h>
#include "ctree.h"

View File

@ -16,8 +16,8 @@
* Boston, MA 021110-1307, USA.
*/
#ifndef __BTRFS_VOLUMES_
#define __BTRFS_VOLUMES_
#ifndef __BTRFS_VOLUMES_H__
#define __BTRFS_VOLUMES_H__
#define BTRFS_STRIPE_LEN (64 * 1024)