aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
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)
487} 487}
488EXPORT_SYMBOL(path_put); 488EXPORT_SYMBOL(path_put);
489 489
490struct nameidata {
491 struct path path;
492 struct qstr last;
493 struct path root;
494 struct inode *inode; /* path.dentry.d_inode */
495 unsigned int flags;
496 unsigned seq, m_seq;
497 int last_type;
498 unsigned depth;
499 char *saved_names[MAX_NESTED_LINKS + 1];
500};
501
490/* 502/*
491 * Path walking has 2 modes, rcu-walk and ref-walk (see 503 * Path walking has 2 modes, rcu-walk and ref-walk (see
492 * Documentation/filesystems/path-lookup.txt). In situations when we can't 504 * 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)
695 nd->flags |= LOOKUP_JUMPED; 707 nd->flags |= LOOKUP_JUMPED;
696} 708}
697 709
710void nd_set_link(struct nameidata *nd, char *path)
711{
712 nd->saved_names[nd->depth] = path;
713}
714EXPORT_SYMBOL(nd_set_link);
715
716char *nd_get_link(struct nameidata *nd)
717{
718 return nd->saved_names[nd->depth];
719}
720EXPORT_SYMBOL(nd_get_link);
721
698static inline void put_link(struct nameidata *nd, struct path *link, void *cookie) 722static inline void put_link(struct nameidata *nd, struct path *link, void *cookie)
699{ 723{
700 struct inode *inode = link->dentry->d_inode; 724 struct inode *inode = link->dentry->d_inode;