diff options
Diffstat (limited to 'storage/innobase/include/os0file.h')
-rw-r--r-- | storage/innobase/include/os0file.h | 93 |
1 files changed, 6 insertions, 87 deletions
diff --git a/storage/innobase/include/os0file.h b/storage/innobase/include/os0file.h index 159a4789f17..646f964df7f 100644 --- a/storage/innobase/include/os0file.h +++ b/storage/innobase/include/os0file.h @@ -36,7 +36,7 @@ Created 10/21/1995 Heikki Tuuri #ifndef os0file_h #define os0file_h -#include "page0size.h" +#include "fsp0types.h" #include "os0api.h" #ifndef _WIN32 @@ -45,6 +45,8 @@ Created 10/21/1995 Heikki Tuuri #include <time.h> #endif /* !_WIN32 */ +#include "my_counter.h" + /** File node of a tablespace or the log data space */ struct fil_node_t; struct fil_space_t; @@ -56,8 +58,6 @@ typedef ib_uint64_t os_offset_t; #ifdef _WIN32 -typedef HANDLE os_file_dir_t; /*!< directory stream */ - /** We define always WIN_ASYNC_IO, and check at run-time whether the OS actually supports it: Win 95 does not, NT does. */ # define WIN_ASYNC_IO @@ -71,8 +71,6 @@ typedef HANDLE os_file_t; #else /* _WIN32 */ -typedef DIR* os_file_dir_t; /*!< directory stream */ - /** File handle */ typedef int os_file_t; @@ -360,17 +358,8 @@ public: /** Set the pointer to file node for IO @param[in] node File node */ - void set_fil_node(fil_node_t* node) - { - if (node && !fil_node_should_punch_hole(node)) { - clear_punch_hole(); - } + inline void set_fil_node(fil_node_t* node); - m_fil_node = node; - } - - /** Compare two requests - @reutrn true if the are equal */ bool operator==(const IORequest& rhs) const { return(m_type == rhs.m_type); @@ -414,17 +403,7 @@ public: : 0); } - bool should_punch_hole() const { - return (m_fil_node ? - fil_node_should_punch_hole(m_fil_node) - : false); - } - - void space_no_punch_hole() const { - if (m_fil_node) { - fil_space_set_punch_hole(m_fil_node, false); - } - } + inline bool should_punch_hole() const; /** Free storage space associated with a section of the file. @param[in] fh Open file handle @@ -478,7 +457,7 @@ or write, causing a bottleneck for parallelism. */ static const ulint OS_AIO_SYNC = 24; /* @} */ -extern ulint os_n_file_reads; +extern Atomic_counter<ulint> os_n_file_reads; extern ulint os_n_file_writes; extern ulint os_n_fsyncs; @@ -532,43 +511,6 @@ parameter (--tmpdir). FILE* os_file_create_tmpfile(); -/** The os_file_opendir() function opens a directory stream corresponding to the -directory named by the dirname argument. The directory stream is positioned -at the first entry. In both Unix and Windows we automatically skip the '.' -and '..' items at the start of the directory listing. - -@param[in] dirname directory name; it must not contain a trailing - '\' or '/' -@param[in] is_fatal true if we should treat an error as a fatal - error; if we try to open symlinks then we do - not wish a fatal error if it happens not to be - a directory -@return directory stream, NULL if error */ -os_file_dir_t -os_file_opendir( - const char* dirname, - bool is_fatal); - -/** -Closes a directory stream. -@param[in] dir directory stream -@return 0 if success, -1 if failure */ -int -os_file_closedir( - os_file_dir_t dir); - -/** This function returns information of the next file in the directory. We jump -over the '.' and '..' entries in the directory. -@param[in] dirname directory name or path -@param[in] dir directory stream -@param[out] info buffer where the info is returned -@return 0 if ok, -1 if error, 1 if at the end of the directory */ -int -os_file_readdir_next_file( - const char* dirname, - os_file_dir_t dir, - os_file_stat_t* info); - /** This function attempts to create a directory named pathname. The new directory gets default permissions. On Unix, the permissions are (0770 & ~umask). If the @@ -1593,19 +1535,6 @@ os_file_change_size_win32( #endif /*_WIN32 */ -/** Check if the file system supports sparse files. - -Warning: On POSIX systems we try and punch a hole from offset 0 to -the system configured page size. This should only be called on an empty -file. - -@param[in] fh File handle for the file - if opened -@return true if the file system supports sparse files */ -bool -os_is_sparse_file_supported( - os_file_t fh) - MY_ATTRIBUTE((warn_unused_result)); - /** Free storage space associated with a section of the file. @param[in] fh Open file handle @param[in] off Starting offset (SEEK_SET) @@ -1645,16 +1574,6 @@ is_absolute_path( return(false); } -/***********************************************************************//** -Try to get number of bytes per sector from file system. -@return file block size */ -UNIV_INTERN -ulint -os_file_get_block_size( -/*===================*/ - os_file_t file, /*!< in: handle to a file */ - const char* name); /*!< in: file name */ - #include "os0file.inl" #endif /* os0file_h */ |