#include #include #include #include #include #include "xenfs.h" #include "../xenbus/xenbus_comms.h" static ssize_t xsd_read(struct file *file, char __user *buf, size_t size, loff_t *off) { const char *str = (const char *)file->private_data; return simple_read_from_buffer(buf, size, off, str, strlen(str)); } static int xsd_release(struct inode *inode, struct file *file) { kfree(file->private_data); return 0; } static int xsd_kva_open(struct inode *inode, struct file *file) { file->private_data = (void *)kasprintf(GFP_KERNEL, "0x%p", xen_store_interface); if (!file->private_data) return -ENOMEM; return 0; } static int xsd_kva_mmap(struct file *file, struct vm_area_struct *vma) { size_t size = vma->vm_end - vma->vm_start; if ((size > PAGE_SIZE) || (vma->vm_pgoff != 0)) return -EINVAL; if (remap_pfn_range(vma, vma->vm_start, virt_to_pfn(xen_store_interface), size, vma->vm_page_prot)) return -EAGAIN; return 0; } const struct file_operations xsd_kva_file_ops = { .open = xsd_kva_open, .mmap = xsd_kva_mmap, .read = xsd_read, .release = xsd_release, }; static int xsd_port_open(struct inode *inode, struct file *file) { file->private_data = (void *)kasprintf(GFP_KERNEL, "%d", xen_store_evtchn); if (!file->private_data) return -ENOMEM; return 0; } const struct file_operations xsd_port_file_ops = { .open = xsd_port_open, .read = xsd_read, .release = xsd_release, }; >
summaryrefslogtreecommitdiff
ce:
AgeCommit message (Expand)AuthorFilesLines
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-16 09:34:37 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-16 09:34:37 -0800
commit2eabb8b8d68bc9c7779ba8b04bec8d4f8baed0bc (patch)
tree4d8ea8e6ca52f1938269937834641205d8d888f0 /include/net/tc_act/tc_skbedit.h
parent49def1853334396f948dcb4cedb9347abb318df5 (diff)
parentce1ca7d2d140a1f4aaffd297ac487f246963dd2f (diff)
Merge tag 'nfsd-4.10-1' of git://linux-nfs.org/~bfields/linux
Pull nfsd fixes from Bruce Fields: "Miscellaneous nfsd bugfixes, one for a 4.10 regression, three for older bugs" * tag 'nfsd-4.10-1' of git://linux-nfs.org/~bfields/linux: svcrdma: avoid duplicate dma unmapping during error recovery sunrpc: don't call sleeping functions from the notifier block callbacks svcrpc: don't leak contexts on PROC_DESTROY nfsd: fix supported attributes for acl & labels
Diffstat (limited to 'include/net/tc_act/tc_skbedit.h')