OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [LINUX_2_4_26_OR32/] [linux/] [linux-2.4/] [include/] [linux/] [raid/] [multipath.h] - Blame information for rev 1279

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
#ifndef _MULTIPATH_H
2
#define _MULTIPATH_H
3
 
4
#include <linux/raid/md.h>
5
 
6
struct multipath_info {
7
        int             number;
8
        int             raid_disk;
9
        kdev_t          dev;
10
 
11
        /*
12
         * State bits:
13
         */
14
        int             operational;
15
        int             spare;
16
 
17
        int             used_slot;
18
};
19
 
20
struct multipath_private_data {
21
        mddev_t                 *mddev;
22
        struct multipath_info   multipaths[MD_SB_DISKS];
23
        int                     nr_disks;
24
        int                     raid_disks;
25
        int                     working_disks;
26
        mdk_thread_t            *thread;
27
        struct multipath_info   *spare;
28
        md_spinlock_t           device_lock;
29
 
30
        /* buffer pool */
31
        /* buffer_heads that we have pre-allocated have b_pprev -> &freebh
32
         * and are linked into a stack using b_next
33
         * multipath_bh that are pre-allocated have MPBH_PreAlloc set.
34
         * All these variable are protected by device_lock
35
         */
36
        struct multipath_bh     *freer1;
37
        int                     freer1_blocked;
38
        int                     freer1_cnt;
39
        md_wait_queue_head_t    wait_buffer;
40
};
41
 
42
typedef struct multipath_private_data multipath_conf_t;
43
 
44
/*
45
 * this is the only point in the RAID code where we violate
46
 * C type safety. mddev->private is an 'opaque' pointer.
47
 */
48
#define mddev_to_conf(mddev) ((multipath_conf_t *) mddev->private)
49
 
50
/*
51
 * this is our 'private' 'collective' MULTIPATH buffer head.
52
 * it contains information about what kind of IO operations were started
53
 * for this MULTIPATH operation, and about their status:
54
 */
55
 
56
struct multipath_bh {
57
        atomic_t                remaining; /* 'have we finished' count,
58
                                            * used from IRQ handlers
59
                                            */
60
        int                     cmd;
61
        unsigned long           state;
62
        mddev_t                 *mddev;
63
        struct buffer_head      *master_bh;
64
        struct buffer_head      bh_req;
65
        struct multipath_bh     *next_mp; /* next for retry or in free list */
66
};
67
/* bits for multipath_bh.state */
68
#define MPBH_Uptodate   1
69
#define MPBH_SyncPhase  2
70
#define MPBH_PreAlloc   3       /* this was pre-allocated, add to free list */
71
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.