root/xfs/xfs_dev.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


    1 /*
    2  * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
    3  * (Royal Institute of Technology, Stockholm, Sweden).
    4  * All rights reserved.
    5  *
    6  * Redistribution and use in source and binary forms, with or without
    7  * modification, are permitted provided that the following conditions
    8  * are met:
    9  *
   10  * 1. Redistributions of source code must retain the above copyright
   11  *    notice, this list of conditions and the following disclaimer.
   12  *
   13  * 2. Redistributions in binary form must reproduce the above copyright
   14  *    notice, this list of conditions and the following disclaimer in the
   15  *    documentation and/or other materials provided with the distribution.
   16  *
   17  * 3. Neither the name of the Institute nor the names of its contributors
   18  *    may be used to endorse or promote products derived from this software
   19  *    without specific prior written permission.
   20  *
   21  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
   22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
   25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   31  * SUCH DAMAGE.
   32  */
   33 
   34 /* $arla: xfs_dev.h,v 1.19 2003/01/19 20:53:52 lha Exp $ */
   35 
   36 #ifndef _xfs_dev_h
   37 #define _xfs_dev_h
   38 
   39 /*
   40  * Queues of xfs_links hold outbound messages and processes sleeping
   41  * for replies. The last field is used to return error to sleepers and
   42  * to keep record of memory to be deallocated when messages have been
   43  * delivered or dropped.
   44  */
   45 
   46 struct xfs_link {
   47     struct xfs_link *prev, *next;
   48     struct xfs_message_header *message;
   49     u_int error_or_size;               /* error on sleepq and size on
   50                                         * messageq */
   51 };
   52 
   53 struct xfs_channel {
   54     struct xfs_link messageq;          /* Messages not yet read */
   55     struct xfs_link sleepq;            /* Waiting for reply message */
   56     u_int nsequence;
   57 #ifdef __osf__
   58     sel_queue_t sel_q;
   59 #else
   60     struct selinfo selinfo;
   61 #endif
   62     struct xfs_message_header *message_buffer;
   63     int status;
   64 #define CHANNEL_OPENED  0x1
   65 #define CHANNEL_WAITING 0x2
   66     d_thread_t *proc;
   67 };
   68 
   69 extern struct xfs_channel xfs_channel[NNNPFS];
   70 
   71 /*
   72  * These are variant dependent
   73  */
   74 
   75 void xfs_select_wakeup(struct xfs_channel *);
   76 
   77 int xfs_install_device(void);
   78 int xfs_uninstall_device(void);
   79 
   80 int xfs_install_filesys(void);
   81 int xfs_may_uninstall_filesys(void);
   82 int xfs_uninstall_filesys(void);
   83 
   84 int xfs_stat_filesys(void);
   85 int xfs_stat_device(void);
   86 
   87 /*
   88  * And these should be generic
   89  */
   90 
   91 void
   92 xfs_initq(struct xfs_link *q);
   93 
   94 int
   95 xfs_emptyq(const struct xfs_link *q);
   96 
   97 int
   98 xfs_onq(const struct xfs_link *link);
   99 
  100 void
  101 xfs_appendq(struct xfs_link *q, struct xfs_link *p);
  102 
  103 void
  104 xfs_outq(struct xfs_link *p);
  105 
  106 int
  107 xfs_devopen_common(dev_t dev);
  108 
  109 #ifndef __osf__ /* XXX - we should do the same for osf */
  110 int xfs_devopen(dev_t dev, int flag, int devtype, d_thread_t *proc);
  111 int xfs_devclose(dev_t dev, int flag, int devtype, d_thread_t *proc);
  112 int xfs_devioctl(dev_t dev, u_long cmd, caddr_t data, int flags,
  113                  d_thread_t *p);
  114 #ifdef HAVE_THREE_ARGUMENT_SELRECORD
  115 int xfs_devselect(dev_t dev, int which, void *wql, d_thread_t *p);
  116 #else
  117 int xfs_devselect(dev_t dev, int which, d_thread_t *p);
  118 #endif
  119 int xfs_devpoll(dev_t dev, int events, d_thread_t *p);
  120 #endif /* ! __osf__ */
  121 
  122 int
  123 xfs_devclose_common(dev_t dev, d_thread_t *p);
  124 
  125 int
  126 xfs_devread(dev_t dev, struct uio * uiop, int ioflag);
  127 
  128 int
  129 xfs_devwrite(dev_t dev, struct uio *uiop, int ioflag);
  130 
  131 int
  132 xfs_message_send(int fd, struct xfs_message_header * message, u_int size);
  133 
  134 int
  135 xfs_message_rpc(int fd, struct xfs_message_header * message, u_int size,
  136                 d_thread_t *p);
  137 
  138 int
  139 xfs_message_receive(int fd,
  140                     struct xfs_message_header *message,
  141                     u_int size,
  142                     d_thread_t *p);
  143 
  144 int
  145 xfs_message_wakeup(int fd,
  146                    struct xfs_message_wakeup *message,
  147                    u_int size,
  148                    d_thread_t *p);
  149 
  150 int
  151 xfs_message_wakeup_data(int fd,
  152                         struct xfs_message_wakeup_data * message,
  153                         u_int size,
  154                         d_thread_t *p);
  155 
  156 int
  157 xfs_uprintf_device(void);
  158 
  159 int
  160 xfs_is_xfs_dev (dev_t dev);
  161 
  162 #endif /* _xfs_dev_h */

/* [<][>][^][v][top][bottom][index][help] */