2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 /* DEBUG: section 79 Squid-side DISKD I/O functions. */
11 #ifndef __STORE_DISKDIOSTRATEGY_H__
12 #define __STORE_DISKDIOSTRATEGY_H__
25 void init(int ikey
, int magic2
);
36 #include "DiskIO/DiskIOStrategy.h"
37 #include "StoreIOState.h"
46 class DiskdIOStrategy
: public DiskIOStrategy
51 virtual bool shedLoad();
53 virtual RefCount
<DiskFile
> newFile(char const *path
);
54 virtual bool unlinkdUseful() const;
55 virtual void unlinkFile (char const *);
56 virtual ConfigOption
*getOptionTree() const;
59 virtual int callback();
60 virtual void statfs(StoreEntry
& sentry
) const;
61 int send(int mtype
, int id
, DiskdFile
*theFile
, size_t size
, off_t offset
, ssize_t shm_offset
, Lock
*requestor
);
63 /** public for accessing return address's */
67 static size_t newInstance();
68 static size_t nextInstanceID
;
70 bool optionQ1Parse(char const *option
, const char *value
, int reconfiguring
);
71 void optionQ1Dump(StoreEntry
* e
) const;
72 bool optionQ2Parse(char const *option
, const char *value
, int reconfiguring
);
73 void optionQ2Dump(StoreEntry
* e
) const;
74 int send(int mtype
, int id
, RefCount
<StoreIOState
> sio
, size_t size
, off_t offset
, ssize_t shm_offset
);
75 int SEND(diomsg
* M
, int mtype
, int id
, size_t size
, off_t offset
, ssize_t shm_offset
);
76 void handle(diomsg
* M
);
77 void unlinkDone(diomsg
* M
);
80 * magic1 is the number of messages away which we
81 * stop allowing open/create for.
86 * magic2 is the point at which we start blocking on msgsnd/msgrcv.
87 * If a queue has magic2 (or more) messages away, then we read the
88 * queue until the level falls below magic2. Recommended value
101 #define SHMBUF_BLKSZ SM_PAGE_SIZE
104 struct diskd_stats_t
{
105 int open_fail_queue_len
;
120 open
, create
, close
, unlink
, read
, write
;
124 extern diskd_stats_t diskd_stats
;