2 * Public API and common code for kernel->userspace relay file support.
4 * See Documentation/filesystems/relay.rst for an overview.
6 * Copyright (C) 2002-2005 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp
7 * Copyright (C) 1999-2005 - Karim Yaghmour (karim@opersys.com)
9 * Moved to kernel/relay.c by Paul Mundt, 2006.
10 * November 2006 - CPU hotplug support by Mathieu Desnoyers
11 * (mathieu.desnoyers@polymtl.ca)
13 * This file is released under the GPL.
15 #include <linux/errno.h>
16 #include <linux/stddef.h>
17 #include <linux/slab.h>
18 #include <linux/export.h>
19 #include <linux/string.h>
20 #include <linux/relay.h>
21 #include <linux/vmalloc.h>
23 #include <linux/cpu.h>
24 #include <linux/splice.h>
26 /* list of open channels, for cpu hotplug */
27 static DEFINE_MUTEX(relay_channels_mutex);
28 static LIST_HEAD(relay_channels);
31 * fault() vm_op implementation for relay file mapping.
33 static vm_fault_t relay_buf_fault(struct vm_fault *vmf)
36 struct rchan_buf *buf = vmf->vma->vm_private_data;
37 pgoff_t pgoff = vmf->pgoff;
42 page = vmalloc_to_page(buf->start + (pgoff << PAGE_SHIFT));
44 return VM_FAULT_SIGBUS;
52 * vm_ops for relay file mappings.
54 static const struct vm_operations_struct relay_file_mmap_ops = {
55 .fault = relay_buf_fault,
59 * allocate an array of pointers of struct page
61 static struct page **relay_alloc_page_array(unsigned int n_pages)
63 return kvcalloc(n_pages, sizeof(struct page *), GFP_KERNEL);
67 * free an array of pointers of struct page
69 static void relay_free_page_array(struct page **array)
75 * relay_mmap_buf: - mmap channel buffer to process address space
76 * @buf: relay channel buffer
77 * @vma: vm_area_struct describing memory to be mapped
79 * Returns 0 if ok, negative on error
81 * Caller should already have grabbed mmap_lock.
83 static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma)
85 unsigned long length = vma->vm_end - vma->vm_start;
90 if (length != (unsigned long)buf->chan->alloc_size)
93 vma->vm_ops = &relay_file_mmap_ops;
94 vm_flags_set(vma, VM_DONTEXPAND);
95 vma->vm_private_data = buf;
101 * relay_alloc_buf - allocate a channel buffer
102 * @buf: the buffer struct
103 * @size: total size of the buffer
105 * Returns a pointer to the resulting buffer, %NULL if unsuccessful. The
106 * passed in size will get page aligned, if it isn't already.
108 static void *relay_alloc_buf(struct rchan_buf *buf, size_t *size)
111 unsigned int i, j, n_pages;
113 *size = PAGE_ALIGN(*size);
114 n_pages = *size >> PAGE_SHIFT;
116 buf->page_array = relay_alloc_page_array(n_pages);
117 if (!buf->page_array)
120 for (i = 0; i < n_pages; i++) {
121 buf->page_array[i] = alloc_page(GFP_KERNEL);
122 if (unlikely(!buf->page_array[i]))
124 set_page_private(buf->page_array[i], (unsigned long)buf);
126 mem = vmap(buf->page_array, n_pages, VM_MAP, PAGE_KERNEL);
130 memset(mem, 0, *size);
131 buf->page_count = n_pages;
135 for (j = 0; j < i; j++)
136 __free_page(buf->page_array[j]);
137 relay_free_page_array(buf->page_array);
142 * relay_create_buf - allocate and initialize a channel buffer
143 * @chan: the relay channel
145 * Returns channel buffer if successful, %NULL otherwise.
147 static struct rchan_buf *relay_create_buf(struct rchan *chan)
149 struct rchan_buf *buf;
151 if (chan->n_subbufs > KMALLOC_MAX_SIZE / sizeof(size_t))
154 buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
157 buf->padding = kmalloc_array(chan->n_subbufs, sizeof(size_t),
162 buf->start = relay_alloc_buf(buf, &chan->alloc_size);
167 kref_get(&buf->chan->kref);
177 * relay_destroy_channel - free the channel struct
178 * @kref: target kernel reference that contains the relay channel
180 * Should only be called from kref_put().
182 static void relay_destroy_channel(struct kref *kref)
184 struct rchan *chan = container_of(kref, struct rchan, kref);
185 free_percpu(chan->buf);
190 * relay_destroy_buf - destroy an rchan_buf struct and associated buffer
191 * @buf: the buffer struct
193 static void relay_destroy_buf(struct rchan_buf *buf)
195 struct rchan *chan = buf->chan;
198 if (likely(buf->start)) {
200 for (i = 0; i < buf->page_count; i++)
201 __free_page(buf->page_array[i]);
202 relay_free_page_array(buf->page_array);
204 *per_cpu_ptr(chan->buf, buf->cpu) = NULL;
207 kref_put(&chan->kref, relay_destroy_channel);
211 * relay_remove_buf - remove a channel buffer
212 * @kref: target kernel reference that contains the relay buffer
214 * Removes the file from the filesystem, which also frees the
215 * rchan_buf_struct and the channel buffer. Should only be called from
218 static void relay_remove_buf(struct kref *kref)
220 struct rchan_buf *buf = container_of(kref, struct rchan_buf, kref);
221 relay_destroy_buf(buf);
225 * relay_buf_empty - boolean, is the channel buffer empty?
226 * @buf: channel buffer
228 * Returns 1 if the buffer is empty, 0 otherwise.
230 static int relay_buf_empty(struct rchan_buf *buf)
232 return (buf->subbufs_produced - buf->subbufs_consumed) ? 0 : 1;
236 * relay_buf_full - boolean, is the channel buffer full?
237 * @buf: channel buffer
239 * Returns 1 if the buffer is full, 0 otherwise.
241 int relay_buf_full(struct rchan_buf *buf)
243 size_t ready = buf->subbufs_produced - buf->subbufs_consumed;
244 return (ready >= buf->chan->n_subbufs) ? 1 : 0;
246 EXPORT_SYMBOL_GPL(relay_buf_full);
249 * High-level relay kernel API and associated functions.
252 static int relay_subbuf_start(struct rchan_buf *buf, void *subbuf,
253 void *prev_subbuf, size_t prev_padding)
255 if (!buf->chan->cb->subbuf_start)
256 return !relay_buf_full(buf);
258 return buf->chan->cb->subbuf_start(buf, subbuf,
259 prev_subbuf, prev_padding);
263 * wakeup_readers - wake up readers waiting on a channel
264 * @work: contains the channel buffer
266 * This is the function used to defer reader waking
268 static void wakeup_readers(struct irq_work *work)
270 struct rchan_buf *buf;
272 buf = container_of(work, struct rchan_buf, wakeup_work);
273 wake_up_interruptible(&buf->read_wait);
277 * __relay_reset - reset a channel buffer
278 * @buf: the channel buffer
279 * @init: 1 if this is a first-time initialization
281 * See relay_reset() for description of effect.
283 static void __relay_reset(struct rchan_buf *buf, unsigned int init)
288 init_waitqueue_head(&buf->read_wait);
289 kref_init(&buf->kref);
290 init_irq_work(&buf->wakeup_work, wakeup_readers);
292 irq_work_sync(&buf->wakeup_work);
295 buf->subbufs_produced = 0;
296 buf->subbufs_consumed = 0;
297 buf->bytes_consumed = 0;
299 buf->data = buf->start;
302 for (i = 0; i < buf->chan->n_subbufs; i++)
305 relay_subbuf_start(buf, buf->data, NULL, 0);
309 * relay_reset - reset the channel
312 * This has the effect of erasing all data from all channel buffers
313 * and restarting the channel in its initial state. The buffers
314 * are not freed, so any mappings are still in effect.
316 * NOTE. Care should be taken that the channel isn't actually
317 * being used by anything when this call is made.
319 void relay_reset(struct rchan *chan)
321 struct rchan_buf *buf;
327 if (chan->is_global && (buf = *per_cpu_ptr(chan->buf, 0))) {
328 __relay_reset(buf, 0);
332 mutex_lock(&relay_channels_mutex);
333 for_each_possible_cpu(i)
334 if ((buf = *per_cpu_ptr(chan->buf, i)))
335 __relay_reset(buf, 0);
336 mutex_unlock(&relay_channels_mutex);
338 EXPORT_SYMBOL_GPL(relay_reset);
340 static inline void relay_set_buf_dentry(struct rchan_buf *buf,
341 struct dentry *dentry)
343 buf->dentry = dentry;
344 d_inode(buf->dentry)->i_size = buf->early_bytes;
347 static struct dentry *relay_create_buf_file(struct rchan *chan,
348 struct rchan_buf *buf,
351 struct dentry *dentry;
354 tmpname = kasprintf(GFP_KERNEL, "%s%d", chan->base_filename, cpu);
358 /* Create file in fs */
359 dentry = chan->cb->create_buf_file(tmpname, chan->parent,
371 * relay_open_buf - create a new relay channel buffer
373 * used by relay_open() and CPU hotplug.
375 static struct rchan_buf *relay_open_buf(struct rchan *chan, unsigned int cpu)
377 struct rchan_buf *buf;
378 struct dentry *dentry;
381 return *per_cpu_ptr(chan->buf, 0);
383 buf = relay_create_buf(chan);
387 if (chan->has_base_filename) {
388 dentry = relay_create_buf_file(chan, buf, cpu);
391 relay_set_buf_dentry(buf, dentry);
393 /* Only retrieve global info, nothing more, nothing less */
394 dentry = chan->cb->create_buf_file(NULL, NULL,
397 if (IS_ERR_OR_NULL(dentry))
402 __relay_reset(buf, 1);
404 if(chan->is_global) {
405 *per_cpu_ptr(chan->buf, 0) = buf;
412 relay_destroy_buf(buf);
417 * relay_close_buf - close a channel buffer
418 * @buf: channel buffer
420 * Marks the buffer finalized and restores the default callbacks.
421 * The channel buffer and channel buffer data structure are then freed
422 * automatically when the last reference is given up.
424 static void relay_close_buf(struct rchan_buf *buf)
427 irq_work_sync(&buf->wakeup_work);
428 buf->chan->cb->remove_buf_file(buf->dentry);
429 kref_put(&buf->kref, relay_remove_buf);
432 int relay_prepare_cpu(unsigned int cpu)
435 struct rchan_buf *buf;
437 mutex_lock(&relay_channels_mutex);
438 list_for_each_entry(chan, &relay_channels, list) {
439 if (*per_cpu_ptr(chan->buf, cpu))
441 buf = relay_open_buf(chan, cpu);
443 pr_err("relay: cpu %d buffer creation failed\n", cpu);
444 mutex_unlock(&relay_channels_mutex);
447 *per_cpu_ptr(chan->buf, cpu) = buf;
449 mutex_unlock(&relay_channels_mutex);
454 * relay_open - create a new relay channel
455 * @base_filename: base name of files to create
456 * @parent: dentry of parent directory, %NULL for root directory or buffer
457 * @subbuf_size: size of sub-buffers
458 * @n_subbufs: number of sub-buffers
459 * @cb: client callback functions
460 * @private_data: user-defined data
462 * Returns channel pointer if successful, %NULL otherwise.
464 * Creates a channel buffer for each cpu using the sizes and
465 * attributes specified. The created channel buffer files
466 * will be named base_filename0...base_filenameN-1. File
467 * permissions will be %S_IRUSR.
469 struct rchan *relay_open(const char *base_filename,
470 struct dentry *parent,
473 const struct rchan_callbacks *cb,
478 struct rchan_buf *buf;
480 if (!(subbuf_size && n_subbufs))
482 if (subbuf_size > UINT_MAX / n_subbufs)
484 if (!cb || !cb->create_buf_file || !cb->remove_buf_file)
487 chan = kzalloc(sizeof(struct rchan), GFP_KERNEL);
491 chan->buf = alloc_percpu(struct rchan_buf *);
497 chan->version = RELAYFS_CHANNEL_VERSION;
498 chan->n_subbufs = n_subbufs;
499 chan->subbuf_size = subbuf_size;
500 chan->alloc_size = PAGE_ALIGN(subbuf_size * n_subbufs);
501 chan->parent = parent;
502 chan->private_data = private_data;
504 chan->has_base_filename = 1;
505 strscpy(chan->base_filename, base_filename, NAME_MAX);
508 kref_init(&chan->kref);
510 mutex_lock(&relay_channels_mutex);
511 for_each_online_cpu(i) {
512 buf = relay_open_buf(chan, i);
515 *per_cpu_ptr(chan->buf, i) = buf;
517 list_add(&chan->list, &relay_channels);
518 mutex_unlock(&relay_channels_mutex);
523 for_each_possible_cpu(i) {
524 if ((buf = *per_cpu_ptr(chan->buf, i)))
525 relay_close_buf(buf);
528 kref_put(&chan->kref, relay_destroy_channel);
529 mutex_unlock(&relay_channels_mutex);
532 EXPORT_SYMBOL_GPL(relay_open);
534 struct rchan_percpu_buf_dispatcher {
535 struct rchan_buf *buf;
536 struct dentry *dentry;
540 * relay_switch_subbuf - switch to a new sub-buffer
541 * @buf: channel buffer
542 * @length: size of current event
544 * Returns either the length passed in or 0 if full.
546 * Performs sub-buffer-switch tasks such as invoking callbacks,
547 * updating padding counts, waking up readers, etc.
549 size_t relay_switch_subbuf(struct rchan_buf *buf, size_t length)
552 size_t old_subbuf, new_subbuf;
554 if (unlikely(length > buf->chan->subbuf_size))
557 if (buf->offset != buf->chan->subbuf_size + 1) {
558 buf->prev_padding = buf->chan->subbuf_size - buf->offset;
559 old_subbuf = buf->subbufs_produced % buf->chan->n_subbufs;
560 buf->padding[old_subbuf] = buf->prev_padding;
561 buf->subbufs_produced++;
563 d_inode(buf->dentry)->i_size +=
564 buf->chan->subbuf_size -
565 buf->padding[old_subbuf];
567 buf->early_bytes += buf->chan->subbuf_size -
568 buf->padding[old_subbuf];
570 if (waitqueue_active(&buf->read_wait)) {
572 * Calling wake_up_interruptible() from here
573 * will deadlock if we happen to be logging
574 * from the scheduler (trying to re-grab
575 * rq->lock), so defer it.
577 irq_work_queue(&buf->wakeup_work);
582 new_subbuf = buf->subbufs_produced % buf->chan->n_subbufs;
583 new = buf->start + new_subbuf * buf->chan->subbuf_size;
585 if (!relay_subbuf_start(buf, new, old, buf->prev_padding)) {
586 buf->offset = buf->chan->subbuf_size + 1;
590 buf->padding[new_subbuf] = 0;
592 if (unlikely(length + buf->offset > buf->chan->subbuf_size))
598 buf->chan->last_toobig = length;
601 EXPORT_SYMBOL_GPL(relay_switch_subbuf);
604 * relay_subbufs_consumed - update the buffer's sub-buffers-consumed count
606 * @cpu: the cpu associated with the channel buffer to update
607 * @subbufs_consumed: number of sub-buffers to add to current buf's count
609 * Adds to the channel buffer's consumed sub-buffer count.
610 * subbufs_consumed should be the number of sub-buffers newly consumed,
611 * not the total consumed.
613 * NOTE. Kernel clients don't need to call this function if the channel
614 * mode is 'overwrite'.
616 void relay_subbufs_consumed(struct rchan *chan,
618 size_t subbufs_consumed)
620 struct rchan_buf *buf;
622 if (!chan || cpu >= NR_CPUS)
625 buf = *per_cpu_ptr(chan->buf, cpu);
626 if (!buf || subbufs_consumed > chan->n_subbufs)
629 if (subbufs_consumed > buf->subbufs_produced - buf->subbufs_consumed)
630 buf->subbufs_consumed = buf->subbufs_produced;
632 buf->subbufs_consumed += subbufs_consumed;
634 EXPORT_SYMBOL_GPL(relay_subbufs_consumed);
637 * relay_close - close the channel
640 * Closes all channel buffers and frees the channel.
642 void relay_close(struct rchan *chan)
644 struct rchan_buf *buf;
650 mutex_lock(&relay_channels_mutex);
651 if (chan->is_global && (buf = *per_cpu_ptr(chan->buf, 0)))
652 relay_close_buf(buf);
654 for_each_possible_cpu(i)
655 if ((buf = *per_cpu_ptr(chan->buf, i)))
656 relay_close_buf(buf);
658 if (chan->last_toobig)
659 printk(KERN_WARNING "relay: one or more items not logged "
660 "[item size (%zd) > sub-buffer size (%zd)]\n",
661 chan->last_toobig, chan->subbuf_size);
663 list_del(&chan->list);
664 kref_put(&chan->kref, relay_destroy_channel);
665 mutex_unlock(&relay_channels_mutex);
667 EXPORT_SYMBOL_GPL(relay_close);
670 * relay_flush - close the channel
673 * Flushes all channel buffers, i.e. forces buffer switch.
675 void relay_flush(struct rchan *chan)
677 struct rchan_buf *buf;
683 if (chan->is_global && (buf = *per_cpu_ptr(chan->buf, 0))) {
684 relay_switch_subbuf(buf, 0);
688 mutex_lock(&relay_channels_mutex);
689 for_each_possible_cpu(i)
690 if ((buf = *per_cpu_ptr(chan->buf, i)))
691 relay_switch_subbuf(buf, 0);
692 mutex_unlock(&relay_channels_mutex);
694 EXPORT_SYMBOL_GPL(relay_flush);
697 * relay_file_open - open file op for relay files
701 * Increments the channel buffer refcount.
703 static int relay_file_open(struct inode *inode, struct file *filp)
705 struct rchan_buf *buf = inode->i_private;
706 kref_get(&buf->kref);
707 filp->private_data = buf;
709 return nonseekable_open(inode, filp);
713 * relay_file_mmap - mmap file op for relay files
715 * @vma: the vma describing what to map
717 * Calls upon relay_mmap_buf() to map the file into user space.
719 static int relay_file_mmap(struct file *filp, struct vm_area_struct *vma)
721 struct rchan_buf *buf = filp->private_data;
722 return relay_mmap_buf(buf, vma);
726 * relay_file_poll - poll file op for relay files
732 static __poll_t relay_file_poll(struct file *filp, poll_table *wait)
735 struct rchan_buf *buf = filp->private_data;
740 if (filp->f_mode & FMODE_READ) {
741 poll_wait(filp, &buf->read_wait, wait);
742 if (!relay_buf_empty(buf))
743 mask |= EPOLLIN | EPOLLRDNORM;
750 * relay_file_release - release file op for relay files
754 * Decrements the channel refcount, as the filesystem is
755 * no longer using it.
757 static int relay_file_release(struct inode *inode, struct file *filp)
759 struct rchan_buf *buf = filp->private_data;
760 kref_put(&buf->kref, relay_remove_buf);
766 * relay_file_read_consume - update the consumed count for the buffer
768 static void relay_file_read_consume(struct rchan_buf *buf,
770 size_t bytes_consumed)
772 size_t subbuf_size = buf->chan->subbuf_size;
773 size_t n_subbufs = buf->chan->n_subbufs;
776 if (buf->subbufs_produced == buf->subbufs_consumed &&
777 buf->offset == buf->bytes_consumed)
780 if (buf->bytes_consumed + bytes_consumed > subbuf_size) {
781 relay_subbufs_consumed(buf->chan, buf->cpu, 1);
782 buf->bytes_consumed = 0;
785 buf->bytes_consumed += bytes_consumed;
787 read_subbuf = buf->subbufs_consumed % n_subbufs;
789 read_subbuf = read_pos / buf->chan->subbuf_size;
790 if (buf->bytes_consumed + buf->padding[read_subbuf] == subbuf_size) {
791 if ((read_subbuf == buf->subbufs_produced % n_subbufs) &&
792 (buf->offset == subbuf_size))
794 relay_subbufs_consumed(buf->chan, buf->cpu, 1);
795 buf->bytes_consumed = 0;
800 * relay_file_read_avail - boolean, are there unconsumed bytes available?
802 static int relay_file_read_avail(struct rchan_buf *buf)
804 size_t subbuf_size = buf->chan->subbuf_size;
805 size_t n_subbufs = buf->chan->n_subbufs;
806 size_t produced = buf->subbufs_produced;
809 relay_file_read_consume(buf, 0, 0);
811 consumed = buf->subbufs_consumed;
813 if (unlikely(buf->offset > subbuf_size)) {
814 if (produced == consumed)
819 if (unlikely(produced - consumed >= n_subbufs)) {
820 consumed = produced - n_subbufs + 1;
821 buf->subbufs_consumed = consumed;
822 buf->bytes_consumed = 0;
825 produced = (produced % n_subbufs) * subbuf_size + buf->offset;
826 consumed = (consumed % n_subbufs) * subbuf_size + buf->bytes_consumed;
828 if (consumed > produced)
829 produced += n_subbufs * subbuf_size;
831 if (consumed == produced) {
832 if (buf->offset == subbuf_size &&
833 buf->subbufs_produced > buf->subbufs_consumed)
842 * relay_file_read_subbuf_avail - return bytes available in sub-buffer
843 * @read_pos: file read position
844 * @buf: relay channel buffer
846 static size_t relay_file_read_subbuf_avail(size_t read_pos,
847 struct rchan_buf *buf)
849 size_t padding, avail = 0;
850 size_t read_subbuf, read_offset, write_subbuf, write_offset;
851 size_t subbuf_size = buf->chan->subbuf_size;
853 write_subbuf = (buf->data - buf->start) / subbuf_size;
854 write_offset = buf->offset > subbuf_size ? subbuf_size : buf->offset;
855 read_subbuf = read_pos / subbuf_size;
856 read_offset = read_pos % subbuf_size;
857 padding = buf->padding[read_subbuf];
859 if (read_subbuf == write_subbuf) {
860 if (read_offset + padding < write_offset)
861 avail = write_offset - (read_offset + padding);
863 avail = (subbuf_size - padding) - read_offset;
869 * relay_file_read_start_pos - find the first available byte to read
870 * @buf: relay channel buffer
872 * If the read_pos is in the middle of padding, return the
873 * position of the first actually available byte, otherwise
874 * return the original value.
876 static size_t relay_file_read_start_pos(struct rchan_buf *buf)
878 size_t read_subbuf, padding, padding_start, padding_end;
879 size_t subbuf_size = buf->chan->subbuf_size;
880 size_t n_subbufs = buf->chan->n_subbufs;
881 size_t consumed = buf->subbufs_consumed % n_subbufs;
882 size_t read_pos = (consumed * subbuf_size + buf->bytes_consumed)
883 % (n_subbufs * subbuf_size);
885 read_subbuf = read_pos / subbuf_size;
886 padding = buf->padding[read_subbuf];
887 padding_start = (read_subbuf + 1) * subbuf_size - padding;
888 padding_end = (read_subbuf + 1) * subbuf_size;
889 if (read_pos >= padding_start && read_pos < padding_end) {
890 read_subbuf = (read_subbuf + 1) % n_subbufs;
891 read_pos = read_subbuf * subbuf_size;
898 * relay_file_read_end_pos - return the new read position
899 * @read_pos: file read position
900 * @buf: relay channel buffer
901 * @count: number of bytes to be read
903 static size_t relay_file_read_end_pos(struct rchan_buf *buf,
907 size_t read_subbuf, padding, end_pos;
908 size_t subbuf_size = buf->chan->subbuf_size;
909 size_t n_subbufs = buf->chan->n_subbufs;
911 read_subbuf = read_pos / subbuf_size;
912 padding = buf->padding[read_subbuf];
913 if (read_pos % subbuf_size + count + padding == subbuf_size)
914 end_pos = (read_subbuf + 1) * subbuf_size;
916 end_pos = read_pos + count;
917 if (end_pos >= subbuf_size * n_subbufs)
923 static ssize_t relay_file_read(struct file *filp,
928 struct rchan_buf *buf = filp->private_data;
929 size_t read_start, avail;
936 inode_lock(file_inode(filp));
940 if (!relay_file_read_avail(buf))
943 read_start = relay_file_read_start_pos(buf);
944 avail = relay_file_read_subbuf_avail(read_start, buf);
948 avail = min(count, avail);
949 from = buf->start + read_start;
951 if (copy_to_user(buffer, from, avail))
958 relay_file_read_consume(buf, read_start, ret);
959 *ppos = relay_file_read_end_pos(buf, read_start, ret);
961 inode_unlock(file_inode(filp));
967 const struct file_operations relay_file_operations = {
968 .open = relay_file_open,
969 .poll = relay_file_poll,
970 .mmap = relay_file_mmap,
971 .read = relay_file_read,
972 .release = relay_file_release,
974 EXPORT_SYMBOL_GPL(relay_file_operations);