/*
 *  linux/fs/xip2/ialloc.c, Version 1
 *
 * (C) Copyright IBM Corp. 2002,2004
 * Author(s): Carsten Otte <cotte@de.ibm.com>
 * derived from second extended filesystem (ext2)
 */

#include <linux/config.h>
#include <linux/fs.h>
#include <linux/xip2_fs.h>
#include <linux/locks.h>
#include <linux/quotaops.h>


/*
 * ialloc.c contains the inodes allocation and deallocation routines
 */

/*
 * The free inodes are managed by bitmaps.  A file system contains several
 * blocks groups.  Each group contains 1 bitmap block for blocks, 1 bitmap
 * block for inodes, N blocks for the inode table and data blocks.
 *
 * The file system contains group descriptors which are located after the
 * super block.  Each descriptor contains the number of the bitmap block and
 * the free blocks count in the block.  The descriptors are loaded in memory
 * when a file system is mounted (see xip2_read_super).
 */

unsigned long xip2_count_free_inodes (struct super_block * sb)
{
	return le32_to_cpu(sb->u.xip2_sb.s_es->s_free_inodes_count);
}
