aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/gfs2_ondisk.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/gfs2_ondisk.h')
-rw-r--r--include/linux/gfs2_ondisk.h142
1 files changed, 10 insertions, 132 deletions
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index 8b7e4c1e32ae..a44a6a078f0a 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -54,18 +54,6 @@ struct gfs2_inum {
54 __be64 no_addr; 54 __be64 no_addr;
55}; 55};
56 56
57struct gfs2_inum_host {
58 __u64 no_formal_ino;
59 __u64 no_addr;
60};
61
62static inline int gfs2_inum_equal(const struct gfs2_inum_host *ino1,
63 const struct gfs2_inum_host *ino2)
64{
65 return ino1->no_formal_ino == ino2->no_formal_ino &&
66 ino1->no_addr == ino2->no_addr;
67}
68
69/* 57/*
70 * Generic metadata head structure 58 * Generic metadata head structure
71 * Every inplace buffer logged in the journal must start with this. 59 * Every inplace buffer logged in the journal must start with this.
@@ -94,12 +82,6 @@ struct gfs2_meta_header {
94 __be32 __pad1; /* Was incarnation number in gfs1 */ 82 __be32 __pad1; /* Was incarnation number in gfs1 */
95}; 83};
96 84
97struct gfs2_meta_header_host {
98 __u32 mh_magic;
99 __u32 mh_type;
100 __u32 mh_format;
101};
102
103/* 85/*
104 * super-block structure 86 * super-block structure
105 * 87 *
@@ -139,23 +121,6 @@ struct gfs2_sb {
139 /* In gfs1, quota and license dinodes followed */ 121 /* In gfs1, quota and license dinodes followed */
140}; 122};
141 123
142struct gfs2_sb_host {
143 struct gfs2_meta_header_host sb_header;
144
145 __u32 sb_fs_format;
146 __u32 sb_multihost_format;
147
148 __u32 sb_bsize;
149 __u32 sb_bsize_shift;
150
151 struct gfs2_inum_host sb_master_dir; /* Was jindex dinode in gfs1 */
152 struct gfs2_inum_host sb_root_dir;
153
154 char sb_lockproto[GFS2_LOCKNAME_LEN];
155 char sb_locktable[GFS2_LOCKNAME_LEN];
156 /* In gfs1, quota and license dinodes followed */
157};
158
159/* 124/*
160 * resource index structure 125 * resource index structure
161 */ 126 */
@@ -173,14 +138,6 @@ struct gfs2_rindex {
173 __u8 ri_reserved[64]; 138 __u8 ri_reserved[64];
174}; 139};
175 140
176struct gfs2_rindex_host {
177 __u64 ri_addr; /* grp block disk address */
178 __u64 ri_data0; /* first data location */
179 __u32 ri_length; /* length of rgrp header in fs blocks */
180 __u32 ri_data; /* num of data blocks in rgrp */
181 __u32 ri_bitbytes; /* number of bytes in data bitmaps */
182};
183
184/* 141/*
185 * resource group header structure 142 * resource group header structure
186 */ 143 */
@@ -212,13 +169,6 @@ struct gfs2_rgrp {
212 __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */ 169 __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */
213}; 170};
214 171
215struct gfs2_rgrp_host {
216 __u32 rg_flags;
217 __u32 rg_free;
218 __u32 rg_dinodes;
219 __u64 rg_igeneration;
220};
221
222/* 172/*
223 * quota structure 173 * quota structure
224 */ 174 */
@@ -230,12 +180,6 @@ struct gfs2_quota {
230 __u8 qu_reserved[64]; 180 __u8 qu_reserved[64];
231}; 181};
232 182
233struct gfs2_quota_host {
234 __u64 qu_limit;
235 __u64 qu_warn;
236 __u64 qu_value;
237};
238
239/* 183/*
240 * dinode structure 184 * dinode structure
241 */ 185 */
@@ -315,29 +259,11 @@ struct gfs2_dinode {
315 struct gfs2_inum __pad4; /* Unused even in current gfs1 */ 259 struct gfs2_inum __pad4; /* Unused even in current gfs1 */
316 260
317 __be64 di_eattr; /* extended attribute block number */ 261 __be64 di_eattr; /* extended attribute block number */
262 __be32 di_atime_nsec; /* nsec portion of atime */
263 __be32 di_mtime_nsec; /* nsec portion of mtime */
264 __be32 di_ctime_nsec; /* nsec portion of ctime */
318 265
319 __u8 di_reserved[56]; 266 __u8 di_reserved[44];
320};
321
322struct gfs2_dinode_host {
323 __u64 di_size; /* number of bytes in file */
324 __u64 di_blocks; /* number of blocks in file */
325
326 /* This section varies from gfs1. Padding added to align with
327 * remainder of dinode
328 */
329 __u64 di_goal_meta; /* rgrp to alloc from next */
330 __u64 di_goal_data; /* data block goal */
331 __u64 di_generation; /* generation number for NFS */
332
333 __u32 di_flags; /* GFS2_DIF_... */
334 __u16 di_height; /* height of metadata */
335
336 /* These only apply to directories */
337 __u16 di_depth; /* Number of bits in the table */
338 __u32 di_entries; /* The number of entries in the directory */
339
340 __u64 di_eattr; /* extended attribute block number */
341}; 267};
342 268
343/* 269/*
@@ -414,16 +340,6 @@ struct gfs2_log_header {
414 __be32 lh_hash; 340 __be32 lh_hash;
415}; 341};
416 342
417struct gfs2_log_header_host {
418 struct gfs2_meta_header_host lh_header;
419
420 __u64 lh_sequence; /* Sequence number of this transaction */
421 __u32 lh_flags; /* GFS2_LOG_HEAD_... */
422 __u32 lh_tail; /* Block number of log tail */
423 __u32 lh_blkno;
424 __u32 lh_hash;
425};
426
427/* 343/*
428 * Log type descriptor 344 * Log type descriptor
429 */ 345 */
@@ -464,11 +380,6 @@ struct gfs2_inum_range {
464 __be64 ir_length; 380 __be64 ir_length;
465}; 381};
466 382
467struct gfs2_inum_range_host {
468 __u64 ir_start;
469 __u64 ir_length;
470};
471
472/* 383/*
473 * Statfs change 384 * Statfs change
474 * Describes an change to the pool of free and allocated 385 * Describes an change to the pool of free and allocated
@@ -481,12 +392,6 @@ struct gfs2_statfs_change {
481 __be64 sc_dinodes; 392 __be64 sc_dinodes;
482}; 393};
483 394
484struct gfs2_statfs_change_host {
485 __u64 sc_total;
486 __u64 sc_free;
487 __u64 sc_dinodes;
488};
489
490/* 395/*
491 * Quota change 396 * Quota change
492 * Describes an allocation change for a particular 397 * Describes an allocation change for a particular
@@ -501,39 +406,12 @@ struct gfs2_quota_change {
501 __be32 qc_id; 406 __be32 qc_id;
502}; 407};
503 408
504struct gfs2_quota_change_host { 409struct gfs2_quota_lvb {
505 __u64 qc_change; 410 __be32 qb_magic;
506 __u32 qc_flags; /* GFS2_QCF_... */ 411 __u32 __pad;
507 __u32 qc_id; 412 __be64 qb_limit; /* Hard limit of # blocks to alloc */
413 __be64 qb_warn; /* Warn user when alloc is above this # */
414 __be64 qb_value; /* Current # blocks allocated */
508}; 415};
509 416
510#ifdef __KERNEL__
511/* Translation functions */
512
513extern void gfs2_inum_in(struct gfs2_inum_host *no, const void *buf);
514extern void gfs2_inum_out(const struct gfs2_inum_host *no, void *buf);
515extern void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf);
516extern void gfs2_rindex_in(struct gfs2_rindex_host *ri, const void *buf);
517extern void gfs2_rindex_out(const struct gfs2_rindex_host *ri, void *buf);
518extern void gfs2_rgrp_in(struct gfs2_rgrp_host *rg, const void *buf);
519extern void gfs2_rgrp_out(const struct gfs2_rgrp_host *rg, void *buf);
520extern void gfs2_quota_in(struct gfs2_quota_host *qu, const void *buf);
521struct gfs2_inode;
522extern void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf);
523extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, const void *buf);
524extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf);
525extern void gfs2_log_header_in(struct gfs2_log_header_host *lh, const void *buf);
526extern void gfs2_inum_range_in(struct gfs2_inum_range_host *ir, const void *buf);
527extern void gfs2_inum_range_out(const struct gfs2_inum_range_host *ir, void *buf);
528extern void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf);
529extern void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc, void *buf);
530extern void gfs2_quota_change_in(struct gfs2_quota_change_host *qc, const void *buf);
531
532/* Printing functions */
533
534extern void gfs2_rindex_print(const struct gfs2_rindex_host *ri);
535extern void gfs2_dinode_print(const struct gfs2_inode *ip);
536
537#endif /* __KERNEL__ */
538
539#endif /* __GFS2_ONDISK_DOT_H__ */ 417#endif /* __GFS2_ONDISK_DOT_H__ */