#include "squid.h"
#include "comm/Loops.h"
#include "fd.h"
#include "fde.h"
#include "fs_io.h"
#include "globals.h"
#include "MemBuf.h"
#include "StatCounters.h"
#include <cerrno>
![](fs__io_8cc__incl.png)
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 |
Macro Definition Documentation
◆ fsbtoblk
#define fsbtoblk | ( | num, | |
fsbs, | |||
bs | |||
) |
Function Documentation
◆ cxx_xfree()
|
static |
◆ diskCombineWrites()
|
static |
Definition at line 147 of file fs_io.cc.
References dwrite_q::next, _fde_disk::write_q, and _fde_disk::write_q_tail.
Referenced by diskHandleWrite().
◆ diskHandleRead()
|
static |
Definition at line 353 of file fs_io.cc.
References dread_ctrl::buf, cbdataReferenceDone, cbdataReferenceValid(), dread_ctrl::client_data, COMM_SELECT_READ, DBG_IMPORTANT, debugs, StatCounters::disk, DISK_EOF, DISK_ERROR, DISK_OK, diskHandleRead, F(), fd_bytes(), FD_READ_METHOD(), fd_table, dread_ctrl::handler, ignoreErrno(), dread_ctrl::offset, Read, dread_ctrl::req_len, Comm::SetSelect(), statCounter, StatCounters::syscalls, and xstrerr().
◆ diskHandleWrite()
|
static |
Definition at line 178 of file fs_io.cc.
References assert, dwrite_q::buf, dwrite_q::buf_offset, cbdataReferenceValidDone, COMM_SELECT_WRITE, DBG_IMPORTANT, debugs, StatCounters::disk, DISK_ERROR, DISK_NO_SPACE_LEFT, DISK_OK, diskCombineWrites(), diskHandleWrite, do_close(), F(), fatal(), fd_bytes(), fd_table, FD_WRITE_METHOD(), file_close(), dwrite_q::file_offset, ignoreErrno(), dwrite_q::len, dwrite_q::next, Comm::SetSelect(), statCounter, StatCounters::syscalls, Write, _fde_disk::write_q, _fde_disk::write_q_tail, _fde_disk::wrt_handle, _fde_disk::wrt_handle_data, and xstrerr().
◆ file_close()
void file_close | ( | int | fd | ) |
Definition at line 93 of file fs_io.cc.
References assert, debugs, StatCounters::disk, diskHandleWrite, F(), fd_close(), fd_table, statCounter, and StatCounters::syscalls.
Referenced by Fs::Ufs::UFSSwapDir::closeLog(), Fs::Ufs::UFSSwapDir::closeTmpSwapLog(), DiskerClose(), diskHandleWrite(), MmappedFile::doClose(), BlockingFile::doClose(), DiskThreadsDiskFile::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(), Fs::Ufs::UFSSwapDir::writeCleanDone(), Rock::Rebuild::~Rebuild(), and Fs::Ufs::UFSSwapDir::~UFSSwapDir().
◆ file_open()
Definition at line 65 of file fs_io.cc.
References commSetCloseOnExec(), debugs, StatCounters::disk, DISK_ERROR, FD_FILE, fd_open(), FILE_MODE, statCounter, StatCounters::syscalls, 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(), MmappedFile::open(), DiskThreadsDiskFile::open(), BlockingFile::open(), Fs::Ufs::UFSSwapDir::openLog(), Fs::Ufs::UFSSwapDir::openTmpSwapLog(), Rock::Rebuild::start(), Fs::Ufs::UFSSwapDir::writeCleanDone(), and Fs::Ufs::UFSSwapDir::writeCleanStart().
◆ file_read()
void file_read | ( | int | fd, |
char * | buf, | ||
int | req_len, | ||
off_t | offset, | ||
DRCB * | handler, | ||
void * | client_data | ||
) |
Definition at line 425 of file fs_io.cc.
References assert, cbdataReference, and diskHandleRead.
Referenced by BlockingFile::read(), and DiskThreadsDiskFile::read().
◆ file_write()
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 314 of file fs_io.cc.
References assert, cbdataReference, diskHandleWrite, F(), fd_table, and handle.
Referenced by Fs::Ufs::UFSSwapDir::logEntry(), Fs::Ufs::UFSSwapDir::openTmpSwapLog(), BlockingFile::write(), and DiskThreadsDiskFile::write().
◆ FileRename()
Definition at line 444 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().
◆ fsBlockSize()
Definition at line 467 of file fs_io.cc.
References DBG_IMPORTANT, debugs, statvfs::f_frsize, int, xstatvfs(), and xstrerr().
Referenced by Fs::Ufs::UFSSwapDir::init().
◆ fsStats()
Definition at line 491 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().
◆ safeunlink()
void safeunlink | ( | const char * | s, |
int | quiet | ||
) |
Definition at line 433 of file fs_io.cc.
References DBG_IMPORTANT, debugs, StatCounters::disk, statCounter, StatCounters::syscalls, and xstrerr().
Referenced by Fs::Ufs::UFSSwapDir::DirClean(), Fs::Ufs::UFSSwapDir::openTmpSwapLog(), RemoveInstance(), and unlinkdUnlink().
Variable Documentation
◆ diskHandleRead
|
static |
Definition at line 22 of file fs_io.cc.
Referenced by diskHandleRead(), and file_read().
◆ diskHandleWrite
|
static |
Definition at line 23 of file fs_io.cc.
Referenced by diskHandleWrite(), file_close(), and file_write().
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products