[BACK]Return to xfs_ialloc.h CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / fs / xfs

File: [Development] / linux-2.6-xfs / fs / xfs / xfs_ialloc.h (download)

Revision 1.11, Mon Dec 27 22:24:13 1993 UTC (23 years, 9 months ago) by doucette
Branch: MAIN
Changes since 1.10: +3 -2 lines

Split allocation group header into two buffers; make superblock one
buffer long instead of one block long.

#ifndef _FS_XFS_IALLOC_H
#define	_FS_XFS_IALLOC_H

#ident	"$Revision$"

#define	XFS_IALLOC_MAX_EVER_BLOCKS	16
#define	XFS_IALLOC_MAX_EVER_INODES	256
#define	XFS_IALLOC_MAX_EVER(s,a)	xfs_extlen_min(XFS_IALLOC_MAX_EVER_BLOCKS, XFS_IALLOC_MAX_EVER_INODES >> (s)->sb_inopblog)
#define	XFS_IALLOC_MIN_ALLOC(s,a)	1
#define XFS_IALLOC_MAX_ALLOC(s,a)	\
	(((a)->agi_count >> (s)->sb_inopblog) >= XFS_IALLOC_MAX_EVER(s,a) ? \
		XFS_IALLOC_MAX_EVER(s,a) : \
		((a)->agi_count ? ((a)->agi_count >> (s)->sb_inopblog) : 1))

/*
 * Structures for inode mapping
 */

/*
 * Real block structures have a size equal to the file system block size.
 */

#define	XFS_IALLOC_BLOCK_SIZE(lev,cur)	(1 << (cur)->bc_blocklog)

#define	XFS_IALLOC_BLOCK_MAXRECS(lev,cur)	\
	XFS_BTREE_BLOCK_MAXRECS(XFS_IALLOC_BLOCK_SIZE(lev,cur), \
				xfs_ialloc_rec_t, lev)
#define	XFS_IALLOC_BLOCK_MINRECS(lev,cur)	\
	XFS_BTREE_BLOCK_MINRECS(XFS_IALLOC_BLOCK_SIZE(lev,cur), \
				xfs_ialloc_rec_t, lev)

#define	XFS_IALLOC_REC_ADDR(bb,i,cur)	\
	XFS_BTREE_REC_ADDR(XFS_IALLOC_BLOCK_SIZE((bb)->bb_level,cur), \
			   xfs_ialloc_rec_t, bb, i)

#define	XFS_IALLOC_PTR_ADDR(bb,i,cur)	\
	XFS_BTREE_PTR_ADDR(XFS_IALLOC_BLOCK_SIZE((bb)->bb_level,cur), \
			   xfs_ialloc_rec_t, bb, i)

#define	XFS_IALLOC_MAXLEVELS	5 /* ??? */

#define	xfs_make_iptr(s,b,o) \
	((xfs_dinode_t *)((caddr_t)xfs_buf_to_block(b) + ((o) << (s)->sb_inodelog)))

/*
 * Prototypes for per-fs routines.
 */
xfs_ino_t xfs_dialloc(xfs_trans_t *, xfs_ino_t, int, mode_t);
xfs_agino_t xfs_dialloc_next_free(xfs_mount_t *, xfs_trans_t *, buf_t *, xfs_agino_t);
xfs_agino_t xfs_difree(xfs_trans_t *, xfs_ino_t);
int xfs_dilocate(xfs_mount_t *, xfs_trans_t *, xfs_ino_t, xfs_fsblock_t *, int *);

#endif	/* !_FS_XFS_IALLOC_H */
void xfs_btree_log_agi(xfs_trans_t *, buf_t *, int);