/*
- * $Id: DiskdFile.cc,v 1.3 2007/04/28 22:26:45 hno Exp $
+ * $Id: DiskdFile.cc,v 1.4 2007/08/16 23:32:28 hno Exp $
*
* DEBUG: section 79 Squid-side DISKD I/O functions.
* AUTHOR: Duane Wessels
ioRequestor = callback;
assert (callback.getRaw());
mode = flags;
- off_t shm_offset;
+ ssize_t shm_offset;
char *buf = (char *)IO->shm.get(&shm_offset);
xstrncpy(buf, path_, SHMBUF_BLKSZ);
ioAway();
ioRequestor = callback;
assert (callback.getRaw());
mode = flags;
- off_t shm_offset;
+ ssize_t shm_offset;
char *buf = (char *)IO->shm.get(&shm_offset);
xstrncpy(buf, path_, SHMBUF_BLKSZ);
ioAway();
DiskdFile::read(ReadRequest *aRead)
{
assert (ioRequestor.getRaw() != NULL);
- off_t shm_offset;
+ ssize_t shm_offset;
char *rbuf = (char *)IO->shm.get(&shm_offset);
assert(rbuf);
ioAway();
int x = IO->send(_MQD_READ,
id,
this,
- (int) aRead->len,
- (int) aRead->offset,
+ aRead->len,
+ aRead->offset,
shm_offset,
aRead);
DiskdFile::write(WriteRequest *aRequest)
{
debugs(79, 3, "DiskdFile::write: this " << (void *)this << ", buf " << (void *)aRequest->buf << ", off " << aRequest->offset << ", len " << aRequest->len);
- off_t shm_offset;
+ ssize_t shm_offset;
char *sbuf = (char *)IO->shm.get(&shm_offset);
xmemcpy(sbuf, aRequest->buf, aRequest->len);
int x = IO->send(_MQD_WRITE,
id,
this,
- (int) aRequest->len,
- (int) aRequest->offset,
+ aRequest->len,
+ aRequest->offset,
shm_offset,
aRequest);
/*
- * $Id: DiskdIOStrategy.cc,v 1.10 2007/04/28 22:26:45 hno Exp $
+ * $Id: DiskdIOStrategy.cc,v 1.11 2007/08/16 23:32:28 hno Exp $
*
* DEBUG: section 79 Squid-side DISKD I/O functions.
* AUTHOR: Duane Wessels
/* We can attempt a diskd unlink */
int x;
- off_t shm_offset;
+ ssize_t shm_offset;
char *buf;
* SHM manipulation routines
*/
void
-SharedMemory::put (off_t offset)
+SharedMemory::put(ssize_t offset)
{
int i;
assert(offset >= 0);
void *
-SharedMemory::get
- (off_t * shm_offset)
+SharedMemory::get(ssize_t * shm_offset)
{
char *aBuf = NULL;
int i;
}
int
-DiskdIOStrategy::send(int mtype, int id, DiskdFile *theFile, int size, int offset, off_t shm_offset, RefCountable_ *requestor)
+DiskdIOStrategy::send(int mtype, int id, DiskdFile *theFile, size_t size, off_t offset, ssize_t shm_offset, RefCountable_ *requestor)
{
diomsg M;
M.callback_data = cbdataReference(theFile);
}
int
-DiskdIOStrategy::send(int mtype, int id, StoreIOState::Pointer sio, int size, int offset, off_t shm_offset)
+DiskdIOStrategy::send(int mtype, int id, StoreIOState::Pointer sio, size_t size, off_t offset, ssize_t shm_offset)
{
diomsg M;
M.callback_data = cbdataReference(sio.getRaw());
}
int
-DiskdIOStrategy::SEND(diomsg *M, int mtype, int id, int size, int offset, off_t shm_offset)
+DiskdIOStrategy::SEND(diomsg *M, int mtype, int id, size_t size, off_t offset, ssize_t shm_offset)
{
static int send_errors = 0;
static int last_seq_no = 0;
/*
- * $Id: DiskdIOStrategy.h,v 1.3 2007/01/31 07:13:54 wessels Exp $
+ * $Id: DiskdIOStrategy.h,v 1.4 2007/08/16 23:32:28 hno Exp $
*
* DEBUG: section 79 Squid-side DISKD I/O functions.
* AUTHOR: Duane Wessels
{
public:
- void put(off_t);
+ void put(ssize_t);
- void *get
- (off_t *);
+ void *get(ssize_t *);
- void init (int ikey, int magic2);
+ void init(int ikey, int magic2);
int nbufs;
virtual void sync();
virtual int callback();
virtual void statfs(StoreEntry & sentry)const;
- int send(int mtype, int id, DiskdFile *theFile, int size, int offset, off_t shm_offset, RefCountable_ *);
+ int send(int mtype, int id, DiskdFile *theFile, size_t size, off_t offset, ssize_t shm_offset, RefCountable_ *);
/* public for accessing return address's */
SharedMemory shm;
void optionQ1Dump(StoreEntry * e) const;
bool optionQ2Parse(char const *option, const char *value, int reconfiguring);
void optionQ2Dump(StoreEntry * e) const;
- int send(int mtype, int id, RefCount<StoreIOState> sio, int size, int offset, off_t shm_offset);
- int SEND(diomsg * M, int mtype, int id, int size, int offset, off_t shm_offset);
+ int send(int mtype, int id, RefCount<StoreIOState> sio, size_t size, off_t offset, ssize_t shm_offset);
+ int SEND(diomsg * M, int mtype, int id, size_t size, off_t offset, ssize_t shm_offset);
void handle(diomsg * M);
void unlinkDone(diomsg * M);
int magic1;
int seq_no;
void * callback_data;
RefCountable_ * requestor;
- int size;
- int offset;
+ size_t size;
+ off_t offset;
int status;
bool newstyle;
int shm_offset;
/*
- * $Id: diskd.cc,v 1.7 2007/04/25 16:41:56 wessels Exp $
+ * $Id: diskd.cc,v 1.8 2007/08/16 23:32:28 hno Exp $
*
* DEBUG: section -- External DISKD process implementation.
* AUTHOR: Harvest Derived
if (r->offset > -1 && r->offset != fs->offset) {
DEBUG(2)
- fprintf(stderr, "seeking to %d\n", r->offset);
+ fprintf(stderr, "seeking to %"PRId64"\n", (int64_t)r->offset);
if (lseek(fs->fd, r->offset, SEEK_SET) < 0) {
DEBUG(1) {
- fprintf(stderr, "%d FD %d, offset %d: ", (int) mypid, fs->fd, r->offset);
+ fprintf(stderr, "%d FD %d, offset %"PRId64": ", (int) mypid, fs->fd, (int64_t)r->offset);
perror("lseek");
}
}
x = read(fs->fd, buf, readlen);
DEBUG(2)
- fprintf(stderr, "%d READ %d,%d,%d ret %d\n", (int) mypid,
- fs->fd, readlen, r->offset, x);
+ fprintf(stderr, "%d READ %d,%d,%"PRId64" ret %d\n", (int) mypid,
+ fs->fd, readlen, (int64_t)r->offset, x);
if (x < 0) {
DEBUG(1) {
if (r->offset > -1 && r->offset != fs->offset) {
if (lseek(fs->fd, r->offset, SEEK_SET) < 0) {
DEBUG(1) {
- fprintf(stderr, "%d FD %d, offset %d: ", (int) mypid, fs->fd, r->offset);
+ fprintf(stderr, "%d FD %d, offset %"PRId64": ", (int) mypid, fs->fd, (int64_t)r->offset);
perror("lseek");
}
}
}
DEBUG(2)
- fprintf(stderr, "%d WRITE %d,%d,%d\n", (int) mypid,
- fs->fd, wrtlen, r->offset);
+ fprintf(stderr, "%d WRITE %d,%d,%"PRId64"\n", (int) mypid,
+ fs->fd, wrtlen, (int64_t)r->offset);
x = write(fs->fd, buf, wrtlen);
if (x < 0) {
void squidaio_shutdown(void);
int squidaio_cancel(squidaio_result_t *);
int squidaio_open(const char *, int, mode_t, squidaio_result_t *);
-int squidaio_read(int, char *, int, off_t, int, squidaio_result_t *);
-int squidaio_write(int, char *, int, off_t, int, squidaio_result_t *);
+int squidaio_read(int, char *, size_t, off_t, int, squidaio_result_t *);
+int squidaio_write(int, char *, size_t, off_t, int, squidaio_result_t *);
int squidaio_close(int, squidaio_result_t *);
int squidaio_stat(const char *, struct stat *, squidaio_result_t *);
void aioCancel(int);
void aioOpen(const char *, int, mode_t, AIOCB *, void *);
void aioClose(int);
-void aioWrite(int, int offset, char *, int size, AIOCB *, void *, FREE *);
-void aioRead(int, int offset, int size, AIOCB *, void *);
+void aioWrite(int, off_t offset, char *, size_t size, AIOCB *, void *, FREE *);
+void aioRead(int, off_t offset, size_t size, AIOCB *, void *);
void aioStat(char *, struct stat *, AIOCB *, void *);
void aioUnlink(const char *, AIOCB *, void *);
/*
- * $Id: aiops.cc,v 1.14 2007/04/28 22:26:47 hno Exp $
+ * $Id: aiops.cc,v 1.15 2007/08/16 23:32:28 hno Exp $
*
* DEBUG: section 43 AIOPS
* AUTHOR: Stewart Forster <slf@connect.com.au>
mode_t mode;
int fd;
char *bufferp;
- int buflen;
+ size_t buflen;
off_t offset;
int whence;
int ret;
int
-squidaio_read(int fd, char *bufp, int bufs, off_t offset, int whence, squidaio_result_t * resultp)
+squidaio_read(int fd, char *bufp, size_t bufs, off_t offset, int whence, squidaio_result_t * resultp)
{
squidaio_request_t *requestp;
int
-squidaio_write(int fd, char *bufp, int bufs, off_t offset, int whence, squidaio_result_t * resultp)
+squidaio_write(int fd, char *bufp, size_t bufs, off_t offset, int whence, squidaio_result_t * resultp)
{
squidaio_request_t *requestp;
/*
- * $Id: aiops_win32.cc,v 1.4 2007/04/28 22:26:47 hno Exp $
+ * $Id: aiops_win32.cc,v 1.5 2007/08/16 23:32:28 hno Exp $
*
* DEBUG: section 43 Windows AIOPS
* AUTHOR: Stewart Forster <slf@connect.com.au>
int fd;
char *bufferp;
char *tmpbufp;
- int buflen;
+ size_t buflen;
off_t offset;
int whence;
int ret;
int
-squidaio_read(int fd, char *bufp, int bufs, off_t offset, int whence, squidaio_result_t * resultp)
+squidaio_read(int fd, char *bufp, size_t bufs, off_t offset, int whence, squidaio_result_t * resultp)
{
squidaio_request_t *requestp;
int
-squidaio_write(int fd, char *bufp, int bufs, off_t offset, int whence, squidaio_result_t * resultp)
+squidaio_write(int fd, char *bufp, size_t bufs, off_t offset, int whence, squidaio_result_t * resultp)
{
squidaio_request_t *requestp;
/*
- * $Id: async_io.cc,v 1.4 2007/04/28 22:26:47 hno Exp $
+ * $Id: async_io.cc,v 1.5 2007/08/16 23:32:28 hno Exp $
*
* DEBUG: section 32 Asynchronous Disk I/O
* AUTHOR: Pete Bentley <pete@demon.net>
void
-aioWrite(int fd, int offset, char *bufp, int len, AIOCB * callback, void *callback_data, FREE * free_func)
+aioWrite(int fd, off_t offset, char *bufp, size_t len, AIOCB * callback, void *callback_data, FREE * free_func)
{
squidaio_ctrl_t *ctrlp;
int seekmode;
void
-aioRead(int fd, int offset, int len, AIOCB * callback, void *callback_data)
+aioRead(int fd, off_t offset, size_t len, AIOCB * callback, void *callback_data)
{
squidaio_ctrl_t *ctrlp;
int seekmode;