Linux+26179内核文件系统调用详解.doc

Linux+26179内核文件系统调用详解.doc

ID:51469418

大小:35.00 KB

页数:6页

时间:2020-03-25

Linux+26179内核文件系统调用详解.doc_第1页
Linux+26179内核文件系统调用详解.doc_第2页
Linux+26179内核文件系统调用详解.doc_第3页
Linux+26179内核文件系统调用详解.doc_第4页
Linux+26179内核文件系统调用详解.doc_第5页
资源描述:

《Linux+26179内核文件系统调用详解.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、Linux2.6.17.9内核文件系统调用详解本部分主要讲述的是文件I/O操作的2.6.17.9内核版本实现,包括了主要的数据结构、宏定义和函数流程。以下分别讲述open,create,close,read,write,lseek系统调用。1重要数据结构1.1structfilestructfile{  /*  *fu_listbecomesinvalidafterfile_freeiscalledandqueuedvia  *fu_rcuheadforRCUfreeing  */  union{    structlist_head  

2、fu_list;//文件链表指针    structrcu_head  fu_rcuhead;//rcu链表  }f_u;  structdentry    *f_dentry;//文件对应的目录结构  structvfsmount    *f_vfsmnt;//虚拟文件系统挂载点  conststructfile_operations  *f_op;//文件操作函数指针  atomic_t    f_count;//引用计数  unsignedint    f_flags;  mode_t      f_mode;//文件模式  lof

3、f_t      f_pos;//文件offset  structfown_struct  f_owner;//文件owner结构  unsignedint    f_uid,f_gid;//文件用户id,组id  structfile_ra_state  f_ra;//跟踪上次文件操作状态的结构指针  unsignedlong    f_version;  void      *f_security;//hook文件操作的security结构指针  /*neededforttydriver,andmaybeothers*/  void 

4、     *private_data;//tty驱动器所需数据#ifdefCONFIG_EPOLL  /*Usedbyfs/eventpoll.ctolinkallthehookstothisfile*/  structlist_head  f_ep_links;//EPOLL机制检测所需链表结构  spinlock_t    f_ep_lock;//兼容早期gccbug的标志#endif/*#ifdefCONFIG_EPOLL*/  structaddress_space  *f_mapping;//地址映射表};1.2structfo

5、wn_structstructfown_struct{  rwlock_tlock;     /*protectspid,uid,euidfields*/  intpid;    /*pidor-pgrpwhereSIGIOshouldbesent*/  uid_tuid,euid;  /*uid/euidofprocesssettingtheowner*/  void*security;/*hook文件操作的security结构指针*/  intsignum;    /*posix.1brtsignaltobedeliveredonIO

6、*/};1.3structfile_ra_state/**Trackasinglefile'sreadaheadstate*/structfile_ra_state{  unsignedlongstart;    /*Currentwindow*/  unsignedlongsize;  unsignedlongflags;    /*raflagsRA_FLAG_xxx*/  unsignedlongcache_hit;  /*cachehitcount*/  unsignedlongprev_page;  /*Cachelastrea

7、d()position*/  unsignedlongahead_start;  /*Aheadwindow*/  unsignedlongahead_size;  unsignedlongra_pages;    /*Maximumreadaheadwindow*/  unsignedlongmmap_hit;    /*Cachehitstatformmapaccesses*/  unsignedlongmmap_miss;  /*Cachemissstatformmapaccesses*/};1.4structaddress_spa

8、cestructaddress_space{  structinode    *host;    /*owner:inode,block_device*/  structradix_tree_

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。