aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/incore.h
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2007-06-01 09:11:58 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2007-07-09 03:23:10 -0400
commitbb8d8a6f54c1c84d7c74623491bab043b36a38c5 (patch)
tree76c62c505df2a1acd090f4aacc63fb9eddd3950f /fs/gfs2/incore.h
parentddf4b426aababdae4cb96326d7aeb9d119f42c50 (diff)
[GFS2] Fix sign problem in quota/statfs and cleanup _host structures
This patch fixes some sign issues which were accidentally introduced into the quota & statfs code during the endianess annotation process. Also included is a general clean up which moves all of the _host structures out of gfs2_ondisk.h (where they should not have been to start with) and into the places where they are actually used (often only one place). Also those _host structures which are not required any more are removed entirely (which is the eventual plan for all of them). The conversion routines from ondisk.c are also moved into the places where they are actually used, which for almost every one, was just one single place, so all those are now static functions. This also cleans up the end of gfs2_ondisk.h which no longer needs the #ifdef __KERNEL__. The net result is a reduction of about 100 lines of code, many functions now marked static plus the bug fixes as mentioned above. For good measure I ran the code through sparse after making these changes to check that there are no warnings generated. This fixes Red Hat bz #239686 Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/incore.h')
-rw-r--r--fs/gfs2/incore.h63
1 files changed, 62 insertions, 1 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h
index b2079fcd2513..e5069b912d5e 100644
--- a/fs/gfs2/incore.h
+++ b/fs/gfs2/incore.h
@@ -28,6 +28,14 @@ struct gfs2_sbd;
28 28
29typedef void (*gfs2_glop_bh_t) (struct gfs2_glock *gl, unsigned int ret); 29typedef void (*gfs2_glop_bh_t) (struct gfs2_glock *gl, unsigned int ret);
30 30
31struct gfs2_log_header_host {
32 u64 lh_sequence; /* Sequence number of this transaction */
33 u32 lh_flags; /* GFS2_LOG_HEAD_... */
34 u32 lh_tail; /* Block number of log tail */
35 u32 lh_blkno;
36 u32 lh_hash;
37};
38
31/* 39/*
32 * Structure of operations that are associated with each 40 * Structure of operations that are associated with each
33 * type of element in the log. 41 * type of element in the log.
@@ -60,12 +68,23 @@ struct gfs2_bitmap {
60 u32 bi_len; 68 u32 bi_len;
61}; 69};
62 70
71struct gfs2_rgrp_host {
72 u32 rg_flags;
73 u32 rg_free;
74 u32 rg_dinodes;
75 u64 rg_igeneration;
76};
77
63struct gfs2_rgrpd { 78struct gfs2_rgrpd {
64 struct list_head rd_list; /* Link with superblock */ 79 struct list_head rd_list; /* Link with superblock */
65 struct list_head rd_list_mru; 80 struct list_head rd_list_mru;
66 struct list_head rd_recent; /* Recently used rgrps */ 81 struct list_head rd_recent; /* Recently used rgrps */
67 struct gfs2_glock *rd_gl; /* Glock for this rgrp */ 82 struct gfs2_glock *rd_gl; /* Glock for this rgrp */
68 struct gfs2_rindex_host rd_ri; 83 u64 rd_addr; /* grp block disk address */
84 u64 rd_data0; /* first data location */
85 u32 rd_length; /* length of rgrp header in fs blocks */
86 u32 rd_data; /* num of data blocks in rgrp */
87 u32 rd_bitbytes; /* number of bytes in data bitmaps */
69 struct gfs2_rgrp_host rd_rg; 88 struct gfs2_rgrp_host rd_rg;
70 u64 rd_rg_vn; 89 u64 rd_rg_vn;
71 struct gfs2_bitmap *rd_bits; 90 struct gfs2_bitmap *rd_bits;
@@ -211,6 +230,20 @@ enum {
211 GIF_SW_PAGED = 3, 230 GIF_SW_PAGED = 3,
212}; 231};
213 232
233struct gfs2_dinode_host {
234 u64 di_size; /* number of bytes in file */
235 u64 di_blocks; /* number of blocks in file */
236 u64 di_goal_meta; /* rgrp to alloc from next */
237 u64 di_goal_data; /* data block goal */
238 u64 di_generation; /* generation number for NFS */
239 u32 di_flags; /* GFS2_DIF_... */
240 u16 di_height; /* height of metadata */
241 /* These only apply to directories */
242 u16 di_depth; /* Number of bits in the table */
243 u32 di_entries; /* The number of entries in the directory */
244 u64 di_eattr; /* extended attribute block number */
245};
246
214struct gfs2_inode { 247struct gfs2_inode {
215 struct inode i_inode; 248 struct inode i_inode;
216 u64 i_no_addr; 249 u64 i_no_addr;
@@ -346,6 +379,12 @@ struct gfs2_jdesc {
346 unsigned int jd_blocks; 379 unsigned int jd_blocks;
347}; 380};
348 381
382struct gfs2_statfs_change_host {
383 s64 sc_total;
384 s64 sc_free;
385 s64 sc_dinodes;
386};
387
349#define GFS2_GLOCKD_DEFAULT 1 388#define GFS2_GLOCKD_DEFAULT 1
350#define GFS2_GLOCKD_MAX 16 389#define GFS2_GLOCKD_MAX 16
351 390
@@ -418,6 +457,28 @@ enum {
418 457
419#define GFS2_FSNAME_LEN 256 458#define GFS2_FSNAME_LEN 256
420 459
460struct gfs2_inum_host {
461 u64 no_formal_ino;
462 u64 no_addr;
463};
464
465struct gfs2_sb_host {
466 u32 sb_magic;
467 u32 sb_type;
468 u32 sb_format;
469
470 u32 sb_fs_format;
471 u32 sb_multihost_format;
472 u32 sb_bsize;
473 u32 sb_bsize_shift;
474
475 struct gfs2_inum_host sb_master_dir;
476 struct gfs2_inum_host sb_root_dir;
477
478 char sb_lockproto[GFS2_LOCKNAME_LEN];
479 char sb_locktable[GFS2_LOCKNAME_LEN];
480};
481
421struct gfs2_sbd { 482struct gfs2_sbd {
422 struct super_block *sd_vfs; 483 struct super_block *sd_vfs;
423 struct super_block *sd_vfs_meta; 484 struct super_block *sd_vfs_meta;