return error;
}
-/* from namei.c */
-static struct dentry *lookup_create(struct nameidata *nd, int is_dir)
-{
- struct dentry *dentry;
-
- down(&nd->dentry->d_inode->i_sem);
- dentry = ERR_PTR(-EEXIST);
- if (nd->last_type != LAST_NORM)
- goto fail;
- dentry = lookup_hash(&nd->last, nd->dentry);
- if (IS_ERR(dentry))
- goto fail;
- if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
- goto enoent;
- return dentry;
-enoent:
- dput(dentry);
- dentry = ERR_PTR(-ENOENT);
-fail:
- return dentry;
-}
-
int lento_create(const char *name, int mode, struct lento_vfs_context *info)
{
int error;
goto do_last;
}
-/* SMP-safe */
-static struct dentry *lookup_create(struct nameidata *nd, int is_dir)
+/**
+ * lookup_create - lookup a dentry, creating it if it doesn't exist
+ * @nd: nameidata info
+ * @is_dir: directory flag
+ *
+ * Simple function to lookup and return a dentry and create it
+ * if it doesn't exist. Is SMP-safe.
+ */
+struct dentry *lookup_create(struct nameidata *nd, int is_dir)
{
struct dentry *dentry;
}
extern struct vfsmount *lookup_mnt(struct vfsmount *, struct dentry *);
+extern struct dentry *lookup_create(struct nameidata *nd, int is_dir);
+
#endif /* __KERNEL__ */
#endif /* __LINUX_DCACHE_H */
EXPORT_SYMBOL(follow_up);
EXPORT_SYMBOL(follow_down);
EXPORT_SYMBOL(lookup_mnt);
+EXPORT_SYMBOL(lookup_create);
EXPORT_SYMBOL(path_lookup);
EXPORT_SYMBOL(path_walk);
EXPORT_SYMBOL(path_release);