Commit f2f7ba5237e2fe10ba3e328a4f728b9e1ff141da

Authored by Steven Whitehouse
1 parent 2bdbc5d739

[GFS2] Make headers compile on their own

As per Jan Engelhardt's comments, this should make all the headers
compile on their own by including and/or declaring structures
early.

Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

Showing 27 changed files with 77 additions and 2 deletions Side-by-side Diff

... ... @@ -10,6 +10,8 @@
10 10 #ifndef __ACL_DOT_H__
11 11 #define __ACL_DOT_H__
12 12  
  13 +#include "incore.h"
  14 +
13 15 #define GFS2_POSIX_ACL_ACCESS "posix_acl_access"
14 16 #define GFS2_POSIX_ACL_ACCESS_LEN 16
15 17 #define GFS2_POSIX_ACL_DEFAULT "posix_acl_default"
... ... @@ -10,6 +10,10 @@
10 10 #ifndef __BMAP_DOT_H__
11 11 #define __BMAP_DOT_H__
12 12  
  13 +struct inode;
  14 +struct gfs2_inode;
  15 +struct page;
  16 +
13 17 int gfs2_unstuff_dinode(struct gfs2_inode *ip, struct page *page);
14 18 int gfs2_block_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, int *boundary);
15 19 int gfs2_extent_map(struct inode *inode, u64 lblock, int *new, u64 *dblock, unsigned *extlen);
... ... @@ -10,6 +10,12 @@
10 10 #ifndef __DIR_DOT_H__
11 11 #define __DIR_DOT_H__
12 12  
  13 +#include <linux/dcache.h>
  14 +
  15 +struct inode;
  16 +struct gfs2_inode;
  17 +struct gfs2_inum;
  18 +
13 19 /**
14 20 * gfs2_filldir_t - Report a directory entry to the caller of gfs2_dir_read()
15 21 * @opaque: opaque data used by the function
... ... @@ -11,6 +11,7 @@
11 11 #define __EAOPS_DOT_H__
12 12  
13 13 struct gfs2_ea_request;
  14 +struct gfs2_inode;
14 15  
15 16 struct gfs2_eattr_operations {
16 17 int (*eo_get) (struct gfs2_inode *ip, struct gfs2_ea_request *er);
... ... @@ -10,6 +10,9 @@
10 10 #ifndef __EATTR_DOT_H__
11 11 #define __EATTR_DOT_H__
12 12  
  13 +struct gfs2_inode;
  14 +struct iattr;
  15 +
13 16 #define GFS2_EA_REC_LEN(ea) be32_to_cpu((ea)->ea_rec_len)
14 17 #define GFS2_EA_DATA_LEN(ea) be32_to_cpu((ea)->ea_data_len)
15 18  
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __GLOCK_DOT_H__
11 11 #define __GLOCK_DOT_H__
12 12  
  13 +#include "incore.h"
  14 +
13 15 /* Flags for lock requests; used in gfs2_holder gh_flag field.
14 16 From lm_interface.h:
15 17 #define LM_FLAG_TRY 0x00000001
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __GLOPS_DOT_H__
11 11 #define __GLOPS_DOT_H__
12 12  
  13 +#include "incore.h"
  14 +
13 15 extern const struct gfs2_glock_operations gfs2_meta_glops;
14 16 extern const struct gfs2_glock_operations gfs2_inode_glops;
15 17 extern const struct gfs2_glock_operations gfs2_rgrp_glops;
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __INCORE_DOT_H__
11 11 #define __INCORE_DOT_H__
12 12  
  13 +#include <linux/fs.h>
  14 +
13 15 #define DIO_FORCE 0x00000001
14 16 #define DIO_CLEAN 0x00000002
15 17 #define DIO_DIRTY 0x00000004
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __LM_DOT_H__
11 11 #define __LM_DOT_H__
12 12  
  13 +struct gfs2_sbd;
  14 +
13 15 #define GFS2_MIN_LVB_SIZE 32
14 16  
15 17 int gfs2_lm_mount(struct gfs2_sbd *sdp, int silent);
... ... @@ -10,6 +10,10 @@
10 10 #ifndef __LOG_DOT_H__
11 11 #define __LOG_DOT_H__
12 12  
  13 +#include <linux/list.h>
  14 +#include <linux/spinlock.h>
  15 +#include "incore.h"
  16 +
13 17 /**
14 18 * gfs2_log_lock - acquire the right to mess with the log manager
15 19 * @sdp: the filesystem
... ... @@ -10,6 +10,9 @@
10 10 #ifndef __LOPS_DOT_H__
11 11 #define __LOPS_DOT_H__
12 12  
  13 +#include <linux/list.h>
  14 +#include "incore.h"
  15 +
13 16 extern const struct gfs2_log_operations gfs2_glock_lops;
14 17 extern const struct gfs2_log_operations gfs2_buf_lops;
15 18 extern const struct gfs2_log_operations gfs2_revoke_lops;
... ... @@ -10,6 +10,10 @@
10 10 #ifndef __DIO_DOT_H__
11 11 #define __DIO_DOT_H__
12 12  
  13 +#include <linux/buffer_head.h>
  14 +#include <linux/string.h>
  15 +#include "incore.h"
  16 +
13 17 static inline void gfs2_buffer_clear(struct buffer_head *bh)
14 18 {
15 19 memset(bh->b_data, 0, bh->b_size);
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __MOUNT_DOT_H__
11 11 #define __MOUNT_DOT_H__
12 12  
  13 +struct gfs2_sbd;
  14 +
13 15 int gfs2_mount_args(struct gfs2_sbd *sdp, char *data_arg, int remount);
14 16  
15 17 #endif /* __MOUNT_DOT_H__ */
fs/gfs2/ops_address.h
... ... @@ -10,6 +10,10 @@
10 10 #ifndef __OPS_ADDRESS_DOT_H__
11 11 #define __OPS_ADDRESS_DOT_H__
12 12  
  13 +#include <linux/fs.h>
  14 +#include <linux/buffer_head.h>
  15 +#include <linux/mm.h>
  16 +
