]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/DiskIO/DiskThreads/DiskThreadsDiskFile.h
3 * $Id: DiskThreadsDiskFile.h,v 1.2 2006/08/21 00:50:45 robertc Exp $
5 * DEBUG: section 79 Disk IO Routines
6 * AUTHOR: Robert Collins
8 * SQUID Web Proxy Cache http://www.squid-cache.org/
9 * ----------------------------------------------------------
11 * Squid is the result of efforts by numerous individuals from
12 * the Internet community; see the CONTRIBUTORS file for full
13 * details. Many organizations have provided support for Squid's
14 * development; see the SPONSORS file for full details. Squid is
15 * Copyrighted (C) 2001 by the Regents of the University of
16 * California; see the COPYRIGHT file for full details. Squid
17 * incorporates software developed and/or copyrighted by other
18 * sources; see the CREDITS file for full details.
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2 of the License, or
23 * (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
34 * Copyright (c) 2003, Robert Collins <robertc@squid-cache.org>
37 #ifndef SQUID_DISKTHREADSDISKFILE_H
38 #define SQUID_DISKTHREADSDISKFILE_H
40 #include "DiskIO/DiskFile.h"
41 #include "DiskThreads.h"
43 class DiskThreadsDiskFile
: public DiskFile
47 void * operator new (size_t);
48 void operator delete (void *);
49 DiskThreadsDiskFile (char const *path
, DiskThreadsIOStrategy
*);
50 ~DiskThreadsDiskFile();
51 virtual void open (int, mode_t
, RefCount
<IORequestor
>);
52 virtual void create (int, mode_t
, RefCount
<IORequestor
>);
53 virtual void read(ReadRequest
*);
54 virtual void write(WriteRequest
*);
55 virtual void close ();
56 virtual bool error() const;
57 virtual int getFD() const { return fd
;}
59 virtual bool canRead() const;
60 virtual bool canWrite() const;
61 virtual bool ioInProgress()const;
66 static AIOCB ReadDone
;
73 static AIOCB WriteDone
;
76 static DWCB WriteDone
;
82 DiskThreadsIOStrategy
*IO
;
84 static AIOCB OpenDone
;
85 void openDone(int fd
, const char *buf
, int aio_return
, int aio_errno
);
86 RefCount
<IORequestor
> ioRequestor
;
87 CBDATA_CLASS(DiskThreadsDiskFile
);
90 void readDone(int fd
, const char *buf
, int len
, int errflag
, RefCount
<ReadRequest
>);
91 void writeDone (int fd
, int errflag
, size_t len
, RefCount
<WriteRequest
>);
94 #include "DiskIO/ReadRequest.h"
102 void * operator new (size_t);
103 void operator delete (void *);
104 IoResult(RefCount
<DiskThreadsDiskFile
> aFile
, RefCount
<RT
> aRequest
) : file(aFile
), request(aRequest
){}
106 RefCount
<DiskThreadsDiskFile
> file
;
107 RefCount
<RT
> request
;
110 CBDATA_CLASS(IoResult
);
115 IOResult(RefCount
<RT
> aRequest
, RefCount
<DiskThreadsDiskFile
> aFile
) { return IoResult
<RT
>(aFile
, aRequest
);}
117 #endif /* SQUID_DISKTHREADSDISKFILE_H */