]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/fs/ufs/UFSStoreState.h
2 * SQUID Web Proxy Cache http://www.squid-cache.org/
3 * ----------------------------------------------------------
5 * Squid is the result of efforts by numerous individuals from
6 * the Internet community; see the CONTRIBUTORS file for full
7 * details. Many organizations have provided support for Squid's
8 * development; see the SPONSORS file for full details. Squid is
9 * Copyrighted (C) 2001 by the Regents of the University of
10 * California; see the COPYRIGHT file for full details. Squid
11 * incorporates software developed and/or copyrighted by other
12 * sources; see the CREDITS file for full details.
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
30 #ifndef SQUID_FS_UFS_UFSSTORESTATE_H
31 #define SQUID_FS_UFS_UFSSTORESTATE_H
33 #include "DiskIO/IORequestor.h"
34 #include "SquidList.h"
35 #include "StoreIOState.h"
42 class UFSStoreState
: public StoreIOState
, public IORequestor
45 void * operator new (size_t);
46 void operator delete (void *);
47 UFSStoreState(SwapDir
* SD
, StoreEntry
* anEntry
, STIOCB
* callback_
, void *callback_data_
);
49 virtual void close(int how
);
50 virtual void closeCompleted();
52 virtual void ioCompletedNotification();
53 virtual void readCompleted(const char *buf
, int len
, int errflag
, RefCount
<ReadRequest
>);
54 virtual void writeCompleted(int errflag
, size_t len
, RefCount
<WriteRequest
>);
55 RefCount
<DiskFile
> theFile
;
61 void read_(char *buf
, size_t size
, off_t offset
, STRCB
* callback
, void *callback_data
);
62 void write(char const *buf
, size_t size
, off_t offset
, FREE
* free_func
);
65 virtual void doCloseCallback (int errflag
);
70 MEMPROXY_CLASS(UFSStoreState::_queued_read
);
82 MEMPROXY_CLASS(UFSStoreState::_queued_write
);
90 /** \todo These should be in the IO strategy */
95 * the write_draining flag is used to avoid recursion inside
96 * the UFSStoreState::drainWriteQueue() method.
101 * The try_closing flag is set by UFSStoreState::tryClosing()
102 * when UFSStoreState wants to close the file, but cannot
103 * because of pending I/Os. If set, UFSStoreState will
104 * try to close again in the I/O callbacks.
108 link_list
*pending_reads
;
109 link_list
*pending_writes
;
110 void queueRead(char *, size_t, off_t
, STRCB
*, void *);
111 void queueWrite(char const *, size_t, off_t
, FREE
*);
112 bool kickReadQueue();
113 void drainWriteQueue();
121 CBDATA_CLASS(UFSStoreState
);
124 MEMPROXY_CLASS_INLINE(UFSStoreState::_queued_read
);
125 MEMPROXY_CLASS_INLINE(UFSStoreState::_queued_write
);
130 #endif /* SQUID_FS_UFS_UFSSTORESTATE_H */