2 * Copyright (C) 1999 by Andries Brouwer
3 * Copyright (C) 1999, 2000, 2003 by Theodore Ts'o
4 * Copyright (C) 2001 by Andreas Dilger
5 * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
6 * Copyright (C) 2008 Karel Zak <kzak@redhat.com>
8 * This file may be redistributed under the terms of the
9 * GNU Lesser General Public License.
21 struct jfs_super_block {
22 unsigned char js_magic[4];
25 uint32_t js_bsize; /* 4: aggregate block size in bytes */
26 uint16_t js_l2bsize; /* 2: log2 of s_bsize */
27 uint16_t js_l2bfactor; /* 2: log2(s_bsize/hardware block size) */
28 uint32_t js_pbsize; /* 4: hardware/LVM block size in bytes */
29 uint16_t js_l2pbsize; /* 2: log2 of s_pbsize */
30 uint16_t js_pad; /* 2: padding necessary for alignment */
31 uint32_t js_dummy2[26];
32 unsigned char js_uuid[16];
33 unsigned char js_label[16];
34 unsigned char js_loguuid[16];
37 static int probe_jfs(blkid_probe pr, const struct blkid_idmag *mag)
39 struct jfs_super_block *js;
41 js = blkid_probe_get_sb(pr, mag, struct jfs_super_block);
44 if (le32_to_cpu(js->js_bsize) != (1 << le16_to_cpu(js->js_l2bsize)))
46 if (le32_to_cpu(js->js_pbsize) != (1 << le16_to_cpu(js->js_l2pbsize)))
48 if ((le16_to_cpu(js->js_l2bsize) - le16_to_cpu(js->js_l2pbsize)) !=
49 le16_to_cpu(js->js_l2bfactor))
52 if (strlen((char *) js->js_label))
53 blkid_probe_set_label(pr, js->js_label, sizeof(js->js_label));
54 blkid_probe_set_uuid(pr, js->js_uuid);
59 const struct blkid_idinfo jfs_idinfo =
62 .usage = BLKID_USAGE_FILESYSTEM,
63 .probefunc = probe_jfs,
66 { .magic = "JFS1", .len = 4, .kboff = 32 },