tailieunhanh - unix filesystems evolution design and implementation phần 4

Tham khảo tài liệu 'unix filesystems evolution design and implementation phần 4', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | UNIX Kernel Concepts 115 be in memory when the process requests it. The data requested is read but before returning to the user with the data a strategy call is made to read the next block without a subsequent call to iowait . To perform a write a call is made to bwrite which simply needs to invoke the two line sequence previously shown. After the caller has finished with the buffer a call is made to brelse which takes the buffer and places it at the back of the freelist. This ensures that the oldest free buffer will be reassigned first. Mounting Filesystems The section The UNIX Filesystem earlier in this chapter showed how filesystems were laid out on disk with the superblock occupying block 1 of the disk slice. Mounted filesystems were held in a linked list of mount structures one per filesystem with a maximum of NMOUNT mounted filesystems. Each mount structure has three elements namely m_dev. This field holds the device ID of the disk slice and can be used in a simple check to prevent a second mount of the same filesystem. m_buf. This field points to the superblock struct filsys which is read from disk during a mount operation. m_inodp. This field references the inode for the directory onto which this filesystem is mounted. This is further explained in the section Pathname Resolution later in this chapter. The root filesystem is mounted early on during kernel initialization. This involved a very simple code sequence that relied on the root device being hard coded into the kernel. The block containing the superblock of the root filesystem is read into memory by calling bread then the first mount structure is initialized to point to the buffer. Any subsequent mounts needed to come in through the mount system call. The first task to perform would be to walk through the list of existing mount structures checking m_dev against the device passed to mount . If the filesystem is mounted already EBUSY is returned otherwise another mount structure is allocated for the new

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.