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

📄 inode.h

📁 一个简单的操作系统minix的核心代码
💻 H
字号:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
				src/fs/inode.h	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

20500	/* Inode table.  This table holds inodes that are currently in use.  In some
20501	 * cases they have been opened by an open() or creat() system call, in other
20502	 * cases the file system itself needs the inode for one reason or another,
20503	 * such as to search a directory for a path name.
20504	 * The first part of the struct holds fields that are present on the
20505	 * disk; the second part holds fields not present on the disk.
20506	 * The disk inode part is also declared in "type.h" as 'd1_inode' for V1
20507	 * file systems and 'd2_inode' for V2 file systems.
20508	 */
20509	
20510	EXTERN struct inode {
20511	  mode_t i_mode;                /* file type, protection, etc. */
20512	  nlink_t i_nlinks;             /* how many links to this file */
20513	  uid_t i_uid;                  /* user id of the file's owner */
20514	  gid_t i_gid;                  /* group number */
20515	  off_t i_size;                 /* current file size in bytes */
20516	  time_t i_atime;               /* time of last access (V2 only) */
20517	  time_t i_mtime;               /* when was file data last changed */
20518	  time_t i_ctime;               /* when was inode itself changed (V2 only)*/
20519	  zone_t i_zone[V2_NR_TZONES];  /* zone numbers for direct, ind, and dbl ind */
20520	  
20521	  /* The following items are not present on the disk. */
20522	  dev_t i_dev;                  /* which device is the inode on */
20523	  ino_t i_num;                  /* inode number on its (minor) device */
20524	  int i_count;                  /* # times inode used; 0 means slot is free */
20525	  int i_ndzones;                /* # direct zones (Vx_NR_DZONES) */
20526	  int i_nindirs;                /* # indirect zones per indirect block */
20527	  struct super_block *i_sp;     /* pointer to super block for inode's device */
20528	  char i_dirt;                  /* CLEAN or DIRTY */
20529	  char i_pipe;                  /* set to I_PIPE if pipe */
20530	  char i_mount;                 /* this bit is set if file mounted on */
20531	  char i_seek;                  /* set on LSEEK, cleared on READ/WRITE */
20532	  char i_update;                /* the ATIME, CTIME, and MTIME bits are here */
20533	} inode[NR_INODES];
20534	
20535	
20536	#define NIL_INODE (struct inode *) 0    /* indicates absence of inode slot */
20537	
20538	/* Field values.  Note that CLEAN and DIRTY are defined in "const.h" */
20539	#define NO_PIPE            0    /* i_pipe is NO_PIPE if inode is not a pipe */
20540	#define I_PIPE             1    /* i_pipe is I_PIPE if inode is a pipe */
20541	#define NO_MOUNT           0    /* i_mount is NO_MOUNT if file not mounted on*/
20542	#define I_MOUNT            1    /* i_mount is I_MOUNT if file mounted on */
20543	#define NO_SEEK            0    /* i_seek = NO_SEEK if last op was not SEEK */
20544	#define ISEEK              1    /* i_seek = ISEEK if last op was SEEK */

⌨️ 快捷键说明

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