From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 16 Apr 2005 15:20:36 -0700 Subject: Linux-2.6.12-rc2 Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip! --- include/linux/namei.h | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 include/linux/namei.h (limited to 'include/linux/namei.h') diff --git a/include/linux/namei.h b/include/linux/namei.h new file mode 100644 index 0000000..7db67b0 --- /dev/null +++ b/include/linux/namei.h @@ -0,0 +1,87 @@ +#ifndef _LINUX_NAMEI_H +#define _LINUX_NAMEI_H + +#include + +struct vfsmount; + +struct open_intent { + int flags; + int create_mode; +}; + +enum { MAX_NESTED_LINKS = 5 }; + +struct nameidata { + struct dentry *dentry; + struct vfsmount *mnt; + struct qstr last; + unsigned int flags; + int last_type; + unsigned depth; + char *saved_names[MAX_NESTED_LINKS + 1]; + + /* Intent data */ + union { + struct open_intent open; + } intent; +}; + +/* + * Type of the last component on LOOKUP_PARENT + */ +enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; + +/* + * The bitmask for a lookup event: + * - follow links at the end + * - require a directory + * - ending slashes ok even for nonexistent files + * - internal "there are more path compnents" flag + * - locked when lookup done with dcache_lock held + * - dentry cache is untrusted; force a real lookup + */ +#define LOOKUP_FOLLOW 1 +#define LOOKUP_DIRECTORY 2 +#define LOOKUP_CONTINUE 4 +#define LOOKUP_PARENT 16 +#define LOOKUP_NOALT 32 +#define LOOKUP_REVAL 64 +/* + * Intent data + */ +#define LOOKUP_OPEN (0x0100) +#define LOOKUP_CREATE (0x0200) +#define LOOKUP_ACCESS (0x0400) + +extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); +#define user_path_walk(name,nd) \ + __user_walk(name, LOOKUP_FOLLOW, nd) +#define user_path_walk_link(name,nd) \ + __user_walk(name, 0, nd) +extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *)); +extern int FASTCALL(path_walk(const char *, struct nameidata *)); +extern int FASTCALL(link_path_walk(const char *, struct nameidata *)); +extern void path_release(struct nameidata *); +extern void path_release_on_umount(struct nameidata *); + +extern struct dentry * lookup_one_len(const char *, struct dentry *, int); +extern struct dentry * lookup_hash(struct qstr *, struct dentry *); + +extern int follow_down(struct vfsmount **, struct dentry **); +extern int follow_up(struct vfsmount **, struct dentry **); + +extern struct dentry *lock_rename(struct dentry *, struct dentry *); +extern void unlock_rename(struct dentry *, struct dentry *); + +static inline void nd_set_link(struct nameidata *nd, char *path) +{ + nd->saved_names[nd->depth] = path; +} + +static inline char *nd_get_link(struct nameidata *nd) +{ + return nd->saved_names[nd->depth]; +} + +#endif /* _LINUX_NAMEI_H */ -- cgit v1.1