blob: 93402c42070f1b16e9c3ce95a69f158e20d752d3 [file] [log] [blame]
Thomas Gleixner1a59d1b82019-05-27 08:55:05 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
3 * Copyright (C) International Business Machines Corp., 2000-2003
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 */
5#ifndef _H_JFS_SUPERBLOCK
6#define _H_JFS_SUPERBLOCK
7
Andy Shevchenko2e3bc612019-01-10 15:41:53 +02008#include <linux/uuid.h>
9
Linus Torvalds1da177e2005-04-16 15:20:36 -070010/*
11 * make the magic number something a human could read
12 */
Dave Kleikamp63f83c92006-10-02 09:55:27 -050013#define JFS_MAGIC "JFS1" /* Magic word */
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
15#define JFS_VERSION 2 /* Version number: Version 2 */
16
17#define LV_NAME_SIZE 11 /* MUST BE 11 for OS/2 boot sector */
18
Dave Kleikamp63f83c92006-10-02 09:55:27 -050019/*
20 * aggregate superblock
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 *
22 * The name superblock is too close to super_block, so the name has been
23 * changed to jfs_superblock. The utilities are still using the old name.
24 */
25struct jfs_superblock {
26 char s_magic[4]; /* 4: magic number */
27 __le32 s_version; /* 4: version number */
28
29 __le64 s_size; /* 8: aggregate size in hardware/LVM blocks;
30 * VFS: number of blocks
31 */
Dave Kleikamp63f83c92006-10-02 09:55:27 -050032 __le32 s_bsize; /* 4: aggregate block size in bytes;
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 * VFS: fragment size
34 */
35 __le16 s_l2bsize; /* 2: log2 of s_bsize */
36 __le16 s_l2bfactor; /* 2: log2(s_bsize/hardware block size) */
37 __le32 s_pbsize; /* 4: hardware/LVM block size in bytes */
38 __le16 s_l2pbsize; /* 2: log2 of s_pbsize */
39 __le16 pad; /* 2: padding necessary for alignment */
40
41 __le32 s_agsize; /* 4: allocation group size in aggr. blocks */
42
43 __le32 s_flag; /* 4: aggregate attributes:
44 * see jfs_filsys.h
45 */
Dave Kleikamp63f83c92006-10-02 09:55:27 -050046 __le32 s_state; /* 4: mount/unmount/recovery state:
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 * see jfs_filsys.h
48 */
49 __le32 s_compress; /* 4: > 0 if data compression */
50
51 pxd_t s_ait2; /* 8: first extent of secondary
52 * aggregate inode table
53 */
54
55 pxd_t s_aim2; /* 8: first extent of secondary
56 * aggregate inode map
57 */
58 __le32 s_logdev; /* 4: device address of log */
59 __le32 s_logserial; /* 4: log serial number at aggregate mount */
60 pxd_t s_logpxd; /* 8: inline log extent */
61
62 pxd_t s_fsckpxd; /* 8: inline fsck work space extent */
63
64 struct timestruc_t s_time; /* 8: time last updated */
65
66 __le32 s_fsckloglen; /* 4: Number of filesystem blocks reserved for
Dave Kleikamp63f83c92006-10-02 09:55:27 -050067 * the fsck service log.
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 * N.B. These blocks are divided among the
69 * versions kept. This is not a per
70 * version size.
Dave Kleikamp63f83c92006-10-02 09:55:27 -050071 * N.B. These blocks are included in the
Linus Torvalds1da177e2005-04-16 15:20:36 -070072 * length field of s_fsckpxd.
73 */
74 s8 s_fscklog; /* 1: which fsck service log is most recent
75 * 0 => no service log data yet
76 * 1 => the first one
77 * 2 => the 2nd one
78 */
Dave Kleikamp63f83c92006-10-02 09:55:27 -050079 char s_fpack[11]; /* 11: file system volume name
Linus Torvalds1da177e2005-04-16 15:20:36 -070080 * N.B. This must be 11 bytes to
81 * conform with the OS/2 BootSector
82 * requirements
83 * Only used when s_version is 1
84 */
85
86 /* extendfs() parameter under s_state & FM_EXTENDFS */
87 __le64 s_xsize; /* 8: extendfs s_size */
88 pxd_t s_xfsckpxd; /* 8: extendfs fsckpxd */
89 pxd_t s_xlogpxd; /* 8: extendfs logpxd */
Andy Shevchenko2e3bc612019-01-10 15:41:53 +020090 uuid_t s_uuid; /* 16: 128-bit uuid for volume */
Linus Torvalds1da177e2005-04-16 15:20:36 -070091 char s_label[16]; /* 16: volume label */
Andy Shevchenko2e3bc612019-01-10 15:41:53 +020092 uuid_t s_loguuid; /* 16: 128-bit uuid for log device */
Linus Torvalds1da177e2005-04-16 15:20:36 -070093
94};
95
96extern int readSuper(struct super_block *, struct buffer_head **);
97extern int updateSuper(struct super_block *, uint);
Joe Percheseb8630d2013-06-04 16:39:15 -070098__printf(2, 3)
Linus Torvalds1da177e2005-04-16 15:20:36 -070099extern void jfs_error(struct super_block *, const char *, ...);
Dave Kleikamp1868f4a2005-05-04 15:29:35 -0500100extern int jfs_mount(struct super_block *);
101extern int jfs_mount_rw(struct super_block *, int);
102extern int jfs_umount(struct super_block *);
103extern int jfs_umount_rw(struct super_block *);
Dave Kleikamp1868f4a2005-05-04 15:29:35 -0500104extern int jfs_extendfs(struct super_block *, s64, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105
Christoph Hellwig91dbb4d2006-02-15 12:49:04 -0600106extern struct task_struct *jfsIOthread;
107extern struct task_struct *jfsSyncThread;
108
Linus Torvalds1da177e2005-04-16 15:20:36 -0700109#endif /*_H_JFS_SUPERBLOCK */