21 #include <kernel_types.h>
22 #include "AsyncIoThread.hpp"
23 #include "Filename.hpp"
34 virtual int init() = 0;
35 virtual bool isOpen() = 0;
38 Request *m_current_request, *m_last_request;
41 bool has_buffer()
const;
65 virtual int writeBuffer(
const char * buf,
size_t size, off_t offset)=0;
67 virtual void closeReq(
Request *request)=0;
68 virtual void syncReq(
Request *request)=0;
69 virtual void removeReq(
Request *request)=0;
70 virtual void appendReq(
Request *request)=0;
71 virtual void rmrfReq(
Request *request,
const char * path,
bool removePath)=0;
72 virtual void createDirectories()=0;
79 virtual void readvReq(
Request *request);
86 virtual void writevReq(
Request *request);
95 size_t m_write_wo_sync;
96 size_t m_auto_sync_freq;
106 char* theWriteBuffer;
107 Uint32 theWriteBufferSize;
117 assert(!has_buffer());
121 theWriteBuffer = (
char*)ptr.p;
122 theWriteBufferSize = cnt *
sizeof(
GlobalPage);
127 AsyncFile::has_buffer()
const
129 return m_page_cnt > 0;
134 AsyncFile::clear_buffer(Uint32 & rg,
Ptr<GlobalPage> & ptr, Uint32 & cnt)
136 assert(has_buffer());
142 m_page_ptr.setNull();
144 theWriteBufferSize = 0;