jfs.h revision 1b8adde7ba7d5e04395c141c5400dc2cffd7d809
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2000 International Business Machines Corp.
* Copyright (C) 2001 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _JFS_H_
#define _JFS_H_
/* those are from jfs_filsys.h */
/*
* file system option (superblock flag)
*/
/* platform option (conditional compilation) */
/* directory option */
/* bba */
/*
* buffer cache configuration
*/
/* page size */
#ifdef PSIZE
#endif
/*
* fs fundamental size
*
* PSIZE >= file system block size >= PBSIZE >= DISIZE
*/
#define L2DISIZE 9
#define L2INOSPERIAG 12
#define L2INOSPEREXT 5
/* Minimum number of bytes supported for a JFS partition */
#define MINJFS (0x1000000)
/*
* fixed byte offset address
*/
/*
* fixed reserved inode number
*/
/* aggregate inode */
* fileset inode map inode
*/
/* per fileset inode */
/*
* directory configuration
*/
#define JFS_NAME_MAX 255
#define JFS_PATH_MAX PSIZE
typedef unsigned char u8;
typedef char s8;
typedef unsigned short u16;
typedef short s16;
typedef unsigned int u32;
typedef int s32;
typedef unsigned long long u64;
typedef long long s64;
/* these from jfs_btree.h */
/* btpaget_t flag */
/* those are from jfs_types.h */
struct timestruc_t {
};
/*
* physical xd (pxd)
*/
typedef struct {
unsigned len:24;
unsigned addr1:8;
} pxd_t;
/* xd_t field extraction */
/*
* data extent descriptor (dxd)
*/
typedef struct {
} dxd_t; /* - 16 - */
/*
* DASD limit information - stored in directory inode
*/
typedef struct dasd {
} dasd_t;
/* from jfs_superblock.h */
struct jfs_superblock
{
* VFS: number of blocks
*/
* VFS: fragment size
*/
* see jfs_filsys.h
*/
* see jfs_filsys.h
*/
* aggregate inode table
*/
* aggregate inode map
*/
* the fsck service log.
* N.B. These blocks are divided among the
* versions kept. This is not a per
* version size.
* N.B. These blocks are included in the
* length field of s_fsckpxd.
*/
* 0 => no service log data yet
* 1 => the first one
* 2 => the 2nd one
*/
* N.B. This must be 11 bytes to
* conform with the OS/2 BootSector
* requirements
*/
/* extendfs() parameter under s_state & FM_EXTENDFS */
/* - 128 byte boundary - */
/*
* DFS VFS support (preliminary)
*/
char s_attach; /* 1: VFS: flag: set when aggregate is attached
*/
* available to "normal" (non-root) users.
*/
* exclusive use of root. This value can be 0,
* and if it is then totalUsable will be equal
* to # of blocks in aggregate. I believe this
* means that minFree + totalUsable = # blocks.
* In that case, we don't need to store both
* totalUsable and minFree since we can compute
* one from the other. I would guess minFree
* would be the one we should store, and
* totalUsable would be the one we should
* compute. (Just a guess...)
*/
* "normal" users. It may be this is something
* we should compute when asked for instead of
* storing in the superblock. I don't know how
* often this information is needed.
*/
/*
* graffiti area
*/
};
/* from jfs_dtree.h */
/*
*
*/
/*
* directory page slot
*/
typedef struct {
} dtslot_t; /* (32) */
#define DTSLOTDATALEN 15
/*
*/
typedef struct {
} idtentry_t; /* (32) */
/*
*
* For legacy filesystems, name contains 13 unichars -- no index field
*/
typedef struct {
} ldtentry_t; /* (32) */
#define DTLHDRDATALEN 11
/*
* dir_table used for directory traversal during readdir
*/
/*
* Maximum entry in inline directory table
*/
typedef struct dir_table_slot {
index of next entry when this entry was deleted */
} dir_table_slot_t; /* (8) */
/*
* directory root page (in-line in on-disk inode):
*
* cf. dtpage_t below.
*/
typedef union {
struct {
} header; /* (32) */
} dtroot_t;
/*
* directory regular page:
*
* entry slot array of 32 byte slot
*
* sorted entry slot index table (stbl):
* contiguous slots at slot specified by stblindex,
* 1-byte per entry
* 512 byte block: 16 entry tbl (1 slot)
* 1024 byte block: 32 entry tbl (1 slot)
* 2048 byte block: 64 entry tbl (2 slot)
* 4096 byte block: 128 entry tbl (4 slot)
*
* data area:
* 512 byte block: 16 - 2 = 14 slot
* 1024 byte block: 32 - 2 = 30 slot
* 2048 byte block: 64 - 3 = 61 slot
* 4096 byte block: 128 - 5 = 123 slot
*
* N.B. index is 0-based; index fields refer to slot index
* except nextindex which refers to entry index in stbl;
* end of entry stot list or freelist is marked with -1.
*/
typedef union {
struct {
} header; /* (32) */
} dtpage_t;
/* from jfs_xtree.h */
/*
* extent allocation descriptor (xad)
*/
typedef struct xad {
} xad_t; /* (16) */
/* xad_t field extraction */
/* possible values for maxentry */
#define XTPAGEMAXSLOT 256
#define XTENTRYSTART 2
/*
* xtree page:
*/
typedef union {
struct xtheader {
} header; /* (32) */
} xtpage_t;
/* from jfs_dinode.h */
struct dinode {
/*
* I. base area (128 bytes)
* ------------------------
*
*/
/*
* Extension Areas.
*
* Historically, the inode was partitioned into 4 128-byte areas,
* the last 3 being defined as unions which could have multiple
* uses. The first 96 bytes had been completely unused until
* an index table was added to the directory. It is now more
* useful to describe the last 3/4 of the inode as a single
* union. We would probably be better off redesigning the
* entire structure from scratch, but we don't want to break
* commonality with OS/2's JFS at this time.
*/
union {
struct {
/*
* This table contains the information needed to
* find a directory entry from a 32-bit index.
* If the index is small enough, the table is inline,
* otherwise, an x-tree root overlays this table
*/
} _dir; /* (384) */
struct {
union {
struct {
void *_imap; /* 4: unused */
} _imap;
} _u1; /* 96: */
union {
struct {
union {
} _u;
} _special;
} _u2;
} _file;
} u;
};
/* di_mode */
/* extended mode bits (on-disk inode di_mode) */
/* from jfs_imap.h */
/*
* inode allocation map:
*
* inode allocation map consists of
* . the inode map control page and
* . inode allocation group pages (per 4096 inodes)
* which are addressed by standard JFS xtree.
*/
/*
* inode allocation group page (per 4096 inodes of an AG)
*/
typedef struct {
/* summary map: 1 bit per inode extent */
* note: this indicates free and backed
* inodes, if the extent is not backed the
* value will be 1. if the extent is
* backed but all inodes are being used the
* value will be 1. if the extent is
* backed but at least one of the inodes is
* free the value will be 0.
*/
/* (72) */
/* allocation bit map: 1 bit per inode (0 - free, 1 - allocated) */
} iag_t; /* (4096) */
#endif /* _JFS_H_ */