This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / fs / intermezzo / intermezzo_psdev.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4
5 #ifndef __PRESTO_PSDEV_H
6 #define __PRESTO_PSDEV_H
7
8 #define MAX_CHANNEL 16
9 #define PROCNAME_SIZE 32
10 #include <linux/smp_lock.h>
11
12 /* represents state of an instance reached with /dev/intermezzo */
13 /* communication pending & processing queues */
14 struct upc_channel {
15         unsigned int         uc_seq;
16         wait_queue_head_t    uc_waitq;    /* Lento wait queue */
17         struct list_head     uc_pending;
18         struct list_head     uc_processing;
19         spinlock_t            uc_lock;
20         int                  uc_pid;      /* Lento's pid */
21         int                  uc_hard;     /* allows signals during upcalls */
22         int                  uc_no_filter;
23         int                  uc_no_journal;
24         int                  uc_no_upcall;
25         int                  uc_timeout;  /* . sec: signals will dequeue upc */
26         long                 uc_errorval; /* for testing I/O failures */
27         struct list_head     uc_cache_list;
28         int                  uc_minor;
29 };
30
31 #define ISLENTO(minor) (current->pid == izo_channels[minor].uc_pid \
32                 || current->real_parent->pid == izo_channels[minor].uc_pid \
33                 || current->real_parent->real_parent->pid == izo_channels[minor].uc_pid)
34
35 extern struct upc_channel izo_channels[MAX_CHANNEL];
36
37 /* message types between presto filesystem in kernel */
38 #define REQ_READ   1
39 #define REQ_WRITE  2
40 #define REQ_ASYNC  4
41 #define REQ_DEAD   8
42
43 struct upc_req {
44         struct list_head   rq_chain;
45         caddr_t            rq_data;
46         int                rq_flags;
47         int                rq_bufsize;
48         int                rq_rep_size;
49         int                rq_opcode;  /* copied from data to save lookup */
50         int                rq_unique;
51         wait_queue_head_t  rq_sleep;   /* process' wait queue */
52         unsigned long      rq_posttime;
53 };
54
55 #endif