]>
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 UFSStoreState(SwapDir
* SD
, StoreEntry
* anEntry
, STIOCB
* callback_
, void *callback_data_
);
47 virtual void close(int how
);
48 virtual void closeCompleted();
50 virtual void ioCompletedNotification();
51 virtual void readCompleted(const char *buf
, int len
, int errflag
, RefCount
<ReadRequest
>);
52 virtual void writeCompleted(int errflag
, size_t len
, RefCount
<WriteRequest
>);
53 RefCount
<DiskFile
> theFile
;
59 void read_(char *buf
, size_t size
, off_t offset
, STRCB
* callback
, void *callback_data
);
60 void write(char const *buf
, size_t size
, off_t offset
, FREE
* free_func
);
63 virtual void doCloseCallback (int errflag
);
68 MEMPROXY_CLASS(UFSStoreState::_queued_read
);
80 MEMPROXY_CLASS(UFSStoreState::_queued_write
);
88 /** \todo These should be in the IO strategy */
93 * the write_draining flag is used to avoid recursion inside
94 * the UFSStoreState::drainWriteQueue() method.
99 * The try_closing flag is set by UFSStoreState::tryClosing()
100 * when UFSStoreState wants to close the file, but cannot
101 * because of pending I/Os. If set, UFSStoreState will
102 * try to close again in the I/O callbacks.
106 link_list
*pending_reads
;
107 link_list
*pending_writes
;
108 void queueRead(char *, size_t, off_t
, STRCB
*, void *);
109 void queueWrite(char const *, size_t, off_t
, FREE
*);
110 bool kickReadQueue();
111 void drainWriteQueue();
119 CBDATA_CLASS2(UFSStoreState
);
122 MEMPROXY_CLASS_INLINE(UFSStoreState::_queued_read
);
123 MEMPROXY_CLASS_INLINE(UFSStoreState::_queued_write
);
128 #endif /* SQUID_FS_UFS_UFSSTORESTATE_H */