/* nilfs_dat_new - create dat file @nilfs: nilfs object @entry_size: size of a dat entry  */
struct inode* nilfs_dat_new(struct the_nilfs *nilfs, size_t entry_size)
/* nilfs_dat_new - create dat file @nilfs: nilfs object @entry_size: size of a dat entry  */
struct inode* nilfs_dat_new(struct the_nilfs *nilfs, size_t entry_size)
{
	static struct lock_class_key dat_lock_key;
	struct inode *dat;
	struct nilfs_dat_info *di;
	int err;
	dat = nilfs_mdt_new(nilfs, NULL, NILFS_DAT_INO, sizeof(*di));
	if (dat) {
		err = nilfs_palloc_init_blockgroup(dat, entry_size);
		if (unlikely(err)) {
			nilfs_mdt_destroy(dat);
			return NULL;
		}
		di = NILFS_DAT_I(dat);
		lockdep_set_class(&di->mi.mi_sem, &dat_lock_key);
		nilfs_palloc_setup_cache(dat, &di->palloc_cache);
	}
	return dat;
}