⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fil0fil.h

📁 这是linux下运行的mysql软件包,可用于linux 下安装 php + mysql + apach 的网络配置
💻 H
📖 第 1 页 / 共 2 页
字号:
/******************************************************The low-level file system(c) 1995 Innobase OyCreated 10/25/1995 Heikki Tuuri*******************************************************/#ifndef fil0fil_h#define fil0fil_h#include "univ.i"#include "sync0rw.h"#include "dict0types.h"#include "ibuf0types.h"#include "ut0byte.h"#include "os0file.h"/* When mysqld is run, the default directory "." is the mysqld datadir, but inibbackup we must set it explicitly; the patgh must NOT contain the trailing'/' or '\' */extern const char*	fil_path_to_mysql_datadir;/* Initial size of a single-table tablespace in pages */#define FIL_IBD_FILE_INITIAL_SIZE	4/* 'null' (undefined) page offset in the context of file spaces */#define	FIL_NULL	ULINT32_UNDEFINED/* Space address data type; this is intended to be used whenaddresses accurate to a byte are stored in file pages. If the page partof the address is FIL_NULL, the address is considered undefined. */typedef	byte	fil_faddr_t;	/* 'type' definition in C: an address				stored in a file page is a string of bytes */#define FIL_ADDR_PAGE	0	/* first in address is the page offset */#define	FIL_ADDR_BYTE	4	/* then comes 2-byte byte offset within page*/#define	FIL_ADDR_SIZE	6	/* address size is 6 bytes *//* A struct for storing a space address FIL_ADDR, when it is usedin C program data structures. */typedef struct fil_addr_struct	fil_addr_t;struct fil_addr_struct{	ulint	page;		/* page number within a space */	ulint	boffset;	/* byte offset within the page */};/* Null file address */extern fil_addr_t	fil_addr_null;/* The byte offsets on a file page for various variables */#define FIL_PAGE_SPACE_OR_CHKSUM 0	/* in < MySQL-4.0.14 space id the					page belongs to (== 0) but in later					versions the 'new' checksum of the					page */#define FIL_PAGE_OFFSET		4	/* page offset inside space */#define FIL_PAGE_PREV		8	/* if there is a 'natural' predecessor					of the page, its offset */#define FIL_PAGE_NEXT		12	/* if there is a 'natural' successor					of the page, its offset */#define FIL_PAGE_LSN		16	/* lsn of the end of the newest					modification log record to the page */#define	FIL_PAGE_TYPE		24	/* file page type: FIL_PAGE_INDEX,...,					2 bytes */#define FIL_PAGE_FILE_FLUSH_LSN	26	/* this is only defined for the					first page in a data file: the file					has been flushed to disk at least up					to this lsn */#define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID  34 /* starting from 4.1.x this					contains the space id of the page */#define FIL_PAGE_DATA		38	/* start of the data on the page *//* File page trailer */#define FIL_PAGE_END_LSN_OLD_CHKSUM 8	/* the low 4 bytes of this are used					to store the page checksum, the					last 4 bytes should be identical					to the last 4 bytes of FIL_PAGE_LSN */#define FIL_PAGE_DATA_END	8/* File page types */#define FIL_PAGE_INDEX		17855#define FIL_PAGE_UNDO_LOG	2#define FIL_PAGE_INODE		3#define FIL_PAGE_IBUF_FREE_LIST	4/* Space types */#define FIL_TABLESPACE 		501#define FIL_LOG			502extern ulint	fil_n_log_flushes;extern ulint	fil_n_pending_log_flushes;extern ulint	fil_n_pending_tablespace_flushes;/***********************************************************************Returns the version number of a tablespace, -1 if not found. */ib_longlongfil_space_get_version(/*==================*/			/* out: version number, -1 if the tablespace does not			exist in the memory cache */	ulint	id);	/* in: space id *//***********************************************************************Returns the latch of a file space. */rw_lock_t*fil_space_get_latch(/*================*/			/* out: latch protecting storage allocation */	ulint	id);	/* in: space id *//***********************************************************************Returns the type of a file space. */ulintfil_space_get_type(/*===============*/			/* out: FIL_TABLESPACE or FIL_LOG */	ulint	id);	/* in: space id *//***********************************************************************Returns the ibuf data of a file space. */ibuf_data_t*fil_space_get_ibuf_data(/*====================*/			/* out: ibuf data for this space */	ulint	id);	/* in: space id *//***********************************************************************Appends a new file to the chain of files of a space. File must be closed. */voidfil_node_create(/*============*/	const char*	name,	/* in: file name (file must be closed) */	ulint		size,	/* in: file size in database blocks, rounded				downwards to an integer */	ulint		id,	/* in: space id where to append */	ibool		is_raw);/* in: TRUE if a raw device or				a raw disk partition *//********************************************************************Drops files from the start of a file space, so that its size is cut bythe amount given. */voidfil_space_truncate_start(/*=====================*/	ulint	id,		/* in: space id */	ulint	trunc_len);	/* in: truncate by this much; it is an error				if this does not equal to the combined size of				some initial files in the space *//***********************************************************************Creates a space memory object and puts it to the 'fil system' hash table. Ifthere is an error, prints an error message to the .err log. */iboolfil_space_create(/*=============*/				/* out: TRUE if success */	const char*	name,	/* in: space name */	ulint		id,	/* in: space id */	ulint		purpose);/* in: FIL_TABLESPACE, or FIL_LOG if log *//***********************************************************************Frees a space object from a the tablespace memory cache. Closes the files inthe chain but does not delete them. */iboolfil_space_free(/*===========*/			/* out: TRUE if success */	ulint	id);	/* in: space id *//***********************************************************************Returns the size of the space in pages. The tablespace must be cached in thememory cache. */ulintfil_space_get_size(/*===============*/			/* out: space size, 0 if space not found */	ulint	id);	/* in: space id *//***********************************************************************Checks if the pair space, page_no refers to an existing page in a tablespacefile space. The tablespace must be cached in the memory cache. */iboolfil_check_adress_in_tablespace(/*===========================*/			/* out: TRUE if the address is meaningful */	ulint	id,	/* in: space id */	ulint	page_no);/* in: page number *//********************************************************************Initializes the tablespace memory cache. */voidfil_init(/*=====*/	ulint	max_n_open);	/* in: max number of open files *//***********************************************************************Opens all log files and system tablespace data files. They stay open until thedatabase server shutdown. This should be called at a server startup after thespace objects for the log and the system tablespace have been created. Thepurpose of this operation is to make sure we never run out of file descriptorsif we need to read from the insert buffer or to write to the log. */voidfil_open_log_and_system_tablespace_files(void);/*==========================================*//***********************************************************************Closes all open files. There must not be any pending i/o's or not flushedmodifications in the files. */voidfil_close_all_files(void);/*=====================*//***********************************************************************Sets the max tablespace id counter if the given number is bigger than theprevious value. */voidfil_set_max_space_id_if_bigger(/*===========================*/	ulint	max_id);/* in: maximum known id *//********************************************************************Initializes the ibuf data structure for space 0 == the system tablespace.This can be called after the file space headers have been created and thedictionary system has been initialized. */voidfil_ibuf_init_at_db_start(void);/*===========================*//********************************************************************Writes the flushed lsn and the latest archived log number to the pageheader of the first page of each data file in the system tablespace. */ulintfil_write_flushed_lsn_to_data_files(/*================================*/				/* out: DB_SUCCESS or error number */	dulint	lsn,		/* in: lsn to write */	ulint	arch_log_no);	/* in: latest archived log file number *//***********************************************************************Reads the flushed lsn and arch no fields from a data file at databasestartup. */voidfil_read_flushed_lsn_and_arch_log_no(/*=================================*/	os_file_t data_file,		/* in: open data file */	ibool	one_read_already,	/* in: TRUE if min and max parameters					below already contain sensible data */#ifdef UNIV_LOG_ARCHIVE	ulint*	min_arch_log_no,	/* in/out: */	ulint*	max_arch_log_no,	/* in/out: */#endif /* UNIV_LOG_ARCHIVE */	dulint*	min_flushed_lsn,	/* in/out: */	dulint*	max_flushed_lsn);	/* in/out: *//***********************************************************************Increments the count of pending insert buffer page merges, if space is notbeing deleted. */iboolfil_inc_pending_ibuf_merges(/*========================*/			/* out: TRUE if being deleted, and ibuf merges should			be skipped */	ulint	id);	/* in: space id *//***********************************************************************Decrements the count of pending insert buffer page merges. */voidfil_decr_pending_ibuf_merges(/*========================*/	ulint	id);	/* in: space id *//***********************************************************************Parses the body of a log record written about an .ibd file operation. That is,the log record part after the standard (type, space id, page no) header of thelog record.If desired, also replays the delete or rename operation if the .ibd fileexists and the space id in it matches. Replays the create operation if a fileat that path does not exist yet. If the database directory for the file to becreated does not exist, then we create the directory, too.Note that ibbackup --apply-log sets fil_path_to_mysql_datadir to point to thedatadir that we should use in replaying the file operations. */byte*fil_op_log_parse_or_replay(/*=======================*/                        	/* out: end of log record, or NULL if the				record was not completely contained between				ptr and end_ptr */        byte*   ptr,    	/* in: buffer containing the log record body,				or an initial segment of it, if the record does				not fir completely between ptr and end_ptr */        byte*   end_ptr,	/* in: buffer end */	ulint	type,		/* in: the type of this log record */	ibool	do_replay,	/* in: TRUE if we want to replay the				operation, and not just parse the log record */	ulint	space_id);	/* in: if do_replay is TRUE, the space id of				the tablespace in question; otherwise				ignored *//***********************************************************************Deletes a single-table tablespace. The tablespace must be cached in thememory cache. */iboolfil_delete_tablespace(/*==================*/			/* out: TRUE if success */	ulint	id);	/* in: space id *//***********************************************************************Discards a single-table tablespace. The tablespace must be cached in thememory cache. Discarding is like deleting a tablespace, but1) we do not drop the table from the data dictionary;2) we remove all insert buffer entries for the tablespace immediately; in DROPTABLE they are only removed gradually in the background;3) when the user does IMPORT TABLESPACE, the tablespace will have the same idas it originally had. */iboolfil_discard_tablespace(/*===================*/			/* out: TRUE if success */	ulint	id);	/* in: space id *//***********************************************************************Renames a single-table tablespace. The tablespace must be cached in thetablespace memory cache. */iboolfil_rename_tablespace(/*==================*/					/* out: TRUE if success */	const char*	old_name,	/* in: old table name in the standard					databasename/tablename format of					InnoDB, or NULL if we do the rename					based on the space id only */	ulint		id,		/* in: space id */	const char*	new_name);	/* in: new table name in the standard					databasename/tablename format

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -