summaryrefslogtreecommitdiffstats
path: root/include/linux/namei.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 15:20:36 -0700
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/namei.h
downloadlinux-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.tar.gz
linux-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.tar.bz2
linux-1da177e4c3f41524e886b7f1b8a0c1fc7321cac2.zip
Linux-2.6.12-rc2v2.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!
Diffstat (limited to 'include/linux/namei.h')
-rw-r--r--include/linux/namei.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/include/linux/namei.h b/include/linux/namei.h
new file mode 100644
index 000000000000..7db67b008cac
--- /dev/null
+++ b/include/linux/namei.h
@@ -0,0 +1,87 @@
+#ifndef _LINUX_NAMEI_H
+#define _LINUX_NAMEI_H
+
+#include <linux/linkage.h>
+
+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 */