13 17 extern const struct address_space_operations gfs2_file_aops;
14 18 extern int gfs2_get_block(struct inode *inode, sector_t lblock,
15 19 struct buffer_head *bh_result, int create);
fs/gfs2/ops_dentry.h
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __OPS_DENTRY_DOT_H__
11 11 #define __OPS_DENTRY_DOT_H__
12 12  
  13 +#include <linux/dcache.h>
  14 +
13 15 extern struct dentry_operations gfs2_dops;
14 16  
15 17 #endif /* __OPS_DENTRY_DOT_H__ */
... ... @@ -9,6 +9,10 @@
9 9  
10 10 #ifndef __OPS_FILE_DOT_H__
11 11 #define __OPS_FILE_DOT_H__
  12 +
  13 +#include <linux/fs.h>
  14 +struct gfs2_inode;
  15 +
12 16 extern struct file gfs2_internal_file_sentinel;
13 17 extern int gfs2_internal_read(struct gfs2_inode *ip,
14 18 struct file_ra_state *ra_state,
fs/gfs2/ops_fstype.h
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __OPS_FSTYPE_DOT_H__
11 11 #define __OPS_FSTYPE_DOT_H__
12 12  
  13 +#include <linux/fs.h>
  14 +
13 15 extern struct file_system_type gfs2_fs_type;
14 16 extern struct file_system_type gfs2meta_fs_type;
15 17  
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __OPS_INODE_DOT_H__
11 11 #define __OPS_INODE_DOT_H__
12 12  
  13 +#include <linux/fs.h>
  14 +
13 15 extern struct inode_operations gfs2_file_iops;
14 16 extern struct inode_operations gfs2_dir_iops;
15 17 extern struct inode_operations gfs2_symlink_iops;
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __OPS_SUPER_DOT_H__
11 11 #define __OPS_SUPER_DOT_H__
12 12  
  13 +#include <linux/fs.h>
  14 +
13 15 extern struct super_operations gfs2_super_ops;
14 16  
15 17 #endif /* __OPS_SUPER_DOT_H__ */
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __OPS_VM_DOT_H__
11 11 #define __OPS_VM_DOT_H__
12 12  
  13 +#include <linux/mm.h>
  14 +
13 15 extern struct vm_operations_struct gfs2_vm_ops_private;
14 16 extern struct vm_operations_struct gfs2_vm_ops_sharewrite;
15 17  
... ... @@ -10,6 +10,9 @@
10 10 #ifndef __QUOTA_DOT_H__
11 11 #define __QUOTA_DOT_H__
12 12  
  13 +struct gfs2_inode;
  14 +struct gfs2_sbd;
  15 +
13 16 #define NO_QUOTA_CHANGE ((u32)-1)
14 17  
15 18 int gfs2_quota_hold(struct gfs2_inode *ip, u32 uid, u32 gid);
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __RECOVERY_DOT_H__
11 11 #define __RECOVERY_DOT_H__
12 12  
  13 +#include "incore.h"
  14 +
13 15 static inline void gfs2_replay_incr_blk(struct gfs2_sbd *sdp, unsigned int *blk)
14 16 {
15 17 if (++*blk == sdp->sd_jdesc->jd_blocks)
... ... @@ -10,6 +10,10 @@
10 10 #ifndef __RGRP_DOT_H__
11 11 #define __RGRP_DOT_H__
12 12  
  13 +struct gfs2_rgrpd;
  14 +struct gfs2_sbd;
  15 +struct gfs2_holder;
  16 +
13 17 void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd);
14 18  
15 19 struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk);
... ... @@ -10,6 +10,8 @@
10 10 #ifndef __SUPER_DOT_H__
11 11 #define __SUPER_DOT_H__
12 12  
  13 +#include "incore.h"
  14 +
