EDA365电子论坛网
标题:
Linux文件系统及属性
[打印本页]
作者:
mytomorrow
时间:
2019-8-11 09:30
标题:
Linux文件系统及属性
7 [+ K$ H7 b3 |; T; _- ]. Q
Linux文件系统及属性
|4 r4 _, i4 e( h( w7 C
1 |7 Z9 S+ W1 O+ ]2 Z. _
4 m. s- G( r! J0 s) [: B& u
$ ~3 @" \+ f2 a e# I6 a
. Y9 g8 M# s" ]. \2 _% w6 h
一、Linux系统下文件类型及属性
# h- j: P& d9 `' }- `( C+ c" \2 n- `
- s1 E$ Q( k |, M% A
" O! Y* ^: |; E9 V8 @, F: b% h
1、inode结构
; Y% x: n2 P5 P4 U1 ^2 f, o1 s( \
; T$ g1 r' d3 L. }
. r. p+ n/ |2 c/ u
/*索引节点对象由inode结构体表示,定义文件在linux/fs.h中*/
struct inode
{
struct hlist_node i_hash; /* 哈希表 */
struct list_head i_list; /* 索引节点链表 */
struct list_head i_dentry; /* 目录项链表 */
unsigned long i_ino; /* 节点号 */
atomic_t i_count; /* 引用记数 */
umode_t i_mode; /* 访问权限控制 */
unsigned int i_nlink; /* 硬链接数 */
uid_t i_uid; /* 使用者id */
gid_t i_gid; /* 使用者id组 */
kdev_t i_rdev; /* 实设备标识符 */
loff_t i_size; /* 以字节为单位的文件大小 */
struct timespec i_atime; /* 最后访问时间 */
struct timespec i_mtime; /* 最后修改(modify)时间 */
struct timespec i_ctime; /* 最后改变(change)时间 */
unsigned int i_blkbits; /* 以位为单位的块大小 */
unsigned long i_blksize; /* 以字节为单位的块大小 */
unsigned long i_version; /* 版本号 */
unsigned long i_blocks; /* 文件的块数 */
unsigned short i_bytes; /* 使用的字节数 */
spinlock_t i_lock; /* 自旋锁 */
struct rw_semaphore i_alloc_sem; /* 索引节点信号量 */
struct inode_operations *i_op; /* 索引节点操作表 */
struct file_operations *i_fop; /* 默认的索引节点操作 */
struct super_block *i_sb; /* 相关的超级块 */
struct file_lock *i_flock; /* 文件锁链表 */
struct address_space *i_mapping; /* 相关的地址映射 */
struct address_space i_data; /* 设备地址映射 */
struct dquot *i_dquot[MAXQUOTAS]; /* 节点的磁盘限额 */
struct list_head i_devices; /* 块设备链表 */
struct pipe_inode_info *i_pipe; /* 管道信息 */
struct block_device *i_bdev; /* 块设备驱动 */
unsigned long i_dnotify_mask; /* 目录通知掩码 */
struct dnotify_struct *i_dnotify; /* 目录通知 */
unsigned long i_state; /* 状态标志 */
unsigned long dirtied_when; /* 首次修改时间 */
unsigned int i_flags; /* 文件系统标志 */
unsigned char i_sock; /* 可能是个套接字吧 */
atomic_t i_writecount; /* 写者记数 */
void *i_security; /* 安全模块 */
__u32 i_generation; /* 索引节点版本号 */
union
{
void *generic_ip; /* 文件特殊信息 */
} u;
};<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"> </span>
2 E5 C5 V8 i- }9 V+ p$ z
* o% y/ q8 b; I* Z3 O c
% P9 x# ?2 P$ h0 ~
# w5 A6 L8 }0 a
2、Linux文件类型(/usr/include/bits/stat.h)
* u7 Q l: i" X8 g* Y% G9 R
: @6 u; T9 J# ^
$ w. L/ s, |" H* W3 B
! @& m: W* c, W
% I" D/ D5 v- Y4 d8 q
& W$ ]. s( f" k4 M* g' J
作者:
artic
时间:
2019-8-12 17:48
看看。
欢迎光临 EDA365电子论坛网 (https://bbs.eda365.com/)
Powered by Discuz! X3.2