/*
 *  linux/fs/xip2/namei.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/fs.h>
#include <linux/xip2_fs.h>
#include <linux/pagemap.h>

/*
 * Methods themselves.
 */

static struct dentry *xip2_lookup(struct inode * dir, struct dentry *dentry)
{
	struct inode * inode;
	ino_t ino;
	
	if (dentry->d_name.len > EXT2_NAME_LEN)
		return ERR_PTR(-ENAMETOOLONG);

	ino = xip2_inode_by_name(dir, dentry);
	inode = NULL;
	if (ino) {
		inode = iget(dir->i_sb, ino);
		if (!inode) 
			return ERR_PTR(-EACCES);
	}
	d_add(dentry, inode);
	return NULL;
}

struct inode_operations xip2_dir_inode_operations = {
	lookup:		xip2_lookup,
};