13 15 void gfs2_tune_init(struct gfs2_tune *gt);
14 16  
15 17 int gfs2_check_sb(struct gfs2_sbd *sdp, struct gfs2_sb *sb, int silent);
... ... @@ -10,6 +10,9 @@
10 10 #ifndef __SYS_DOT_H__
11 11 #define __SYS_DOT_H__
12 12  
  13 +#include <linux/spinlock.h>
  14 +struct gfs2_sbd;
  15 +
13 16 /* Allow args to be passed to GFS2 when using an initial ram disk */
14 17 extern char *gfs2_sys_margs;
15 18 extern spinlock_t gfs2_sys_margs_lock;
... ... @@ -10,6 +10,11 @@
10 10 #ifndef __TRANS_DOT_H__
11 11 #define __TRANS_DOT_H__
12 12  
  13 +#include <linux/buffer_head.h>
  14 +struct gfs2_sbd;
  15 +struct gfs2_rgrpd;
  16 +struct gfs2_glock;
  17 +
13 18 #define RES_DINODE 1
14 19 #define RES_INDIRECT 1
15 20 #define RES_JDATA 1
... ... @@ -20,8 +25,8 @@
20 25 #define RES_STATFS 1
21 26 #define RES_QUOTA 2
22 27  
23   -int gfs2_trans_begin(struct gfs2_sbd *sdp,
24   - unsigned int blocks, unsigned int revokes);
  28 +int gfs2_trans_begin(struct gfs2_sbd *sdp, unsigned int blocks,
  29 + unsigned int revokes);
25 30  
26 31 void gfs2_trans_end(struct gfs2_sbd *sdp);
27 32  
... ... @@ -10,6 +10,7 @@
10 10 #ifndef __UTIL_DOT_H__
11 11 #define __UTIL_DOT_H__
12 12  
  13 +#include "incore.h"
13 14  
14 15 #define fs_printk(level, fs, fmt, arg...) \
15 16 printk(level "GFS2: fsid=%s: " fmt , (fs)->sd_fsname , ## arg)