summaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-11-02 02:30:41 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2014-12-11 05:32:13 +0300
commit1f55a6ec940fb45e3edaa52b6e9fc40cf8e18dcb (patch)
tree67cd7ee3eb2546116d1a322b4bbaf7b6f82a80f5 /fs/namei.c
parent707c5960f102f8cdafb9406047b158abc71b391f (diff)
downloadlinux-1f55a6ec940fb45e3edaa52b6e9fc40cf8e18dcb.tar.xz
make nameidata completely opaque outside of fs/namei.c
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c
index db5fe86319e6..398a73b522cb 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -487,6 +487,18 @@ void path_put(const struct path *path)
}
EXPORT_SYMBOL(path_put);
+struct nameidata {
+ struct path path;
+ struct qstr last;
+ struct path root;
+ struct inode *inode; /* path.dentry.d_inode */
+ unsigned int flags;
+ unsigned seq, m_seq;
+ int last_type;
+ unsigned depth;
+ char *saved_names[MAX_NESTED_LINKS + 1];
+};
+
/*
* Path walking has 2 modes, rcu-walk and ref-walk (see
* Documentation/filesystems/path-lookup.txt). In situations when we can't
@@ -695,6 +707,18 @@ void nd_jump_link(struct nameidata *nd, struct path *path)
nd->flags |= LOOKUP_JUMPED;
}
+void nd_set_link(struct nameidata *nd, char *path)
+{
+ nd->saved_names[nd->depth] = path;
+}
+EXPORT_SYMBOL(nd_set_link);
+
+char *nd_get_link(struct nameidata *nd)
+{
+ return nd->saved_names[nd->depth];
+}
+EXPORT_SYMBOL(nd_get_link);
+
static inline void put_link(struct nameidata *nd, struct path *link, void *cookie)
{
struct inode *inode = link->dentry->d_inode;