/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* bos720 src/bos/usr/include/jfs/fsdefs.h 1.9                            */
/*                                                                        */
/* Licensed Materials - Property of IBM                                   */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 1988,1999              */
/* All Rights Reserved                                                    */
/*                                                                        */
/* US Government Users Restricted Rights - Use, duplication or            */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.      */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
/* @(#)41     1.9  src/bos/usr/include/jfs/fsdefs.h, syspfs, bos720 4/14/99 16:03:41 */
/*
 * COMPONENT_NAME: (SYSPFS) Physical File System 
 *
 * FUNCTIONS: fsdefs.h
 *
 * ORIGINS: 27
 *
 * (C) COPYRIGHT International Business Machines Corp. 1988, 1996
 * All Rights Reserved
 * Licensed Materials - Property of IBM
 *
 * US Government Users Restricted Rights - Use, duplication or
 * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 */

#ifndef _H_JFS_FSDEFS
#define _H_JFS_FSDEFS

#include <sys/types.h>
#include <sys/machine.h>	/* for BYTE_ORDER */

/* Scratch segment registers addresses
 */
#define  SR12ADDR  0xC0000000
#define  SR13ADDR  0xD0000000

/* True if name is "." or ".."
 */
#define	ISDOTS(name)	((name)[0] == '.' && (((name)[1] == '\0') || \
			((name)[1] == '.' && (name)[2] == '\0')))

struct jfsinfo
{
	unsigned short	agsize;
	unsigned short	iagsize;
	struct 
	{
                unsigned _spare         : 20;
		unsigned _fperpage	:  4;	/* frags per page	    */
		unsigned _bigexp	:  4;	/* log2 big file multiplier */
		unsigned _comptype	:  4;	/* compression algorithm    */
	} _jfsvars;
        vmidx_t         logsidx;
};

#define jv_fperpage     _jfsvars._fperpage
#define jv_bigexp       _jfsvars._bigexp
#define jv_comptype	_jfsvars._comptype


/* disk address format.
 */
typedef struct
{
#if BYTE_ORDER == BIG_ENDIAN
	unsigned nbit	:1;	/* newbit (non-committed allocation)	    */
	unsigned nfrags	:3;	/* number of fragments less than full block */
	unsigned addr	:28;	/* fragment number of the first fragment    */
#else
	unsigned addr   :28;    /* fragment number of the first fragment    */
	unsigned nfrags :3;     /* number of fragments less than full block */
	unsigned nbit   :1;     /* newbit (non-committed allocation)        */
#endif /* BYTE_ORDER */
} frag_t;


/*
 * fundamental variables
 * don't change too often
 */

#ifdef PAGESIZE
#undef PAGESIZE
#endif
#define	PAGESIZE	4096		/* page size */

#ifdef SEGSIZE
#undef SEGSIZE
#endif
#define SEGSIZE		(1<<28)		/* segment size */

#define NDADDR		8		/* Direct blocks in inode */
#define NFADDR		8		/* Direct blocks in fifo */
#define DILENGTH	128		/* Disk inode length */
#define LOGMINOR	8		/* reserved minor number for log */

#define L_BCHUNK	32		/* # blocks allocated together  */
#define MIN_AIX3SIZE	L_BCHUNK    	/* minimum aix3 filesystem size */

#endif /* _H_JFS_FSDEFS */
