linux/fs/nsfs.c

// SPDX-License-Identifier: GPL-2.0
#include <linux/mount.h>
#include <linux/pseudo_fs.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/proc_fs.h>
#include <linux/proc_ns.h>
#include <linux/magic.h>
#include <linux/ktime.h>
#include <linux/seq_file.h>
#include <linux/pid_namespace.h>
#include <linux/user_namespace.h>
#include <linux/nsfs.h>
#include <linux/uaccess.h>

#include "mount.h"
#include "internal.h"

static struct vfsmount *nsfs_mnt;

static long ns_ioctl(struct file *filp, unsigned int ioctl,
			unsigned long arg);
static const struct file_operations ns_file_operations =;

static char *ns_dname(struct dentry *dentry, char *buffer, int buflen)
{}

const struct dentry_operations ns_dentry_operations =;

static void nsfs_evict(struct inode *inode)
{}

int ns_get_path_cb(struct path *path, ns_get_path_helper_t *ns_get_cb,
		     void *private_data)
{}

struct ns_get_path_task_args {};

static struct ns_common *ns_get_path_task(void *private_data)
{}

int ns_get_path(struct path *path, struct task_struct *task,
		  const struct proc_ns_operations *ns_ops)
{}

/**
 * open_namespace - open a namespace
 * @ns: the namespace to open
 *
 * This will consume a reference to @ns indendent of success or failure.
 *
 * Return: A file descriptor on success or a negative error code on failure.
 */
int open_namespace(struct ns_common *ns)
{}

int open_related_ns(struct ns_common *ns,
		   struct ns_common *(*get_ns)(struct ns_common *ns))
{}
EXPORT_SYMBOL_GPL();

static long ns_ioctl(struct file *filp, unsigned int ioctl,
			unsigned long arg)
{}

int ns_get_name(char *buf, size_t size, struct task_struct *task,
			const struct proc_ns_operations *ns_ops)
{}

bool proc_ns_file(const struct file *file)
{}

/**
 * ns_match() - Returns true if current namespace matches dev/ino provided.
 * @ns: current namespace
 * @dev: dev_t from nsfs that will be matched against current nsfs
 * @ino: ino_t from nsfs that will be matched against current nsfs
 *
 * Return: true if dev and ino matches the current nsfs.
 */
bool ns_match(const struct ns_common *ns, dev_t dev, ino_t ino)
{}


static int nsfs_show_path(struct seq_file *seq, struct dentry *dentry)
{}

static const struct super_operations nsfs_ops =;

static int nsfs_init_inode(struct inode *inode, void *data)
{}

static void nsfs_put_data(void *data)
{}

static const struct stashed_operations nsfs_stashed_ops =;

static int nsfs_init_fs_context(struct fs_context *fc)
{}

static struct file_system_type nsfs =;

void __init nsfs_init(void)
{}