This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / linux / relayfs_fs.h
1 /*
2  * linux/include/linux/relayfs_fs.h
3  *
4  * Copyright (C) 2002, 2003 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp
5  * Copyright (C) 1999, 2000, 2001, 2002 - Karim Yaghmour (karim@opersys.com)
6  *
7  * RelayFS definitions and declarations
8  *
9  * Please see Documentation/filesystems/relayfs.txt for more info.
10  */
11
12 #ifndef _LINUX_RELAYFS_FS_H
13 #define _LINUX_RELAYFS_FS_H
14
15 #include <linux/config.h>
16 #include <linux/types.h>
17 #include <linux/sched.h>
18 #include <linux/wait.h>
19 #include <linux/list.h>
20 #include <linux/fs.h>
21
22 /*
23  * Tracks changes to rchan struct
24  */
25 #define RELAYFS_CHANNEL_VERSION         1
26
27 /*
28  * Maximum number of simultaneously open channels
29  */
30 #define RELAY_MAX_CHANNELS              256
31
32 /*
33  * Relay properties
34  */
35 #define RELAY_MIN_BUFS                  2
36 #define RELAY_MIN_BUFSIZE               4096
37 #define RELAY_MAX_BUFS                  256
38 #define RELAY_MAX_BUF_SIZE              0x1000000
39 #define RELAY_MAX_TOTAL_BUF_SIZE        0x8000000
40
41 /*
42  * Lockless scheme utility macros
43  */
44 #define RELAY_MAX_BUFNO(bufno_bits) (1UL << (bufno_bits))
45 #define RELAY_BUF_SIZE(offset_bits) (1UL << (offset_bits))
46 #define RELAY_BUF_OFFSET_MASK(offset_bits) (RELAY_BUF_SIZE(offset_bits) - 1)
47 #define RELAY_BUFNO_GET(index, offset_bits) ((index) >> (offset_bits))
48 #define RELAY_BUF_OFFSET_GET(index, mask) ((index) & (mask))
49 #define RELAY_BUF_OFFSET_CLEAR(index, mask) ((index) & ~(mask))
50
51 /*
52  * Flags returned by relay_reserve()
53  */
54 #define RELAY_BUFFER_SWITCH_NONE        0x0
55 #define RELAY_WRITE_DISCARD_NONE        0x0
56 #define RELAY_BUFFER_SWITCH             0x1
57 #define RELAY_WRITE_DISCARD             0x2
58 #define RELAY_WRITE_TOO_LONG            0x4
59
60 /*
61  * Relay attribute flags
62  */
63 #define RELAY_DELIVERY_BULK             0x1
64 #define RELAY_DELIVERY_PACKET           0x2
65 #define RELAY_SCHEME_LOCKLESS           0x4
66 #define RELAY_SCHEME_LOCKING            0x8
67 #define RELAY_SCHEME_ANY                0xC
68 #define RELAY_TIMESTAMP_TSC             0x10
69 #define RELAY_TIMESTAMP_GETTIMEOFDAY    0x20
70 #define RELAY_TIMESTAMP_ANY             0x30
71 #define RELAY_USAGE_SMP                 0x40
72 #define RELAY_USAGE_GLOBAL              0x80
73 #define RELAY_MODE_CONTINUOUS           0x100
74 #define RELAY_MODE_NO_OVERWRITE         0x200
75
76 /*
77  * Flags for needs_resize() callback
78  */
79 #define RELAY_RESIZE_NONE       0x0
80 #define RELAY_RESIZE_EXPAND     0x1
81 #define RELAY_RESIZE_SHRINK     0x2
82 #define RELAY_RESIZE_REPLACE    0x4
83 #define RELAY_RESIZE_REPLACED   0x8
84
85 /*
86  * Values for fileop_notify() callback
87  */
88 enum relay_fileop
89 {
90         RELAY_FILE_OPEN,
91         RELAY_FILE_CLOSE,
92         RELAY_FILE_MAP,
93         RELAY_FILE_UNMAP
94 };
95
96 /*
97  * Data structure returned by relay_info()
98  */
99 struct rchan_info
100 {
101         u32 flags;              /* relay attribute flags for channel */
102         u32 buf_size;           /* channel's sub-buffer size */
103         char *buf_addr;         /* address of channel start */
104         u32 alloc_size;         /* total buffer size actually allocated */
105         u32 n_bufs;             /* number of sub-buffers in channel */
106         u32 cur_idx;            /* current write index into channel */
107         u32 bufs_produced;      /* current count of sub-buffers produced */
108         u32 bufs_consumed;      /* current count of sub-buffers consumed */
109         u32 buf_id;             /* buf_id of current sub-buffer */
110         int buffer_complete[RELAY_MAX_BUFS];    /* boolean per sub-buffer */
111         int unused_bytes[RELAY_MAX_BUFS];       /* count per sub-buffer */
112 };
113
114 /*
115  * Relay channel client callbacks
116  */
117 struct rchan_callbacks
118 {
119         /*
120          * buffer_start - called at the beginning of a new sub-buffer
121          * @rchan_id: the channel id
122          * @current_write_pos: position in sub-buffer client should write to
123          * @buffer_id: the id of the new sub-buffer
124          * @start_time: the timestamp associated with the start of sub-buffer
125          * @start_tsc: the TSC associated with the timestamp, if using_tsc
126          * @using_tsc: boolean, indicates whether start_tsc is valid
127          *
128          * Return value should be the number of bytes written by the client.
129          *
130          * See Documentation/filesystems/relayfs.txt for details.
131          */
132         int (*buffer_start) (int rchan_id,
133                              char *current_write_pos,
134                              u32 buffer_id,
135                              struct timeval start_time,
136                              u32 start_tsc,
137                              int using_tsc);
138
139         /*
140          * buffer_end - called at the end of a sub-buffer
141          * @rchan_id: the channel id
142          * @current_write_pos: position in sub-buffer of end of data
143          * @end_of_buffer: the position of the end of the sub-buffer
144          * @end_time: the timestamp associated with the end of the sub-buffer
145          * @end_tsc: the TSC associated with the end_time, if using_tsc
146          * @using_tsc: boolean, indicates whether end_tsc is valid
147          *
148          * Return value should be the number of bytes written by the client.
149          *
150          * See Documentation/filesystems/relayfs.txt for details.
151          */
152         int (*buffer_end) (int rchan_id,
153                            char *current_write_pos,
154                            char *end_of_buffer,
155                            struct timeval end_time,
156                            u32 end_tsc,
157                            int using_tsc);
158
159         /*
160          * deliver - called when data is ready for the client
161          * @rchan_id: the channel id
162          * @from: the start of the delivered data
163          * @len: the length of the delivered data
164          *
165          * See Documentation/filesystems/relayfs.txt for details.
166          */
167         void (*deliver) (int rchan_id, char *from, u32 len);
168
169         /*
170          * user_deliver - called when data has been written from userspace
171          * @rchan_id: the channel id
172          * @from: the start of the delivered data
173          * @len: the length of the delivered data
174          *
175          * See Documentation/filesystems/relayfs.txt for details.
176          */
177         void (*user_deliver) (int rchan_id, char *from, u32 len);
178
179         /*
180          * needs_resize - called when a resizing event occurs
181          * @rchan_id: the channel id
182          * @resize_type: the type of resizing event
183          * @suggested_buf_size: the suggested new sub-buffer size
184          * @suggested_buf_size: the suggested new number of sub-buffers
185          *
186          * See Documentation/filesystems/relayfs.txt for details.
187          */
188         void (*needs_resize)(int rchan_id,
189                              int resize_type,
190                              u32 suggested_buf_size,
191                              u32 suggested_n_bufs);
192
193         /*
194          * fileop_notify - called on open/close/mmap/munmap of a relayfs file
195          * @rchan_id: the channel id
196          * @filp: relayfs file pointer
197          * @fileop: which file operation is in progress
198          *
199          * The return value can direct the outcome of the operation.
200          *
201          * See Documentation/filesystems/relayfs.txt for details.
202          */
203         int (*fileop_notify)(int rchan_id,
204                              struct file *filp,
205                              enum relay_fileop fileop);
206
207         /*
208          * ioctl - called in ioctl context from userspace
209          * @rchan_id: the channel id
210          * @cmd: ioctl cmd
211          * @arg: ioctl cmd arg
212          *
213          * The return value is returned as the value from the ioctl call.
214          *
215          * See Documentation/filesystems/relayfs.txt for details.
216          */
217         int (*ioctl) (int rchan_id, unsigned int cmd, unsigned long arg);
218 };
219
220 /*
221  * Lockless scheme-specific data
222  */
223 struct lockless_rchan
224 {
225         u8 bufno_bits;          /* # bits used for sub-buffer id */
226         u8 offset_bits;         /* # bits used for offset within sub-buffer */
227         u32 index;              /* current index = sub-buffer id and offset */
228         u32 offset_mask;        /* used to obtain offset portion of index */
229         u32 index_mask;         /* used to mask off unused bits index */
230         atomic_t fill_count[RELAY_MAX_BUFS];    /* fill count per sub-buffer */
231 };
232
233 /*
234  * Locking scheme-specific data
235  */
236 struct locking_rchan
237 {
238         char *write_buf;                /* start of write sub-buffer */
239         char *write_buf_end;            /* end of write sub-buffer */
240         char *current_write_pos;        /* current write pointer */
241         char *write_limit;              /* takes reserves into account */
242         char *in_progress_event_pos;    /* used for interrupted writes */
243         u16 in_progress_event_size;     /* used for interrupted writes */
244         char *interrupted_pos;          /* used for interrupted writes */
245         u16 interrupting_size;          /* used for interrupted writes */
246         spinlock_t lock;                /* channel lock for locking scheme */
247 };
248
249 struct relay_ops;
250
251 /*
252  * Offset resizing data structure
253  */
254 struct resize_offset
255 {
256         u32 ge;
257         u32 le;
258         int delta;
259 };
260
261 /*
262  * Relay channel data structure
263  */
264 struct rchan
265 {
266         u32 version;                    /* the version of this struct */
267         char *buf;                      /* the channel buffer */
268         union
269         {
270                 struct lockless_rchan lockless;
271                 struct locking_rchan locking;
272         } scheme;                       /* scheme-specific channel data */
273
274         int id;                         /* the channel id */
275         struct rchan_callbacks *callbacks;      /* client callbacks */
276         u32 flags;                      /* relay channel attributes */
277         u32 buf_id;                     /* current sub-buffer id */
278         u32 buf_idx;                    /* current sub-buffer index */
279
280         atomic_t mapped;                /* map count */
281
282         atomic_t suspended;             /* channel suspended i.e full? */
283         int half_switch;                /* used internally for suspend */
284
285         struct timeval  buf_start_time; /* current sub-buffer start time */
286         u32 buf_start_tsc;              /* current sub-buffer start TSC */
287         
288         u32 buf_size;                   /* sub-buffer size */
289         u32 alloc_size;                 /* total buffer size allocated */
290         u32 n_bufs;                     /* number of sub-buffers */
291
292         u32 bufs_produced;              /* count of sub-buffers produced */
293         u32 bufs_consumed;              /* count of sub-buffers consumed */
294         u32 bytes_consumed;             /* bytes consumed in cur sub-buffer */
295
296         int initialized;                /* first buffer initialized? */
297         int finalized;                  /* channel finalized? */
298
299         u32 start_reserve;              /* reserve at start of sub-buffers */
300         u32 end_reserve;                /* reserve at end of sub-buffers */
301         u32 rchan_start_reserve;        /* additional reserve sub-buffer 0 */
302         
303         struct dentry *dentry;          /* channel file dentry */
304
305         wait_queue_head_t read_wait;    /* VFS read wait queue */
306         wait_queue_head_t write_wait;   /* VFS write wait queue */
307         struct work_struct wake_readers; /* reader wake-up work struct */
308         struct work_struct wake_writers; /* reader wake-up work struct */
309         atomic_t refcount;              /* channel refcount */
310
311         struct relay_ops *relay_ops;    /* scheme-specific channel ops */
312
313         int unused_bytes[RELAY_MAX_BUFS]; /* unused count per sub-buffer */
314
315         struct semaphore resize_sem;    /* serializes alloc/repace */
316         struct work_struct work;        /* resize allocation work struct */
317
318         struct list_head open_readers;  /* open readers for this channel */
319         rwlock_t open_readers_lock;     /* protection for open_readers list */
320
321         char *init_buf;                 /* init channel buffer, if non-NULL */
322         
323         u32 resize_min;                 /* minimum resized total buffer size */
324         u32 resize_max;                 /* maximum resized total buffer size */
325         char *resize_buf;               /* for autosize alloc/free */
326         u32 resize_buf_size;            /* resized sub-buffer size */
327         u32 resize_n_bufs;              /* resized number of sub-buffers */
328         u32 resize_alloc_size;          /* resized actual total size */
329         int resizing;                   /* is resizing in progress? */
330         int resize_err;                 /* resizing err code */
331         int resize_failures;            /* number of resize failures */
332         int replace_buffer;             /* is the alloced buffer ready?  */
333         struct resize_offset resize_offset; /* offset change */
334         struct timer_list shrink_timer; /* timer used for shrinking */
335         int resize_order;               /* size of last resize */
336         u32 expand_buf_id;              /* subbuf id expand will occur at */
337
338         struct page **buf_page_array;   /* array of current buffer pages */
339         int buf_page_count;             /* number of current buffer pages */
340         struct page **expand_page_array;/* new pages to be inserted */
341         int expand_page_count;          /* number of new pages */
342         struct page **shrink_page_array;/* old pages to be freed */
343         int shrink_page_count;          /* number of old pages */
344         struct page **resize_page_array;/* will become current pages */
345         int resize_page_count;          /* number of resize pages */
346         struct page **old_buf_page_array; /* hold for freeing */
347 } ____cacheline_aligned;
348
349 /*
350  * Relay channel reader struct
351  */
352 struct rchan_reader
353 {
354         struct list_head list;          /* for list inclusion */
355         struct rchan *rchan;            /* the channel we're reading from */
356         int auto_consume;               /* does this reader auto-consume? */
357         u32 bufs_consumed;              /* buffers this reader has consumed */
358         u32 bytes_consumed;             /* bytes consumed in cur sub-buffer */
359         int offset_changed;             /* have channel offsets changed? */
360         int vfs_reader;                 /* are we a VFS reader? */
361         int map_reader;                 /* are we an mmap reader? */
362
363         union
364         {
365                 struct file *file;
366                 u32 f_pos;
367         } pos;                          /* current read offset */
368 };
369
370 /*
371  * These help make union member access less tedious
372  */
373 #define channel_buffer(rchan) ((rchan)->buf)
374 #define idx(rchan) ((rchan)->scheme.lockless.index)
375 #define bufno_bits(rchan) ((rchan)->scheme.lockless.bufno_bits)
376 #define offset_bits(rchan) ((rchan)->scheme.lockless.offset_bits)
377 #define offset_mask(rchan) ((rchan)->scheme.lockless.offset_mask)
378 #define idx_mask(rchan) ((rchan)->scheme.lockless.index_mask)
379 #define bulk_delivery(rchan) (((rchan)->flags & RELAY_DELIVERY_BULK) ? 1 : 0)
380 #define packet_delivery(rchan) (((rchan)->flags & RELAY_DELIVERY_PACKET) ? 1 : 0)
381 #define using_lockless(rchan) (((rchan)->flags & RELAY_SCHEME_LOCKLESS) ? 1 : 0)
382 #define using_locking(rchan) (((rchan)->flags & RELAY_SCHEME_LOCKING) ? 1 : 0)
383 #define using_tsc(rchan) (((rchan)->flags & RELAY_TIMESTAMP_TSC) ? 1 : 0)
384 #define using_gettimeofday(rchan) (((rchan)->flags & RELAY_TIMESTAMP_GETTIMEOFDAY) ? 1 : 0)
385 #define usage_smp(rchan) (((rchan)->flags & RELAY_USAGE_SMP) ? 1 : 0)
386 #define usage_global(rchan) (((rchan)->flags & RELAY_USAGE_GLOBAL) ? 1 : 0)
387 #define mode_continuous(rchan) (((rchan)->flags & RELAY_MODE_CONTINUOUS) ? 1 : 0)
388 #define fill_count(rchan, i) ((rchan)->scheme.lockless.fill_count[(i)])
389 #define write_buf(rchan) ((rchan)->scheme.locking.write_buf)
390 #define read_buf(rchan) ((rchan)->scheme.locking.read_buf)
391 #define write_buf_end(rchan) ((rchan)->scheme.locking.write_buf_end)
392 #define read_buf_end(rchan) ((rchan)->scheme.locking.read_buf_end)
393 #define cur_write_pos(rchan) ((rchan)->scheme.locking.current_write_pos)
394 #define read_limit(rchan) ((rchan)->scheme.locking.read_limit)
395 #define write_limit(rchan) ((rchan)->scheme.locking.write_limit)
396 #define in_progress_event_pos(rchan) ((rchan)->scheme.locking.in_progress_event_pos)
397 #define in_progress_event_size(rchan) ((rchan)->scheme.locking.in_progress_event_size)
398 #define interrupted_pos(rchan) ((rchan)->scheme.locking.interrupted_pos)
399 #define interrupting_size(rchan) ((rchan)->scheme.locking.interrupting_size)
400 #define channel_lock(rchan) ((rchan)->scheme.locking.lock)
401
402
403 /**
404  *      calc_time_delta - utility function for time delta calculation
405  *      @now: current time
406  *      @start: start time
407  *
408  *      Returns the time delta produced by subtracting start time from now.
409  */
410 static inline u32
411 calc_time_delta(struct timeval *now, 
412                 struct timeval *start)
413 {
414         return (now->tv_sec - start->tv_sec) * 1000000
415                 + (now->tv_usec - start->tv_usec);
416 }
417
418 /**
419  *      recalc_time_delta - utility function for time delta recalculation
420  *      @now: current time
421  *      @new_delta: the new time delta calculated
422  *      @cpu: the associated CPU id
423  */
424 static inline void 
425 recalc_time_delta(struct timeval *now,
426                   u32 *new_delta,
427                   struct rchan *rchan)
428 {
429         if (using_tsc(rchan) == 0)
430                 *new_delta = calc_time_delta(now, &rchan->buf_start_time);
431 }
432
433 /**
434  *      have_cmpxchg - does this architecture have a cmpxchg?
435  *
436  *      Returns 1 if this architecture has a cmpxchg useable by 
437  *      the lockless scheme, 0 otherwise.
438  */
439 static inline int 
440 have_cmpxchg(void)
441 {
442 #if defined(__HAVE_ARCH_CMPXCHG)
443         return 1;
444 #else
445         return 0;
446 #endif
447 }
448
449 /**
450  *      relay_write_direct - write data directly into destination buffer
451  */
452 #define relay_write_direct(DEST, SRC, SIZE) \
453 do\
454 {\
455    memcpy(DEST, SRC, SIZE);\
456    DEST += SIZE;\
457 } while (0);
458
459 /**
460  *      relay_lock_channel - lock the relay channel if applicable
461  *
462  *      This macro only affects the locking scheme.  If the locking scheme
463  *      is in use and the channel usage is SMP, does a local_irq_save.  If the 
464  *      locking sheme is in use and the channel usage is GLOBAL, uses 
465  *      spin_lock_irqsave.  FLAGS is initialized to 0 since we know that
466  *      it is being initialized prior to use and we avoid the compiler warning.
467  */
468 #define relay_lock_channel(RCHAN, FLAGS) \
469 do\
470 {\
471    FLAGS = 0;\
472    if (using_locking(RCHAN)) {\
473       if (usage_smp(RCHAN)) {\
474          local_irq_save(FLAGS); \
475       } else {\
476          spin_lock_irqsave(&(RCHAN)->scheme.locking.lock, FLAGS); \
477       }\
478    }\
479 } while (0);
480
481 /**
482  *      relay_unlock_channel - unlock the relay channel if applicable
483  *
484  *      This macro only affects the locking scheme.  See relay_lock_channel.
485  */
486 #define relay_unlock_channel(RCHAN, FLAGS) \
487 do\
488 {\
489    if (using_locking(RCHAN)) {\
490       if (usage_smp(RCHAN)) {\
491          local_irq_restore(FLAGS); \
492       } else {\
493          spin_unlock_irqrestore(&(RCHAN)->scheme.locking.lock, FLAGS); \
494       }\
495    }\
496 } while (0);
497
498 /*
499  * Define cmpxchg if we don't have it
500  */
501 #ifndef __HAVE_ARCH_CMPXCHG
502 #define cmpxchg(p,o,n) 0
503 #endif
504
505 /*
506  * High-level relayfs kernel API, fs/relayfs/relay.c
507  */
508 extern int
509 relay_open(const char *chanpath,
510            int bufsize,
511            int nbufs,
512            u32 flags,
513            struct rchan_callbacks *channel_callbacks,
514            u32 start_reserve,
515            u32 end_reserve,
516            u32 rchan_start_reserve,
517            u32 resize_min,
518            u32 resize_max,
519            int mode,
520            char *init_buf,
521            u32 init_buf_size);
522
523 extern int
524 relay_close(int rchan_id);
525
526 extern int
527 relay_write(int rchan_id,
528             const void *data_ptr, 
529             size_t count,
530             int td_offset,
531             void **wrote_pos);
532
533 extern ssize_t
534 relay_read(struct rchan_reader *reader,
535            char *buf,
536            size_t count,
537            int wait,
538            u32 *actual_read_offset);
539
540 extern int
541 relay_discard_init_buf(int rchan_id);
542
543 extern struct rchan_reader *
544 add_rchan_reader(int rchan_id, int autoconsume);
545
546 extern int
547 remove_rchan_reader(struct rchan_reader *reader);
548
549 extern struct rchan_reader *
550 add_map_reader(int rchan_id);
551
552 extern int
553 remove_map_reader(struct rchan_reader *reader);
554
555 extern int 
556 relay_info(int rchan_id, struct rchan_info *rchan_info);
557
558 extern void 
559 relay_buffers_consumed(struct rchan_reader *reader, u32 buffers_consumed);
560
561 extern void
562 relay_bytes_consumed(struct rchan_reader *reader, u32 bytes_consumed, u32 read_offset);
563
564 extern ssize_t
565 relay_bytes_avail(struct rchan_reader *reader);
566
567 extern int
568 relay_realloc_buffer(int rchan_id, u32 new_nbufs, int in_background);
569
570 extern int
571 relay_replace_buffer(int rchan_id);
572
573 extern int
574 rchan_empty(struct rchan_reader *reader);
575
576 extern int
577 rchan_full(struct rchan_reader *reader);
578
579 extern void
580 update_readers_consumed(struct rchan *rchan, u32 bufs_consumed, u32 bytes_consumed);
581
582 extern int 
583 __relay_mmap_buffer(struct rchan *rchan, struct vm_area_struct *vma);
584
585 extern struct rchan_reader *
586 __add_rchan_reader(struct rchan *rchan, struct file *filp, int auto_consume, int map_reader);
587
588 extern void
589 __remove_rchan_reader(struct rchan_reader *reader);
590
591 /*
592  * Low-level relayfs kernel API, fs/relayfs/relay.c
593  */
594 extern struct rchan *
595 rchan_get(int rchan_id);
596
597 extern void
598 rchan_put(struct rchan *rchan);
599
600 extern char *
601 relay_reserve(struct rchan *rchan,
602               u32 data_len,
603               struct timeval *time_stamp,
604               u32 *time_delta,
605               int *errcode,
606               int *interrupting);
607
608 extern void 
609 relay_commit(struct rchan *rchan,
610              char *from, 
611              u32 len, 
612              int reserve_code,
613              int interrupting);
614
615 extern u32 
616 relay_get_offset(struct rchan *rchan, u32 *max_offset);
617
618 extern int
619 relay_reset(int rchan_id);
620
621 /*
622  * VFS functions, fs/relayfs/inode.c
623  */
624 extern int 
625 relayfs_create_dir(const char *name, 
626                    struct dentry *parent, 
627                    struct dentry **dentry);
628
629 extern int
630 relayfs_create_file(const char * name,
631                     struct dentry *parent, 
632                     struct dentry **dentry,
633                     void * data,
634                     int mode);
635
636 extern int 
637 relayfs_remove_file(struct dentry *dentry);
638
639 extern int
640 reset_index(struct rchan *rchan, u32 old_index);
641
642
643 /*
644  * klog functions, fs/relayfs/klog.c
645  */
646 extern int
647 create_klog_channel(void);
648
649 extern int
650 remove_klog_channel(void);
651
652 /*
653  * Scheme-specific channel ops
654  */
655 struct relay_ops
656 {
657         char * (*reserve) (struct rchan *rchan,
658                            u32 slot_len,
659                            struct timeval *time_stamp,
660                            u32 *tsc,
661                            int * errcode,
662                            int * interrupting);
663         
664         void (*commit) (struct rchan *rchan,
665                         char *from,
666                         u32 len, 
667                         int deliver, 
668                         int interrupting);
669
670         u32 (*get_offset) (struct rchan *rchan,
671                            u32 *max_offset);
672         
673         void (*resume) (struct rchan *rchan);
674         void (*finalize) (struct rchan *rchan);
675         void (*reset) (struct rchan *rchan,
676                        int init);
677         int (*reset_index) (struct rchan *rchan,
678                             u32 old_index);
679 };
680
681 #endif /* _LINUX_RELAYFS_FS_H */
682
683
684
685
686