Unix v6 セミナー vol. 5

2,285 views

Published on

Published in: Education
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,285
On SlideShare
0
From Embeds
0
Number of Embeds
90
Actions
Shares
0
Downloads
0
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

Unix v6 セミナー vol. 5

  1. 1. UNIX V6 セミナー (5)@magoroku152013/6/1513/6/15 10時49分 1
  2. 2. 今日の内容• UNIXのファイルシステム第一世代:FSUNIX V6, UNIX V7, UNIX System V R2-R3• 名前:固定長14文字• ブロック管理:配列第二世代:FFS4.2BSD• 名前:可変長、255文字• ブロック管理:bitmap• その他:シリンダグループ第三世代:• ジャーナルの追加• ブロック管理:多様化→bitmap、Btreeなど• 4.2BSDまではOSが扱えるファイルシステムは1種類– Sun micro systemsのNFSの実装でvnodeを導入– 複数の種類のファイルシステムを同時に運用可能に13/6/15 10時49分 2
  3. 3. 参照するソースの関係|Sixth Edition (V6) -----*¥ |Seventh Edition (V7) |¥ |¥ 1BSD32V |¥ 2BSD---------------*¥ / |¥ / |¥/ |3BSD || |4.0BSD 2.79BSD| |4.1BSD --------------> 2.8BSD| |4.1aBSD -----------¥ || ¥ |4.1bBSD ¥ || ¥ |*------ 4.1cBSD --------------> 2.9BSD/ | |Eighth Edition | 2.9BSD-Seismo| | |+----<--- 4.2BSD 2.9.1BSD| | |+----<--- 4.3BSD -------------> 2.10BSD| | / |Ninth Edition | / 2.10.1BSD| 4.3BSD Tahoe-----+ || | ¥ || | ¥ |v | 2.11BSDTenth Edition | || 2.11BSD rev #4304.3BSD NET/1 || v4.3BSD Reno|*---------- 4.3BSD NET/2 -------------------+-------------*| | | |386BSD 0.0 | | BSD/386 ALPHA| | | |386BSD 0.1 ------------>+ | BSD/386 0.3.[13]| ¥ | 4.4BSD Alpha || 386BSD 1.0 | | BSD/386 0.9.[34]| | 4.4BSD || | / | || | 4.4BSD-Encumbered | || NetBSD 0.8 | BSD/386 1.0| | | |FreeBSD 1.0 NetBSD 0.9 | BSD/386 1.1| | .----- 4.4BSD Lite |FreeBSD 1.1http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/share/misc/bsd-family-tree?rev=HEAD1992-02-xx1975-05-xx1983-08-031990-06-29暗黒時代和解仕様13/6/15 10時49分 3
  4. 4. 参照するUNIXの特徴• Sixth Edition (v6)– Cで書かれた最初のUNIX– PDP-11依存• 4.2BSD– 32bit, 仮想記憶、TCP/IP– VAX-11依存、後にSun,Sony等がMC680x0に移植• 4.3BSD Reno– ハード無依存が進む– 最後のBSD– FreeBSD, NetBSD,Mac OSのベース13/6/15 10時49分 4
  5. 5. ソースのダウンロード元• V6– http://www.tom-yam.or.jp/2238/src/• 4.2BSD– http://www.tuhs.org/Archive/4BSD/Distributions/4.2BSD/srcsys.tar.gz• 4.3BSD (Reno)– http://www.tuhs.org/Archive/4BSD/Distributions/4.3BSD-Reno/13/6/15 10時49分 5
  6. 6. 第一世代(FS)課題 1• ファイル名の最大文字数が短い– 最大14文字– SCCS (初期のバージョン管理システム)がサフィックス2文字を必要とするため、実質12文字• FFSで拡張– 可変長 最大255文字13/6/15 10時49分 6
  7. 7. V6のファイルシステム (復習)13/6/15 10時49分 7
  8. 8. 13/6/15 10時49分 8
  9. 9. 13/6/15 10時49分 9
  10. 10. 13/6/15 10時49分 10
  11. 11. 13/6/15 10時49分 11
  12. 12. 13/6/15 10時49分 12
  13. 13. 13/6/15 10時49分 13
  14. 14. FSの課題と4.2BSD FFSでの改善点13/6/15 10時49分 14
  15. 15. 4.2BSD h/dir.h35 structdirect {36 u_long d_ino; /* inode number of entry */37 u_short d_reclen; /* length of this record */38 u_short d_namlen; /* length of string in d_name */39 char d_name[MAXNAMLEN + 1];/* name must be no longer than this */40 };ad_ino32bitd_reclen d_namlen16bit 16bit. od_reclend_namlenu t ・・・・・・13/6/15 10時49分 15
  16. 16. ディレクトリファイルの比較FS (v6等)16byteBlocksz/16byteFFS (4.xBSD)16bytereclenreclenreclen13/6/15 10時49分 16
  17. 17. 4.2bsd/sys/ufs_nami.c#269404 while (ndp->ni_offset < endsearch) {267 if (ep->d_ino) {268 if (ep->d_namlen == u.u_dent.d_namlen &&269 !bcmp(u.u_dent.d_name, ep->d_name, ep->d_namlen))270 goto found;271 }272 prevoff = u.u_offset;273 u.u_offset += ep->d_reclen;274 entryoffsetinblock += ep->d_reclen;434 ep = (struct direct *)(bp->b_un.b_addr + entryoffsetinblock);487 }13/6/15 10時49分 17
  18. 18. 第一世代(FS)の課題 2• ブロック管理が配列– フラグメンテーションによる経年劣化– 全てのファイルを削除しても、改善しない• MKFS直後はFreeBlockはブロック昇順• ファイルの削除でFreeBlockはランダム化• 全てのファイルを削除してもFreeBlockはランダムのまま– 運用マニュアルに以下の注意が記載• バックアップのために定期的にdumpコマンドを実行• 一定期間を経るとフラグメンテーションにより性能の劣化が著しくなるので、mkfsで初期化して、restoreコマンドを実行13/6/15 10時49分 18
  19. 19. フラグメンテーション1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29Free10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29FreeCreate File A with 10 blocks26 27 28 29FreeCreate File B and C with 8 blocks for each files1 2 3 4 5 6 7 8 9 1011 13 15 17 19 21 23 2512 14 16 18 20 22 24 26ABC12 14 16 18 20 22 24 26 11 13 15 17 19 21 23 25 1 2 3 4 5 6 7 8 9 10 26 27 28 29FreeRemove file A, B, CCreate File A with 10 blocks12 14 16 18 20 22 24 26 11 13Aブロック位置の差は合計9ブロック位置の差は合計3113/6/15 10時49分 19
  20. 20. 媒体配置の改善 その1• FreeBlockの管理を配列から、ビットマップへ変更• write(2)を辿ってみる13/6/15 10時49分 20
  21. 21. 4.2bsd/sys/sys_generic.c66 write()67 {68 register struct a {69 int fdes;70 char *cbuf;71 unsigned count;72 } *uap = (struct a *)u.u_ap;73 struct uio auio;74 struct iovec aiov;7576 auio.uio_iov = &aiov;77 auio.uio_iovcnt = 1;78 aiov.iov_base = uap->cbuf;79 aiov.iov_len = uap->count;80 rwuio(&auio, UIO_WRITE);81 }13/6/15 10時49分 21
  22. 22. 4.2bsd/sys/sys_generic.c106 rwuio(uio, rw)107 register struct uio *uio;108 enum uio_rw rw;109 {110 struct a {111 int fdes;112 };113 register struct file *fp;114 register struct iovec *iov;115 int i, count;116117 GETF(fp, ((struct a *)u.u_ap)->fdes);122 uio->uio_resid = 0;123 uio->uio_segflg = UIO_USERSPACE;124 iov = uio->uio_iov;125 for (i = 0; i < uio->uio_iovcnt; i++) {130 uio->uio_resid += iov->iov_len;135 iov++;136 }137 count = uio->uio_resid;138 uio->uio_offset = fp->f_offset;147 u.u_error = (*fp->f_ops->fo_rw)(fp, rw, uio);148 u.u_r.r_val1 = count - uio->uio_resid;149 fp->f_offset += u.u_r.r_val1;150 }13/6/15 10時49分 22
  23. 23. 4.2bsd/h/file.h10 /*11 * Descriptor table entry.12 * One for each kernel object.13 */14 structfile {15 int f_flag; /* see below */16 short f_type; /* descriptor type */17 short f_count; /* reference count */18 short f_msgcount; /* references from message queue */19 struct fileops {20 int (*fo_rw)();21 int (*fo_ioctl)();22 int (*fo_select)();23 int (*fo_close)();24 } *f_ops;25 caddr_t f_data; /* inode */26 off_t f_offset;27 };2813/6/15 10時49分 23
  24. 24. fp->fopsの値13/6/15 10時49分 24
  25. 25. 4.2bsd/sys/sys_socket.c25 int soo_rw(), soo_ioctl(), soo_select(), soo_close();26 struct fileops socketops =27 { soo_rw, soo_ioctl, soo_select, soo_close };2829 soo_rw(fp, rw, uio)30 struct file *fp;31 enum uio_rw rw;32 struct uio *uio;33 {34 int soreceive(), sosend();3536 return (37 (*(rw==UIO_READ?soreceive:sosend))38 ((struct socket *)fp->f_data, 0, uio, 0, 0));39 }13/6/15 10時49分 25
  26. 26. 4.2bsd/sys/sys_inode.c27 int ino_rw(), ino_ioctl(), ino_select(), ino_close();28 struct fileops inodeops =29 { ino_rw, ino_ioctl, ino_select, ino_close };3031 ino_rw(fp, rw, uio)32 struct file *fp;33 enum uio_rw rw;34 struct uio *uio;35 {36 register struct inode *ip = (struct inode *)fp->f_data;37 int error;3839 if ((ip->i_mode&IFMT) == IFREG) {40 ILOCK(ip);41 if (fp->f_flag&FAPPEND && rw == UIO_WRITE)42 uio->uio_offset = fp->f_offset = ip->i_size;43 error = rwip(ip, uio, rw);44 IUNLOCK(ip);45 } else46 error = rwip(ip, uio, rw);47 return (error);48 }4913/6/15 10時49分 26
  27. 27. 4.2bsd/sys/sys_inode.c78 rwip(ip, uio, rw)79 register struct inode *ip;80 register struct uio *uio;81 enum uio_rw rw;82 {126 do {127 lbn = uio->uio_offset / bsize;128 on = uio->uio_offset % bsize;129 n = MIN((unsigned)(bsize - on), uio->uio_resid);130 if (type != IFBLK) {131 if (rw == UIO_READ) {132 int diff = ip->i_size - uio->uio_offset;133 if (diff <= 0)134 return (0);135 if (diff < n)136 n = diff;137 }138 bn = fsbtodb(fs,139 bmap(ip, lbn, rw == UIO_WRITE ? B_WRITE: B_READ, (int)(on+n)));140 if (u.u_error || rw == UIO_WRITE && (long)bn<0)141 return (u.u_error);142 if (rw == UIO_WRITE && uio->uio_offset + n > ip->i_size &&143 (type == IFDIR || type == IFREG || type == IFLNK))144 ip->i_size = uio->uio_offset + n;145 size = blksize(fs, ip, lbn);146 } else {147 bn = lbn * (BLKDEV_IOSIZE/DEV_BSIZE);148 rablock = bn + (BLKDEV_IOSIZE/DEV_BSIZE);149 rasize = size = bsize;150 }13/6/15 10時49分 27
  28. 28. 4.2bsd/sys/ufs_bmap.c28 bmap(ip, bn, rwflg, size)29 register struct inode *ip;30 daddr_t bn;31 int rwflg;32 int size; /* supplied only when rwflg == B_WRITE */33 {34 register int i;35 int osize, nsize;36 struct buf *bp, *nbp;37 struct fs *fs;38 int j, sh;39 daddr_t nb, lbn, *bap, pref, blkpref();4045 fs = ip->i_fs;46 rablock = 0;47 rasize = 0; /* conservative */4849 /*50 * If the next write will extend the file into a new block,51 * and the file is currently composed of a fragment52 * this fragment has to be extended to be a full block.53 */54 nb = lblkno(fs, ip->i_size);55 if (rwflg == B_WRITE && nb < NDADDR && nb < bn) {56 osize = blksize(fs, ip, nb);57 if (osize < fs->fs_bsize && osize > 0) {58 bp = realloccg(ip, ip->i_db[nb],59 blkpref(ip, nb, (int)nb, &ip->i_db[0]),60 osize, (int)fs->fs_bsize);61 if (bp == NULL)62 return ((daddr_t)-1);63 ip->i_size = (nb + 1) * fs->fs_bsize;64 ip->i_db[nb] = dbtofsb(fs, bp->b_blkno);65 ip->i_flag |= IUPD|ICHG;66 bdwrite(bp);67 }68 }13/6/15 10時49分 28
  29. 29. 4.2bsd/sys/ufs_alloc.c107 struct buf *108 realloccg(ip, bprev, bpref, osize, nsize)109 register struct inode *ip;110 daddr_t bprev, bpref;111 int osize, nsize;112 {139 cg = dtog(fs, bprev);140 bno = fragextend(ip, cg, (long)bprev, osize, nsize);141 if (bno != 0) {142 do {143 bp = bread(ip->i_dev, fsbtodb(fs, bno), osize);144 if (bp->b_flags & B_ERROR) {145 brelse(bp);146 return (NULL);147 }148 } while (brealloc(bp, nsize) == 0);149 bp->b_flags |= B_DONE;150 bzero(bp->b_un.b_addr + osize, (unsigned)nsize - osize);151 ip->i_blocks += btodb(nsize - osize);152 ip->i_flag |= IUPD|ICHG;153 return (bp);154 }155 if (bpref >= fs->fs_size)156 bpref = 0;13/6/15 10時49分 29
  30. 30. 4.2bsd/sys/ufs_alloc.c481 fragextend(ip, cg, bprev, osize, nsize)482 struct inode *ip;483 int cg;484 long bprev;485 int osize, nsize;486 {510 bno = dtogd(fs, bprev);511 for (i = numfrags(fs, osize); i < frags; i++)512 if (isclr(cgp->cg_free, bno + i)) {513 brelse(bp);514 return (NULL);515 }516 /*517 * the current fragment can be extended518 * deduct the count on fragment being extended into519 * increase the count on the remaining fragment (if any)520 * allocate the extended piece521 */522 for (i = frags; i < fs->fs_frag - bbase; i++)523 if (isclr(cgp->cg_free, bno + i))524 break;525 cgp->cg_frsum[i - numfrags(fs, osize)]--;526 if (i != frags)527 cgp->cg_frsum[i - frags]++;528 for (i = numfrags(fs, osize); i < frags; i++) {529 clrbit(cgp->cg_free, bno + i);530 cgp->cg_cs.cs_nffree--;531 fs->fs_cstotal.cs_nffree--;532 fs->fs_cs(fs, cg).cs_nffree--;533 }534 fs->fs_fmod++;535 bdwrite(bp);536 return (bprev);537 }13/6/15 10時49分 30
  31. 31. 4.2bsd/h/param.h160 /*161 * bit map related macros162 */163 #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))164 #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))165 #define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))166 #define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)13/6/15 10時49分 31
  32. 32. 4.2bsd/h/fs.h/*230 * Cylinder group block for a file system.231 */232 #define CG_MAGIC 0x090255233 struct cg {234 struct cg *cg_link; /* linked list of cyl groups */235 struct cg *cg_rlink; /* used for incore cyl groups */236 time_t cg_time; /* time last written */237 long cg_cgx; /* we are the cgxth cylinder group */238 short cg_ncyl; /* number of cyls this cg */239 short cg_niblk; /* number of inode blocks this cg */240 long cg_ndblk; /* number of data blocks this cg */241 struct csum cg_cs; /* cylinder summary information */242 long cg_rotor; /* position of last used block */243 long cg_frotor; /* position of last used frag */244 long cg_irotor; /* position of last used inode */245 long cg_frsum[MAXFRAG]; /* counts of available frags */246 long cg_btot[MAXCPG]; /* block totals per cylinder */247 short cg_b[MAXCPG][NRPOS]; /* positions of free blocks */248 char cg_iused[MAXIPG/NBBY]; /* used inode map */249 long cg_magic; /* magic number */250 u_char cg_free[1]; /* free block map */251 /* actually longer */252 };13/6/15 10時49分 32
  33. 33. 4.2bsd/h/fs.h129 /*130 * Super block for a file system.131 */132 #define FS_MAGIC 0x011954133 struct fs134 {135 struct fs *fs_link; /* linked list of file systems */136 struct fs *fs_rlink; /* used for incore super blocks */137 daddr_t fs_sblkno; /* addr of super-block in filesys */138 daddr_t fs_cblkno; /* offset of cyl-block in filesys */139 daddr_t fs_iblkno; /* offset of inode-blocks in filesys */140 daddr_t fs_dblkno; /* offset of first data after cg */141 long fs_cgoffset; /* cylinder group offset in cylinder */142 long fs_cgmask; /* used to calc mod fs_ntrak */143 time_t fs_time; /* last time written */144 long fs_size; /* number of blocks in fs */145 long fs_dsize; /* number of data blocks in fs */146 long fs_ncg; /* number of cylinder groups */147 long fs_bsize; /* size of basic blocks in fs */148 long fs_fsize; /* size of frag blocks in fs */149 long fs_frag; /* number of frags in a block in fs */150 /* these are configuration parameters */154 /* these fields can be computed from the others */159 /* these are configuration parameters */162 /* these fields can be computed from the others */173 /* sizes determined by number of cylinder groups and their sizes */177 /* these fields should be derived from the hardware */181 /* this comes from the disk driver partitioning */183 /* these fields can be computed from the others */187 /* this data must be re-computed after crashes */189 /* these fields are cleared at mount time */195 /* these fields retain the current block allocation info */202 /* actually longer */203 };13/6/15 10時49分 33
  34. 34. 媒体配置の改善 その2• Cylinder Groupによる、シーク時間の改善– Diskの大容量化、CPUの高速化でシーク時間の影響が増大– 1つのファイルには可能な限り近傍のブロックを集めたい→Cylinder Group13/6/15 10時49分 34
  35. 35. DataInodeCylinder groupFS FFSdata blocksInode blocksStruct inode[]Super blockBoot blockSuper blockBoot blockCylinder groupDataInodeCylinder groupFreeListはbitmap管理13/6/15 10時49分 35
  36. 36. h/inode.h14 struct inode {15 struct inode *i_chain[2]; /* must be first */16 u_short i_flag;17 u_short i_count; /* reference count */18 dev_t i_dev; /* device where inode resides */19 u_short i_shlockc; /* count of shared locks on inode */20 u_short i_exlockc; /* count of exclusive locks on inode */21 ino_t i_number; /* i number, 1-to-1 with device address */22 struct fs *i_fs; /* file sys associated with this inode */23 struct dquot *i_dquot; /* quota structure controlling this file */24 union {25 daddr_t if_lastr; /* last read (read-ahead) */26 struct socket *is_socket;27 struct {28 struct inode *if_freef; /* free list forward */29 struct inode **if_freeb; /* free list back */30 } i_fr;31 } i_un;32 struct icommon33 {34 u_short ic_mode; /* 0: mode and type of file */35 short ic_nlink; /* 2: number of links to file */36 short ic_uid; /* 4: owners user id */37 short ic_gid; /* 6: owners group id */38 quad ic_size; /* 8: number of bytes in file */39 time_t ic_atime; /* 16: time last accessed */40 long ic_atspare;41 time_t ic_mtime; /* 24: time last modified */42 long ic_mtspare;43 time_t ic_ctime; /* 32: last time inode changed */44 long ic_ctspare;45 daddr_t ic_db[NDADDR]; /* 40: disk block addresses */46 daddr_t ic_ib[NIADDR]; /* 88: indirect blocks */47 long ic_flags; /* 100: status, currently unused */48 long ic_blocks; /* 104: blocks actually held */49 long ic_spare[5]; /* 108: reserved, currently unused */50 } i_ic;51 };5253 struct dinode {54 union {55 struct icommon di_icom;56 char di_size[128];57 } di_un;58 };inodeicommonstruct dinode =struct icommon13/6/15 10時49分 36
  37. 37. Disk inode FSとFFSの違いFSのdisk inode5605 struct inode5606 {5607 int i_mode;5608 char i_nlink;5609 char i_uid;5610 char i_gid;5611 char i_size0;5612 char *i_size1;5613 int i_addr[8];5614 int i_atime[2];5615 int i_mtime[2];5616 };FFSのdisk inode32 struct icommon33 {34 u_short ic_mode; /* 0: mode and type of file */35 short ic_nlink; /* 2: number of links to file */36 short ic_uid; /* 4: owners user id */37 short ic_gid; /* 6: owners group id */38 quad ic_size; /* 8: number of bytes in file */39 time_t ic_atime; /* 16: time last accessed */40 long ic_atspare;41 time_t ic_mtime; /* 24: time last modified */42 long ic_mtspare;43 time_t ic_ctime; /* 32: last time inode changed */44 long ic_ctspare;45 daddr_t ic_db[NDADDR]; /* 40: disk block addresses */46 daddr_t ic_ib[NIADDR]; /* 88: indirect blocks */47 long ic_flags; /* 100: status, currently unused */48 long ic_blocks; /* 104: blocks actually held */49 long ic_spare[5]; /* 108: reserved, currently unused */50 } i_ic;13/6/15 10時49分 37
  38. 38. 4.3BSD-RENOに見るVNODE13/6/15 10時49分 38
  39. 39. FS,FFSの上位構造fd = open()プロセスprocuser15個file[NFILE]u_ofile[NOFILE]inode[NINODE]i_numberi_numberキャッシュバッファ媒体手続きnameirwip13/6/15 10時49分 39
  40. 40. 異なるFSを利用するには?• FS毎に異なる構造・手続き– inodeの管理– 名前の管理– ブロックの管理• VNODEの登場– Incore InodeからFS依存部を取り除き、Inodeの操作手続きを内包13/6/15 10時49分 40
  41. 41. VNODEの役割fd = open()プロセスprocuser15個fileu_ofile[NOFILE]vnodei_numberi_numberキャッシュバッファFSTYPE手続きVOP_LOOKUPVOP_READVOP_WRITEFSTYPE13/6/15 10時49分 41
  42. 42. Inode操作とvnode操作の違い4.2bsd/sys/sys_inode.c50 rdwri(rw, ip, base, len, offset, segflg, aresid)51 struct inode *ip;52 caddr_t base;53 int len, segflg;54 off_t offset;55 int *aresid;56 enum uio_rw rw;57 {58 struct uio auio;59 struct iovec aiov;60 int error;6162 auio.uio_iov = &aiov;63 auio.uio_iovcnt = 1;64 aiov.iov_base = base;65 aiov.iov_len = len;66 auio.uio_resid = len;67 auio.uio_offset = offset;68 auio.uio_segflg = segflg;69 error = rwip(ip, &auio, rw);70 if (aresid)71 *aresid = auio.uio_resid;72 else73 if (auio.uio_resid)74 error = EIO;75 return (error);76 }4.3bsd_reno/kern/vfs_vnops.c157 vn_rdwr(rw, vp, base, len, offset, segflg, ioflg, cred, aresid)158 enum uio_rw rw;159 struct vnode *vp;160 caddr_t base;161 int len;162 off_t offset;163 enum uio_seg segflg;164 int ioflg;165 struct ucred *cred;166 int *aresid;167 {168 struct uio auio;169 struct iovec aiov;170 int error;171172 if ((ioflg & IO_NODELOCKED) == 0)173 VOP_LOCK(vp);174 auio.uio_iov = &aiov;175 auio.uio_iovcnt= 1;176 aiov.iov_base = base;177 aiov.iov_len = len;178 auio.uio_resid = len;179 auio.uio_offset = offset;180 auio.uio_segflg = segflg;181 auio.uio_rw = rw;182 if (rw == UIO_READ)183 error = VOP_READ(vp, &auio, ioflg, cred);184 else185 error = VOP_WRITE(vp,&auio, ioflg, cred);186 if (aresid)187 *aresid = auio.uio_resid;188 else189 if (auio.uio_resid && error == 0)190 error = EIO;191 if ((ioflg & IO_NODELOCKED) == 0)192 VOP_UNLOCK(vp);193 return (error);194 }13/6/15 10時49分 42
  43. 43. VNODEの背景• NFSの登場– 4.3BSD Renoは公開プロトコルを利用した独自実装を取り込んだ• read(2)->read()->vn_rdwr()->VOP_READ(vp)– vpがNFSのvnodeならnfs_read()が– vpがUSFのvnodeならufs_read()が呼び出される13/6/15 10時49分 43
  44. 44. 以上13/6/15 10時49分 44

×