]>
Commit | Line | Data |
---|---|---|
59b2d47f | 1 | /* |
4ac4a490 | 2 | * Copyright (C) 1996-2017 The Squid Software Foundation and contributors |
59b2d47f | 3 | * |
bbc27441 AJ |
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. | |
59b2d47f | 7 | */ |
8 | ||
d9691f09 AJ |
9 | #ifndef SQUID_SRC_DISKIO_AIO_AIODISKIOSTRATEGY_H |
10 | #define SQUID_SRC_DISKIO_AIO_AIODISKIOSTRATEGY_H | |
59b2d47f | 11 | |
d9691f09 | 12 | #if HAVE_DISKIO_MODULE_AIO |
2513178d | 13 | |
d9691f09 | 14 | #include "DiskIO/AIO/async_io.h" |
602d9612 | 15 | #include "DiskIO/DiskIOStrategy.h" |
59b2d47f | 16 | |
b9ae18aa | 17 | class AIODiskIOStrategy : public DiskIOStrategy |
59b2d47f | 18 | { |
19 | ||
20 | public: | |
b9ae18aa | 21 | AIODiskIOStrategy(); |
22 | virtual ~AIODiskIOStrategy(); | |
59b2d47f | 23 | |
b9ae18aa | 24 | virtual bool shedLoad(); |
25 | /* What is the current load? 999 = 99.9% */ | |
26 | virtual int load(); | |
27 | /* Return a handle for performing IO operations */ | |
28 | virtual RefCount<DiskFile> newFile (char const *path); | |
29 | /* flush all IO operations */ | |
30 | virtual void sync(); | |
c521ad17 DK |
31 | /** whether the IO Strategy can use unlinkd */ |
32 | virtual bool unlinkdUseful() const; | |
b9ae18aa | 33 | /* unlink a file by path */ |
34 | virtual void unlinkFile (char const *); | |
35 | ||
36 | /* perform any pending callbacks */ | |
37 | virtual int callback(); | |
59b2d47f | 38 | |
b9ae18aa | 39 | /* Init per-instance logic */ |
40 | virtual void init(); | |
41 | ||
42 | /* cachemgr output on the IO instance stats */ | |
43 | virtual void statfs(StoreEntry & sentry)const; | |
44 | /* module specific options */ | |
45 | virtual ConfigOption *getOptionTree() const; | |
46 | /* a file descriptor */ | |
47 | int fd; | |
48 | /* queue of requests */ | |
49 | async_queue_t aq; | |
50 | ||
51 | int findSlot(); | |
52 | }; | |
59b2d47f | 53 | |
d9691f09 AJ |
54 | #endif /* HAVE_DISKIO_MODULE_AIO */ |
55 | #endif /* SQUID_SRC_DISKIO_AIO_AIODISKIOSTRATEGY_H */ | |
f53969cc | 56 |