1 / 16

Overview

Overview. Assignment 12: hints Distributed file systems Assignment 11: solution File systems. A12 – Network File System (Sun). System call layer. Virtual file system layer. Virtual file system layer. Local operating system. NFS client. NFS server. Local operating system. Message

bairn
Download Presentation

Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Overview • Assignment 12: hints • Distributed file systems • Assignment 11: solution • File systems

  2. A12 – Network File System (Sun) System call layer Virtual file system layer Virtual file system layer Local operating system NFS client NFS server Local operating system Message to server Message from client

  3. A12 – NFS • Mounting protocol: • The server exports certain directories to certain machines (IP authentication) • The clients mounts a given directory from a specified server. • Directory and file access: • System calls are performed as remote procedure calls. • No open and close: stateless. • Security: • IP based (export lists) • UNIX permissions based on UID/GID

  4. A12 – Andrew File System (CMU) System call layer Virtual file system layer Virtual file system layer Local operating system AFS client AFS server Local operating system AFS cache Message to server Message from client

  5. A12 – AFS • Mounting • The server has no information about the clients. • Cell list maintained. • The client mounts the whole AFS tree (the whole AFS world). • Directory and file access • The file is cached locally and committed on close. • Security: • Kerberos server • Access list for files access

  6. A12 Ex1 – Moving a shared volume Server A Server B Client

  7. A12 Ex2 – Simultaneous accesses Server • Client • open • modify • close • Client • open • modify • close

  8. A12 Ex3 – Immutable Files • Files can only be created and read. • What is simplified? • What can be avoided?

  9. Overview • Assignment 12: hints • Distributed file systems • Assignment 11: solution • File systems

  10. A11 Ex1 – Max File Length datablocks inode

  11. A11 Ex1 – Maximal File Length Given: • block size = 2KB • address = 4 bytes (assumption) • table of contents = 15 entries (12 / 1 / 1 / 1) • number of entries in index table = 2048 / 4 = 512

  12. A11 Ex2 – File Access ./a/b/c/f, File length is 1GB Directory access 2 disk acc. (1 for the inode, 1 for table) • 7 accesses until the file inode is known Positioning at the end of the file (2K blocks): • direct access: 24 KB • single indirect access: 1 MB • double indirect access: 512 MB • must use triple indirect access  4 accesses (1i+3t) Read the block and rewrite it with the additional byte  2 accesses Total: 13 disk accesses

  13. A11 Ex3 – I/O redirection / Pipes $ command < file After shell fork() in the child process: • fd = open(file) • close(stdin) • dup2(stdin,fd) • close(fd) • exec(command)

  14. A11 Ex3 – I/O redirection / Pipes user file descriptor file table inode table count 1, rd cnt 1 (/dev/tty1) $ command < file fd = open(file) close(stdin) dup2(stdin,fd) close(fd) exec(command) cnt 1 (file) count 1 rd count 2, rd

  15. A11 Ex3 – I/O redirection / Pipes $ command1 | command2 Shell fork() pipe(fd[]) fork() close(stdout) dup2(stdout,fd[1]) close(fd[1]) exec(command1) close(stdin) dup2(stdin,fd[0]) close(fd[0]) exec(command2)

  16. A11 Ex4 – Mounting Bach Book: Each file system type has a method table To access a file, indirect function call through the table • need FS abstraction, common to all FS • struct file_operation • read, write, readdir, ioctl, open, flush, release, fsync, lock • associate every file with its FS (method table) • inode has a pointer to file_operation

More Related