Index: linux-2.6.10/fs/ext3/namei.c =================================================================== --- linux-2.6.10.orig/fs/ext3/namei.c 2005-05-31 22:20:10.000000000 +0800 +++ linux-2.6.10/fs/ext3/namei.c 2005-05-31 22:20:10.000000000 +0800 @@ -1178,6 +1178,36 @@ return iopen_connect_dentry(dentry, inode, 1); } +static int ext3_lookup_raw(struct inode *dir, const char *name, + int len, ino_t *data) +{ + struct ext3_dir_entry_2 *de; + struct buffer_head *bh; + struct dentry parent; + struct dentry dentry; + void *lock = NULL; + + if (len > EXT3_NAME_LEN) + return -ENAMETOOLONG; + + parent.d_inode = dir; + dentry.d_parent = &parent; + dentry.d_name.name = name; + dentry.d_name.len = len; + + bh = ext3_find_entry(&dentry, &de, 0, &lock); + if (bh) { + unsigned long ino = le32_to_cpu(de->inode); + ext3_unlock_htree(dir, lock); + brelse (bh); + if (data) + *data = ino; + return 0; /* found name */ + } + + return -ENOENT; +} + struct dentry *ext3_get_parent(struct dentry *child) { @@ -2854,6 +2884,7 @@ struct inode_operations ext3_dir_inode_operations = { .create = ext3_create, .lookup = ext3_lookup, + .lookup_raw = ext3_lookup_raw, .link = ext3_link, .unlink = ext3_unlink, .symlink = ext3_symlink,