cregit-Linux how code gets into the kernel

Release 4.7 drivers/xen/xenfs/super.c

/*
 *  xenfs.c - a filesystem for passing info between the a domain and
 *  the hypervisor.
 *
 * 2008-10-07  Alex Zeffertt    Replaced /proc/xen/xenbus with xenfs filesystem
 *                              and /proc/xen compatibility mount point.
 *                              Turned xenfs into a loadable module.
 */


#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/magic.h>

#include <xen/xen.h>

#include "xenfs.h"
#include "../privcmd.h"
#include "../xenbus/xenbus_comms.h"

#include <asm/xen/hypervisor.h>

MODULE_DESCRIPTION("Xen filesystem");
MODULE_LICENSE("GPL");


static ssize_t capabilities_read(struct file *file, char __user *buf, size_t size, loff_t *off) { char *tmp = ""; if (xen_initial_domain()) tmp = "control_d\n"; return simple_read_from_buffer(buf, size, off, tmp, strlen(tmp)); }

Contributors

PersonTokensPropCommitsCommitProp
jeremy fitzhardingejeremy fitzhardinge55100.00%1100.00%
Total55100.00%1100.00%

static const struct file_operations capabilities_file_ops = { .read = capabilities_read, .llseek = default_llseek, };
static int xenfs_fill_super(struct super_block *sb, void *data, int silent) { static struct tree_descr xenfs_files[] = { [2] = { "xenbus", &xen_xenbus_fops, S_IRUSR|S_IWUSR }, { "capabilities", &capabilities_file_ops, S_IRUGO }, { "privcmd", &xen_privcmd_fops, S_IRUSR|S_IWUSR }, {""}, }; static struct tree_descr xenfs_init_files[] = { [2] = { "xenbus", &xen_xenbus_fops, S_IRUSR|S_IWUSR }, { "capabilities", &capabilities_file_ops, S_IRUGO }, { "privcmd", &xen_privcmd_fops, S_IRUSR|S_IWUSR }, { "xsd_kva", &xsd_kva_file_ops, S_IRUSR|S_IWUSR}, { "xsd_port", &xsd_port_file_ops, S_IRUSR|S_IWUSR}, #ifdef CONFIG_XEN_SYMS { "xensyms", &xensyms_ops, S_IRUSR}, #endif {""}, }; return simple_fill_super(sb, XENFS_SUPER_MAGIC, xen_initial_domain() ? xenfs_init_files : xenfs_files); }

Contributors

PersonTokensPropCommitsCommitProp
al viroal viro6841.72%112.50%
alex zefferttalex zeffertt4426.99%112.50%
jeremy fitzhardingejeremy fitzhardinge1911.66%225.00%
ian campbellian campbell169.82%112.50%
boris ostrovskyboris ostrovsky148.59%112.50%
bastian blankbastian blank21.23%225.00%
Total163100.00%8100.00%


static struct dentry *xenfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { return mount_single(fs_type, flags, data, xenfs_fill_super); }

Contributors

PersonTokensPropCommitsCommitProp
alex zefferttalex zeffertt3286.49%133.33%
jeremy fitzhardingejeremy fitzhardinge38.11%133.33%
al viroal viro25.41%133.33%
Total37100.00%3100.00%

static struct file_system_type xenfs_type = { .owner = THIS_MODULE, .name = "xenfs", .mount = xenfs_mount, .kill_sb = kill_litter_super, }; MODULE_ALIAS_FS("xenfs");
static int __init xenfs_init(void) { if (xen_domain()) return register_filesystem(&xenfs_type); pr_info("not registering filesystem on non-xen platform\n"); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
alex zefferttalex zeffertt2275.86%120.00%
jeremy fitzhardingejeremy fitzhardinge517.24%360.00%
joe perchesjoe perches26.90%120.00%
Total29100.00%5100.00%


static void __exit xenfs_exit(void) { if (xen_domain()) unregister_filesystem(&xenfs_type); }

Contributors

PersonTokensPropCommitsCommitProp
alex zefferttalex zeffertt1995.00%150.00%
jeremy fitzhardingejeremy fitzhardinge15.00%150.00%
Total20100.00%2100.00%

module_init(xenfs_init); module_exit(xenfs_exit);

Overall Contributors

PersonTokensPropCommitsCommitProp
alex zefferttalex zeffertt18444.66%15.88%
jeremy fitzhardingejeremy fitzhardinge9924.03%741.18%
al viroal viro7217.48%211.76%
ian campbellian campbell163.88%15.88%
boris ostrovskyboris ostrovsky143.40%15.88%
joe perchesjoe perches92.18%15.88%
bastian blankbastian blank81.94%211.76%
eric w. biedermaneric w. biederman51.21%15.88%
arnd bergmannarnd bergmann51.21%15.88%
Total412100.00%17100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
{% endraw %}