aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/proc_ns.h
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2017-12-27 18:39:08 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2017-12-31 16:12:23 +0100
commitcdab6ba8668d68f031bfd5d237b4586ec4f8cd88 (patch)
tree8e996972f0cfbccd3334d7e12490c5d5cbdb2d24 /include/linux/proc_ns.h
parentbpf: offload: free program id when device disappears (diff)
downloadlinux-dev-cdab6ba8668d68f031bfd5d237b4586ec4f8cd88.tar.xz
linux-dev-cdab6ba8668d68f031bfd5d237b4586ec4f8cd88.zip
nsfs: generalize ns_get_path() for path resolution with a task
ns_get_path() takes struct task_struct and proc_ns_ops as its parameters. For path resolution directly from a namespace, e.g. based on a networking device's net name space, we need more flexibility. Add a ns_get_path_cb() helper which will allow callers to use any method of obtaining the name space reference. Convert ns_get_path() to use ns_get_path_cb(). Following patches will bring a networking user. CC: Eric W. Biederman <ebiederm@xmission.com> Suggested-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/proc_ns.h')
-rw-r--r--include/linux/proc_ns.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/proc_ns.h b/include/linux/proc_ns.h
index 2ff18c9840a7..d31cb6215905 100644
--- a/include/linux/proc_ns.h
+++ b/include/linux/proc_ns.h
@@ -78,6 +78,9 @@ extern struct file *proc_ns_fget(int fd);
#define get_proc_ns(inode) ((struct ns_common *)(inode)->i_private)
extern void *ns_get_path(struct path *path, struct task_struct *task,
const struct proc_ns_operations *ns_ops);
+typedef struct ns_common *ns_get_path_helper_t(void *);
+extern void *ns_get_path_cb(struct path *path, ns_get_path_helper_t ns_get_cb,
+ void *private_data);
extern int ns_get_name(char *buf, size_t size, struct task_struct *task,
const struct proc_ns_operations *ns_ops);