|
Squid Web Cache master
|
#include "squid.h"#include "comm/Loops.h"#include "compat/unistd.h"#include "fd.h"#include "fde.h"#include "fs_io.h"#include "globals.h"#include "MemBuf.h"#include "StatCounters.h"#include <cerrno>Go to the source code of this file.
Macros | |
| #define | fsbtoblk(num, fsbs, bs) |
Functions | |
| static void | cxx_xfree (void *ptr) |
| int | file_open (const char *path, int mode) |
| void | file_close (int fd) |
| static void | diskCombineWrites (_fde_disk *fdd) |
| static void | diskHandleWrite (int fd, void *) |
| void | file_write (int fd, off_t file_offset, void const *ptr_to_buf, int len, DWCB *handle, void *handle_data, FREE *free_func) |
| static void | diskHandleRead (int fd, void *data) |
| void | file_read (int fd, char *buf, int req_len, off_t offset, DRCB *handler, void *client_data) |
| void | safeunlink (const char *s, int quiet) |
| bool | FileRename (const SBuf &from, const SBuf &to) |
| int | fsBlockSize (const char *path, int *blksize) |
| int | fsStats (const char *path, int *totl_kb, int *free_kb, int *totl_in, int *free_in) |
Variables | |
| static PF | diskHandleRead |
| static PF | diskHandleWrite |
| #define fsbtoblk | ( | num, | |
| fsbs, | |||
| bs | |||
| ) |
|
static |
Definition at line 36 of file fs_io.cc.
References xfree.
Referenced by dwrite_q::dwrite_q(), and memFreeBufFunc().
|
static |
Definition at line 146 of file fs_io.cc.
References dwrite_q::next, _fde_disk::write_q, and _fde_disk::write_q_tail.
Referenced by diskHandleWrite().
|
static |
Definition at line 352 of file fs_io.cc.
References dread_ctrl::buf, cbdataReferenceDone, cbdataReferenceValid(), dread_ctrl::client_data, COMM_SELECT_READ, DBG_IMPORTANT, debugs, fde::disk, StatCounters::disk, DISK_EOF, DISK_ERROR, DISK_OK, diskHandleRead, fd_bytes(), FD_READ_METHOD(), fd_table, dread_ctrl::handler, ignoreErrno(), _fde_disk::offset, dread_ctrl::offset, Read, StatCounters::reads, dread_ctrl::req_len, StatCounters::seeks, Comm::SetSelect(), statCounter, StatCounters::syscalls, and xstrerr().
|
static |
Definition at line 177 of file fs_io.cc.
References assert, dwrite_q::buf, dwrite_q::buf_offset, cbdataReferenceValidDone, fde::_fde_flags::close_request, COMM_SELECT_WRITE, DBG_IMPORTANT, debugs, fde::disk, StatCounters::disk, DISK_ERROR, DISK_NO_SPACE_LEFT, DISK_OK, diskCombineWrites(), diskHandleWrite, do_close(), fatal(), fd_bytes(), fd_table, FD_WRITE_METHOD(), file_close(), dwrite_q::file_offset, fde::flags, ignoreErrno(), dwrite_q::len, dwrite_q::next, Comm::SetSelect(), statCounter, StatCounters::syscalls, Write, fde::_fde_flags::write_daemon, _fde_disk::write_q, _fde_disk::write_q_tail, StatCounters::writes, _fde_disk::wrt_handle, _fde_disk::wrt_handle_data, and xstrerr().
| void file_close | ( | int | fd | ) |
Definition at line 92 of file fs_io.cc.
References assert, fde::_fde_flags::close_request, StatCounters::closes, debugs, StatCounters::disk, diskHandleWrite, fd_close(), fd_table, fde::flags, fde::_fde_flags::open, fde::read_data, fde::read_handler, statCounter, StatCounters::syscalls, fde::_fde_flags::write_daemon, fde::write_handler, and xclose().
Referenced by Rock::Rebuild::~Rebuild(), Fs::Ufs::UFSSwapDir::~UFSSwapDir(), Fs::Ufs::UFSSwapDir::closeLog(), Fs::Ufs::UFSSwapDir::closeTmpSwapLog(), DiskerClose(), diskHandleWrite(), BlockingFile::doClose(), DiskThreadsDiskFile::doClose(), MmappedFile::doClose(), MimeIcon::load(), TemplateFile::loadFromFile(), logfile_mod_stdio_close(), logfile_mod_stdio_rotate(), logfile_mod_udp_close(), netdbReloadState(), Fs::Ufs::UFSSwapDir::openTmpSwapLog(), Fs::Ufs::RebuildState::rebuildFromDirectory(), UFSCleanLog::write(), and Fs::Ufs::UFSSwapDir::writeCleanDone().
Definition at line 66 of file fs_io.cc.
References commSetCloseOnExec(), debugs, StatCounters::disk, DISK_ERROR, FD_FILE, fd_open(), FILE_MODE, StatCounters::opens, statCounter, StatCounters::syscalls, xopen(), and xstrerr().
Referenced by Fs::Ufs::UFSSwapDir::closeTmpSwapLog(), DiskThreadsDiskFile::create(), DiskerOpen(), Fs::Ufs::RebuildState::getNextFile(), MimeIcon::load(), TemplateFile::loadFromFile(), logfile_mod_stdio_open(), logfile_mod_stdio_rotate(), netdbReloadState(), BlockingFile::open(), DiskThreadsDiskFile::open(), MmappedFile::open(), Fs::Ufs::UFSSwapDir::openLog(), Fs::Ufs::UFSSwapDir::openTmpSwapLog(), Rock::Rebuild::start(), Fs::Ufs::UFSSwapDir::writeCleanDone(), and Fs::Ufs::UFSSwapDir::writeCleanStart().
| void file_read | ( | int | fd, |
| char * | buf, | ||
| int | req_len, | ||
| off_t | offset, | ||
| DRCB * | handler, | ||
| void * | client_data | ||
| ) |
Definition at line 424 of file fs_io.cc.
References assert, cbdataReference, and diskHandleRead.
Referenced by BlockingFile::read(), and DiskThreadsDiskFile::read().
| 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 at line 313 of file fs_io.cc.
References assert, cbdataReference, fde::disk, diskHandleWrite, fd_table, fde::flags, dwrite_q::next, fde::_fde_flags::open, fde::_fde_flags::write_daemon, _fde_disk::write_q, _fde_disk::write_q_tail, _fde_disk::wrt_handle, and _fde_disk::wrt_handle_data.
Referenced by Fs::Ufs::UFSSwapDir::logEntry(), Fs::Ufs::UFSSwapDir::openTmpSwapLog(), BlockingFile::write(), and DiskThreadsDiskFile::write().
Definition at line 443 of file fs_io.cc.
References SBuf::c_str(), DBG_IMPORTANT, debugs, SBuf::length(), SBuf::rawContent(), and xstrerr().
Referenced by Fs::Ufs::UFSSwapDir::closeTmpSwapLog(), logfile_mod_stdio_rotate(), and Fs::Ufs::UFSSwapDir::writeCleanDone().
Definition at line 466 of file fs_io.cc.
References DBG_IMPORTANT, debugs, statvfs::f_frsize, int, xstatvfs(), and xstrerr().
Referenced by Fs::Ufs::UFSSwapDir::init().
Definition at line 490 of file fs_io.cc.
References DBG_IMPORTANT, debugs, statvfs::f_bfree, statvfs::f_blocks, statvfs::f_ffree, statvfs::f_files, statvfs::f_frsize, fsbtoblk, int, xstatvfs(), and xstrerr().
Referenced by Fs::Ufs::UFSSwapDir::statfs().
| void safeunlink | ( | const char * | s, |
| int | quiet | ||
| ) |
Definition at line 432 of file fs_io.cc.
References DBG_IMPORTANT, debugs, StatCounters::disk, statCounter, StatCounters::syscalls, StatCounters::unlinks, and xstrerr().
Referenced by Fs::Ufs::UFSSwapDir::DirClean(), Fs::Ufs::UFSSwapDir::openTmpSwapLog(), RemoveInstance(), and unlinkdUnlink().
|
static |
Definition at line 23 of file fs_io.cc.
Referenced by diskHandleRead(), and file_read().
|
static |
Definition at line 24 of file fs_io.cc.
Referenced by diskHandleWrite(), file_close(), and file_write().