Linux虚拟文件系统–open()

open()系统调用用来打开一个文件,,本文就VFS层,对open系统调用的过程进行一个简单的分析。

force_o_largefile()用来判断系统是否为32位的,如果不是32位,也就是说为64位,则将O_LARGEFILE置位,主体工作由do_sys_open()来做

open操作是特定于某个进程进行的,因此涉及到了VFS中特定于进程的结构,这里简单的介绍下

struct files_struct { /* * read mostly part */ atomic_t count; struct fdtable *fdt; struct fdtable fdtab; /* * written part on a separate cache line in SMP */ spinlock_t file_lock ____cacheline_aligned_in_smp; int next_fd; struct embedded_fd_set close_on_exec_init; struct embedded_fd_set open_fds_init; struct file * fd_array[NR_OPEN_DEFAULT]; };

没有预兆目的地在哪,前进的脚步不能停下,

Linux虚拟文件系统–open()

相关文章:

你感兴趣的文章:

标签云: