#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/uio.h>
#include <linux/notifier.h>
#include <linux/wait.h>
#include <linux/fs.h>
#include <linux/poll.h>
#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/mount.h>
#include <linux/pagemap.h>
#include <linux/uaccess.h>
#include <linux/init.h>
#include <linux/namei.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/miscdevice.h>
#include <linux/workqueue.h>
#include <xen/xenbus.h>
#include <xen/xen.h>
#include <asm/xen/hypervisor.h>
#include "xenbus.h"
unsigned int xb_dev_generation_id;
struct xenbus_transaction_holder { … };
struct read_buffer { … };
struct xenbus_file_priv { … };
static ssize_t xenbus_file_read(struct file *filp,
char __user *ubuf,
size_t len, loff_t *ppos)
{ … }
static int queue_reply(struct list_head *queue, const void *data, size_t len)
{ … }
static void queue_cleanup(struct list_head *list)
{ … }
struct watch_adapter { … };
static void free_watch_adapter(struct watch_adapter *watch)
{ … }
static struct watch_adapter *alloc_watch_adapter(const char *path,
const char *token)
{ … }
static void watch_fired(struct xenbus_watch *watch,
const char *path,
const char *token)
{ … }
static void xenbus_worker(struct work_struct *wq)
{ … }
static void xenbus_file_free(struct kref *kref)
{ … }
static struct xenbus_transaction_holder *xenbus_get_transaction(
struct xenbus_file_priv *u, uint32_t tx_id)
{ … }
void xenbus_dev_queue_reply(struct xb_req_data *req)
{ … }
static int xenbus_command_reply(struct xenbus_file_priv *u,
unsigned int msg_type, const char *reply)
{ … }
static int xenbus_write_transaction(unsigned msg_type,
struct xenbus_file_priv *u)
{ … }
static int xenbus_write_watch(unsigned msg_type, struct xenbus_file_priv *u)
{ … }
static ssize_t xenbus_file_write(struct file *filp,
const char __user *ubuf,
size_t len, loff_t *ppos)
{ … }
static int xenbus_file_open(struct inode *inode, struct file *filp)
{ … }
static int xenbus_file_release(struct inode *inode, struct file *filp)
{ … }
static __poll_t xenbus_file_poll(struct file *file, poll_table *wait)
{ … }
const struct file_operations xen_xenbus_fops = …;
EXPORT_SYMBOL_GPL(…);
static struct miscdevice xenbus_dev = …;
static int __init xenbus_init(void)
{ … }
device_initcall(xenbus_init);