The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/geom/raid/g_raid_tr_if.m

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #-
    2 # Copyright (c) 2010 Alexander Motin
    3 # All rights reserved.
    4 #
    5 # Redistribution and use in source and binary forms, with or without
    6 # modification, are permitted provided that the following conditions
    7 # are met:
    8 #
    9 # 1. Redistributions of source code must retain the above copyright
   10 #    notice, this list of conditions and the following disclaimer.
   11 # 2. Redistributions in binary form must reproduce the above copyright
   12 #    notice, this list of conditions and the following disclaimer in the
   13 #    documentation and/or other materials provided with the distribution.
   14 #
   15 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   16 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   17 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   18 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   19 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   20 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   21 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   22 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   23 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   24 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   25 #
   26 # $FreeBSD: releng/10.4/sys/geom/raid/g_raid_tr_if.m 219974 2011-03-24 21:31:32Z mav $
   27 
   28 #include <sys/param.h>
   29 #include <sys/lock.h>
   30 #include <sys/malloc.h>
   31 #include <sys/mutex.h>
   32 #include <sys/sbuf.h>
   33 #include <sys/bus.h>
   34 #include <machine/bus.h>
   35 #include <sys/systm.h>
   36 #include <geom/geom.h>
   37 #include <geom/raid/g_raid.h>
   38 
   39 # The G_RAID transformation class interface.
   40 
   41 INTERFACE g_raid_tr;
   42 
   43 # Default implementations of methods.
   44 CODE {
   45         static int
   46         g_raid_tr_locked_default(struct g_raid_tr_object *tr, void *argp)
   47         {
   48 
   49                 return (0);
   50         }
   51 };
   52 
   53 HEADER {
   54 #define G_RAID_TR_TASTE_FAIL            -1
   55 #define G_RAID_TR_TASTE_SUCCEED          0
   56 };
   57 
   58 # taste() - volume taste method.
   59 METHOD int taste {
   60         struct g_raid_tr_object *tr;
   61         struct g_raid_volume *volume;
   62 };
   63 
   64 # event() - events handling method.
   65 METHOD int event {
   66         struct g_raid_tr_object *tr;
   67         struct g_raid_subdisk *sd;
   68         u_int event;
   69 };
   70 
   71 # start() - begin operation.
   72 METHOD int start {
   73         struct g_raid_tr_object *tr;
   74 };
   75 
   76 # stop() - stop operation.
   77 METHOD int stop {
   78         struct g_raid_tr_object *tr;
   79 };
   80 
   81 # iorequest() - manage forward transformation and generates requests to disks.
   82 METHOD void iostart {
   83         struct g_raid_tr_object *tr;
   84         struct bio *bp;
   85 };
   86 
   87 # iodone() - manages backward transformation and reports completion status.
   88 METHOD void iodone {
   89         struct g_raid_tr_object *tr;
   90         struct g_raid_subdisk *sd;
   91         struct bio *bp;
   92 };
   93 
   94 # kerneldump() - optimized for rebustness (simplified) kernel dumping routine.
   95 METHOD int kerneldump {
   96         struct g_raid_tr_object *tr;
   97         void *virtual;
   98         vm_offset_t physical;
   99         off_t offset;
  100         size_t length;
  101 } DEFAULT g_raid_tr_kerneldump_common;
  102 
  103 # locked() - callback method for lock().
  104 METHOD int locked {
  105         struct g_raid_tr_object *tr;
  106         void *argp;
  107 } DEFAULT g_raid_tr_locked_default;
  108 
  109 # free() - destructor.
  110 METHOD int free {
  111         struct g_raid_tr_object *tr;
  112 };
  113 
  114 # idle() - callback when the volume is idle for a while and the TR wants
  115 # to schedule some work for that idle period.
  116 METHOD int idle {
  117         struct g_raid_tr_object *tr;
  118 };

Cache object: 5abdb9ee4c8bc46256d13848eb131090


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.