242
242
#define ocfslabellen(o) assemble2le(o.label_len)
243
243
#define OCFS_MAGIC "OracleCFS"
245
/* Common gfs/gfs2 constants: */
246
#define GFS_MAGIC 0x01161970
247
#define GFS_DEFAULT_BSIZE 4096
248
#define GFS_SUPERBLOCK_OFFSET (0x10 * GFS_DEFAULT_BSIZE)
249
#define GFS_LOCKNAME_LEN 64
251
/* gfs1 constants: */
252
#define GFS_FORMAT_FS 1309
253
#define GFS_FORMAT_MULTI 1401
254
/* gfs2 constants: */
255
#define GFS2_FORMAT_FS 1801
256
#define GFS2_FORMAT_MULTI 1900
258
struct gfs2_meta_header {
261
char __pad0[8]; /* Was generation number in gfs1 */
263
char __pad1[4]; /* Was incarnation number in gfs1 */
267
char no_formal_ino[8];
272
struct gfs2_meta_header sb_header;
274
char sb_fs_format[4];
275
char sb_multihost_format[4];
276
char __pad0[4]; /* Was superblock flags in gfs1 */
279
char sb_bsize_shift[4];
280
char __pad1[4]; /* Was journal segment size in gfs1 */
282
struct gfs2_inum sb_master_dir; /* Was jindex dinode in gfs1 */
283
struct gfs2_inum __pad2; /* Was rindex dinode in gfs1 */
284
struct gfs2_inum sb_root_dir;
286
char sb_lockproto[GFS_LOCKNAME_LEN];
287
char sb_locktable[GFS_LOCKNAME_LEN];
288
/* In gfs1, quota and license dinodes followed */
291
#define gfsmagic(s) assemble4be(s.sb_header.mh_magic)
292
#define gfsformat(s) assemble4be(s.sb_fs_format)
293
#define gfsmultiformat(s) assemble4be(s.sb_multihost_format)
295
/* btrfs constants */
296
#define BTRFS_SUPER_INFO_OFFSET (64 * 1024)
298
/* 32 bytes in various csum fields */
299
#define BTRFS_CSUM_SIZE 32
301
#define BTRFS_FSID_SIZE 16
303
#define BTRFS_MAGIC "_BHRfS_M"
306
* the super block basically lists the main trees of the FS
307
* it currently lacks any block count etc etc
309
struct btrfs_super_block {
310
char csum[BTRFS_CSUM_SIZE];
311
/* the first 3 fields must match struct btrfs_header */
312
char fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
313
char bytenr[8]; /* this block number */
316
/* allowed to be different from the btrfs_header from here own down */
318
/* more follows but this is all our libdisk cares about*/
319
} __attribute__ ((__packed__));
245
321
static inline int
246
322
assemble2le(char *p) {
247
323
return (p[0] | (p[1] << 8));