blob: 04847b8d3070f7bd81708a3c43057119c082c434 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Copyright (C) International Business Machines Corp., 2000-2003
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
Dave Kleikamp63f83c92006-10-02 09:55:27 -05006 * the Free Software Foundation; either version 2 of the License, or
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 * (at your option) any later version.
Dave Kleikamp63f83c92006-10-02 09:55:27 -05008 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
12 * the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
Dave Kleikamp63f83c92006-10-02 09:55:27 -050015 * along with this program; if not, write to the Free Software
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18#ifndef _H_JFS_SUPERBLOCK
19#define _H_JFS_SUPERBLOCK
20
21/*
22 * make the magic number something a human could read
23 */
Dave Kleikamp63f83c92006-10-02 09:55:27 -050024#define JFS_MAGIC "JFS1" /* Magic word */
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
26#define JFS_VERSION 2 /* Version number: Version 2 */
27
28#define LV_NAME_SIZE 11 /* MUST BE 11 for OS/2 boot sector */
29
Dave Kleikamp63f83c92006-10-02 09:55:27 -050030/*
31 * aggregate superblock
Linus Torvalds1da177e2005-04-16 15:20:36 -070032 *
33 * The name superblock is too close to super_block, so the name has been
34 * changed to jfs_superblock. The utilities are still using the old name.
35 */
36struct jfs_superblock {
37 char s_magic[4]; /* 4: magic number */
38 __le32 s_version; /* 4: version number */
39
40 __le64 s_size; /* 8: aggregate size in hardware/LVM blocks;
41 * VFS: number of blocks
42 */
Dave Kleikamp63f83c92006-10-02 09:55:27 -050043 __le32 s_bsize; /* 4: aggregate block size in bytes;
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 * VFS: fragment size
45 */
46 __le16 s_l2bsize; /* 2: log2 of s_bsize */
47 __le16 s_l2bfactor; /* 2: log2(s_bsize/hardware block size) */
48 __le32 s_pbsize; /* 4: hardware/LVM block size in bytes */
49 __le16 s_l2pbsize; /* 2: log2 of s_pbsize */
50 __le16 pad; /* 2: padding necessary for alignment */
51
52 __le32 s_agsize; /* 4: allocation group size in aggr. blocks */
53
54 __le32 s_flag; /* 4: aggregate attributes:
55 * see jfs_filsys.h
56 */
Dave Kleikamp63f83c92006-10-02 09:55:27 -050057 __le32 s_state; /* 4: mount/unmount/recovery state:
Linus Torvalds1da177e2005-04-16 15:20:36 -070058 * see jfs_filsys.h
59 */
60 __le32 s_compress; /* 4: > 0 if data compression */
61
62 pxd_t s_ait2; /* 8: first extent of secondary
63 * aggregate inode table
64 */
65
66 pxd_t s_aim2; /* 8: first extent of secondary
67 * aggregate inode map
68 */
69 __le32 s_logdev; /* 4: device address of log */
70 __le32 s_logserial; /* 4: log serial number at aggregate mount */
71 pxd_t s_logpxd; /* 8: inline log extent */
72
73 pxd_t s_fsckpxd; /* 8: inline fsck work space extent */
74
75 struct timestruc_t s_time; /* 8: time last updated */
76
77 __le32 s_fsckloglen; /* 4: Number of filesystem blocks reserved for
Dave Kleikamp63f83c92006-10-02 09:55:27 -050078 * the fsck service log.
Linus Torvalds1da177e2005-04-16 15:20:36 -070079 * N.B. These blocks are divided among the
80 * versions kept. This is not a per
81 * version size.
Dave Kleikamp63f83c92006-10-02 09:55:27 -050082 * N.B. These blocks are included in the
Linus Torvalds1da177e2005-04-16 15:20:36 -070083 * length field of s_fsckpxd.
84 */
85 s8 s_fscklog; /* 1: which fsck service log is most recent
86 * 0 => no service log data yet
87 * 1 => the first one
88 * 2 => the 2nd one
89 */
Dave Kleikamp63f83c92006-10-02 09:55:27 -050090 char s_fpack[11]; /* 11: file system volume name
Linus Torvalds1da177e2005-04-16 15:20:36 -070091 * N.B. This must be 11 bytes to
92 * conform with the OS/2 BootSector
93 * requirements
94 * Only used when s_version is 1
95 */
96
97 /* extendfs() parameter under s_state & FM_EXTENDFS */
98 __le64 s_xsize; /* 8: extendfs s_size */
99 pxd_t s_xfsckpxd; /* 8: extendfs fsckpxd */
100 pxd_t s_xlogpxd; /* 8: extendfs logpxd */
101 /* - 128 byte boundary - */
102
103 char s_uuid[16]; /* 16: 128-bit uuid for volume */
104 char s_label[16]; /* 16: volume label */
105 char s_loguuid[16]; /* 16: 128-bit uuid for log device */
106
107};
108
109extern int readSuper(struct super_block *, struct buffer_head **);
110extern int updateSuper(struct super_block *, uint);
Joe Percheseb8630d2013-06-04 16:39:15 -0700111__printf(2, 3)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112extern void jfs_error(struct super_block *, const char *, ...);
Dave Kleikamp1868f4a2005-05-04 15:29:35 -0500113extern int jfs_mount(struct super_block *);
114extern int jfs_mount_rw(struct super_block *, int);
115extern int jfs_umount(struct super_block *);
116extern int jfs_umount_rw(struct super_block *);
Dave Kleikamp1868f4a2005-05-04 15:29:35 -0500117extern int jfs_extendfs(struct super_block *, s64, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118
Christoph Hellwig91dbb4d2006-02-15 12:49:04 -0600119extern struct task_struct *jfsIOthread;
120extern struct task_struct *jfsSyncThread;
121
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122#endif /*_H_JFS_SUPERBLOCK */