~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to src/fs/coss/store_coss.h

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2010-05-04 11:15:49 UTC
  • mfrom: (1.3.1 upstream)
  • mto: (20.3.1 squeeze) (21.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20100504111549-1apjh2g5sndki4te
Tags: upstream-3.1.3
ImportĀ upstreamĀ versionĀ 3.1.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#error COSS Support is not stable in 3.0. Please do not use.
2
1
#ifndef __COSS_H__
3
2
#define __COSS_H__
4
3
 
8
7
#define COSS_MEMBUF_SZ  1048576
9
8
#endif
10
9
 
11
 
/* Note that swap_filen in sio/e are actually disk offsets too! */
 
10
/** \note  swap_filen in sio/e are actually disk offsets too! */
12
11
 
13
 
/* What we're doing in storeCossAllocate() */
 
12
/** What we're doing in storeCossAllocate() */
14
13
#define COSS_ALLOC_NOTIFY               0
 
14
 
 
15
/** What we're doing in storeCossAllocate() */
15
16
#define COSS_ALLOC_ALLOCATE             1
 
17
 
 
18
/** What we're doing in storeCossAllocate() */
16
19
#define COSS_ALLOC_REALLOC              2
17
20
 
18
21
class CossSwapDir;
19
22
 
 
23
/// \ingroup COSS
20
24
class CossMemBuf
21
25
{
22
26
 
31
35
    int lockcount;
32
36
    char buffer[COSS_MEMBUF_SZ];
33
37
 
34
 
    struct _cossmembuf_flags
35
 
    {
 
38
    struct _cossmembuf_flags {
36
39
        unsigned int full:1;
37
40
        unsigned int writing:1;
38
41
    } flags;
39
42
};
40
43
 
41
 
struct _cossindex
42
 
{
43
 
    /* Note: the dlink_node MUST be the first member of the structure.
44
 
     * This member is later pointer typecasted to coss_index_node *.
 
44
/// \ingroup COSS
 
45
struct _cossindex {
 
46
    /**
 
47
     \note The dlink_node MUST be the first member of the structure.
 
48
     *     This member is later pointer typecasted to coss_index_node *.
45
49
     */
46
50
    dlink_node node;
47
51
};
48
52
 
49
53
 
50
54
 
51
 
/* Per-storeiostate info */
52
 
 
 
55
/**
 
56
 \ingroup COSS
 
57
 * Per-storeiostate info
 
58
 */
53
59
class CossState : public StoreIOState
54
60
{
55
61
 
64
70
    size_t requestoffset;       /* in blocks */
65
71
    int64_t reqdiskoffset;      /* in blocks */
66
72
 
67
 
    struct
68
 
    {
69
 
 
70
 
unsigned int reading:
71
 
        1;
72
 
 
73
 
unsigned int writing:
74
 
        1;
75
 
    }
76
 
 
77
 
    flags;
 
73
    struct {
 
74
        unsigned int reading:1;
 
75
        unsigned int writing:1;
 
76
    } flags;
78
77
 
79
78
    CossMemBuf *locked_membuf;
80
79
    off_t st_size;
87
86
    CossSwapDir *SD;
88
87
};
89
88
 
90
 
MEMPROXY_CLASS_INLINE(CossState)
 
89
MEMPROXY_CLASS_INLINE(CossState);
91
90
 
 
91
/// \ingroup COSS
92
92
typedef struct _cossindex CossIndexNode;
93
93
 
94
 
/* Whether the coss system has been setup or not */
 
94
 
 
95
/**
 
96
 \ingroup COSS
 
97
 * Whether the coss system has been setup or not
 
98
 */
95
99
extern int coss_initialised;
 
100
/// \ingroup COSS
96
101
extern MemAllocator *coss_membuf_pool;
 
102
/// \ingroup COSS
97
103
extern MemAllocator *coss_index_pool;
98
104
 
99
105
#include "DiskIO/ReadRequest.h"
100
106
 
 
107
/// \ingroup COSS
101
108
class CossRead : public ReadRequest
102
109
{
103
110
 
114
121
 
115
122
#include "DiskIO/WriteRequest.h"
116
123
 
 
124
/// \ingroup COSS
117
125
class CossWrite : public WriteRequest
118
126
{
119
127