fs_io.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2018 The Squid Software Foundation and contributors
3  *
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.
7  */
8 
9 /* DEBUG: section 06 Disk I/O Routines */
10 
11 #ifndef SQUID_FS_IO_H_
12 #define SQUID_FS_IO_H_
13 
14 #include "mem/forward.h"
15 #include "sbuf/forward.h"
16 #include "typedefs.h" //DRCB, DWCB
17 
18 class MemBuf;
19 
20 // POD
22 {
23 public:
24  int fd;
25  off_t offset;
26  int req_len;
27  char *buf;
30  void *client_data;
31 };
32 
33 // POD
34 class dwrite_q
35 {
36 public:
37  off_t file_offset;
38  char *buf;
39  size_t len;
40  size_t buf_offset;
43 };
44 
45 int file_open(const char *path, int mode);
46 void file_close(int fd);
47 void file_write(int, off_t, void const *, int len, DWCB *, void *, FREE *);
48 void file_write_mbuf(int fd, off_t, MemBuf mb, DWCB * handler, void *handler_data);
49 void file_read(int, char *, int, off_t, DRCB *, void *);
50 void safeunlink(const char *path, int quiet);
51 
52 /*
53  * Wrapper for rename(2) which complains if something goes wrong;
54  * the caller is responsible for handing and explaining the
55  * consequences of errors.
56  *
57  * \retval true successful rename
58  * \retval false an error occured
59  */
60 bool FileRename(const SBuf &from, const SBuf &to);
61 
62 int fsBlockSize(const char *path, int *blksize);
63 int fsStats(const char *, int *, int *, int *, int *);
64 
65 #endif /* SQUID_FS_IO_H_ */
66 
int end_of_file
Definition: fs_io.h:28
size_t buf_offset
Definition: fs_io.h:40
void safeunlink(const char *s, int quiet)
Definition: fs_io.cc:497
off_t file_offset
Definition: fs_io.h:37
Definition: SBuf.h:86
off_t offset
Definition: fs_io.h:25
int file_open(const char *path, int mode)
Definition: fs_io.cc:46
void DWCB(int, int, size_t, void *)
Definition: typedefs.h:18
void FREE(void *)
Definition: forward.h:36
Definition: fs_io.h:34
char * buf
Definition: fs_io.h:38
void file_write(int fd, off_t file_offset, void const *ptr_to_buf, int len, DWCB *handle, void *handle_data, FREE *free_func)
Definition: fs_io.cc:344
int fsBlockSize(const char *path, int *blksize)
Definition: fs_io.cc:531
void file_write_mbuf(int fd, off_t off, MemBuf mb, DWCB *handler, void *handler_data)
Definition: fs_io.cc:395
char * buf
Definition: fs_io.h:27
size_t len
Definition: fs_io.h:39
FREE * free_func
Definition: fs_io.h:42
bool FileRename(const SBuf &from, const SBuf &to)
Definition: fs_io.cc:508
static void handler(int signo)
Definition: purge.cc:860
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
void DRCB(int, const char *buf, int size, int errflag, void *data)
Definition: typedefs.h:16
int req_len
Definition: fs_io.h:26
void * client_data
Definition: fs_io.h:30
int fsStats(const char *path, int *totl_kb, int *free_kb, int *totl_in, int *free_in)
Definition: fs_io.cc:555
int fd
Definition: fs_io.h:24
Definition: MemBuf.h:23
DRCB * handler
Definition: fs_io.h:29
dwrite_q * next
Definition: fs_io.h:41
void file_close(int fd)
Definition: fs_io.cc:76
void file_read(int fd, char *buf, int req_len, off_t offset, DRCB *handler, void *client_data)
Definition: fs_io.cc:479

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors