Commit graph

89 commits

Author SHA1 Message Date
Russ Cox
48755214c9 assorted fixes:
* rename c/cp to cpu/proc
 * rename cpu.context to cpu.scheduler
 * fix some comments
 * formatting for printout
2009-08-30 23:02:08 -07:00
Russ Cox
0aef891495 shuffle and tweak for formatting.
pdf has very good page breaks now.
would be a good copy for fall 2009.
2009-08-08 01:07:30 -07:00
Russ Cox
f9a06440ab rearrangements and cleanup for text 2009-07-11 19:26:01 -07:00
rsc
34295f461a group locks into structs they protect.
few naming nits.
2009-05-31 05:12:21 +00:00
rsc
ce72cadbe0 fix bug fix 2009-05-31 01:53:08 +00:00
rsc
13ae8808c4 tidy fs.c; bmap callers always expected allocation 2009-05-31 01:44:20 +00:00
rsc
f12551b599 inode reuse bug.
Suppose an inode has been used and freed.
It is left marked I_VALID (the bug).
Now ialloc comes along and reuses the
inode.  It writes the new inode type to disk
and returns iget(dev, inum) to get the
cache entry.  Iget sees that the inode is valid
and doesn't bother refreshing from disk.
Now when the caller iupdates, it will write
out a zero type and the file or directory has
disappeared.
2009-05-31 01:34:46 +00:00
rsc
ba6cd8a685 drop NADDRS and INDIRECT; too many names 2009-05-31 00:59:37 +00:00
rtm
8eb20827c2 Explain why itrunc() is OK w.r.t. crashes. 2008-10-20 18:05:48 +00:00
kolya
e1626709d6 free the indirect block 2008-10-16 15:00:23 +00:00
rtm
2ce40d7088 be clear what the root i-number is 2008-10-08 18:57:13 +00:00
rsc
bf2932a686 final nits 2007-08-28 19:39:49 +00:00
rsc
5516be1fed spaces around else for rtm 2007-08-28 18:37:41 +00:00
rsc
e4d6a21165 more consistent spacing 2007-08-28 18:32:08 +00:00
rsc
d844f0f9d9 Change dev read/write functions
to take inode* instead of minor number.

Unlock console inode during console_read
and console_write.  Otherwise background
processes cannot write to console while the
shell is reading it waiting for input.
2007-08-28 17:49:49 +00:00
rsc
3341e30f6e nit 2007-08-28 04:13:24 +00:00
rsc
8970df0c1b No one is going to find this inode.
There is only one ref to it -- the caller --
and no links to it.
2007-08-28 03:31:11 +00:00
rsc
558ab49f13 delete unnecessary #include lines 2007-08-27 23:26:33 +00:00
rsc
7895178df3 nits 2007-08-27 14:31:50 +00:00
rsc
6c34f97cb8 tell what an inode is 2007-08-27 14:23:48 +00:00
rsc
a505fd6651 FS cleanup.
Add utility routines bzero, readsb so that balloc, bfree fit on one page.
Make balloc loop clearer.
2007-08-27 14:20:24 +00:00
rsc
8d2e9a4867 shuffle for formatting 2007-08-24 22:17:54 +00:00
rsc
766ba5cc06 first ever correct use of strncpy 2007-08-24 21:00:02 +00:00
rsc
07090dd705 Remove struct uinode.
Remove type arg to mknod (assume T_DEV).
2007-08-24 20:54:23 +00:00
rsc
4d39b63388 nits 2007-08-24 19:46:19 +00:00
rtm
902b13f5d6 simplify ide queuing
nits in comments
2007-08-24 19:32:36 +00:00
rtm
2036534834 add missing iput() at end of _namei() 2007-08-24 14:56:17 +00:00
rsc
f0721f1be4 tweaks 2007-08-22 06:20:10 +00:00
rsc
eaea18cb9c PDF at http://am.lcs.mit.edu/~rsc/xv6.pdf
Various changes made while offline.

 + bwrite sector argument is redundant; use b->sector.
 + reformatting of files for nicer PDF page breaks
 + distinguish between locked, unlocked inodes in type signatures
 + change FD_FILE to FD_INODE
 + move userinit (nee proc0init) to proc.c
 + move ROOTDEV to param.h
 + always parenthesize sizeof argument
2007-08-22 06:01:32 +00:00
rsc
fbf9103952 remove namelen parameter 2007-08-21 19:58:55 +00:00
rsc
f32f3638f4 Various cleanup:
- Got rid of dummy proc[0].  Now proc[0] is init.
 - Added initcode.S to exec /init, so that /init is
   just a regular binary.
 - Moved exec out of sysfile to exec.c
 - Moved code dealing with fs guts (like struct inode)
   from sysfile.c to fs.c.  Code dealing with system call
   arguments stays in sysfile.c
 - Refactored directory routines in fs.c; should be simpler.
 - Changed iget to return *unlocked* inode structure.
   This solves the lookup-then-use race in namei
   without introducing deadlocks.
   It also enabled getting rid of the dummy proc[0].
2007-08-21 19:22:08 +00:00
rsc
e2a620da49 checkpoint - simpler namei interface 2007-08-20 19:37:15 +00:00
rsc
bcca6c6bde shuffle fs.c in bottom-up order 2007-08-20 18:23:52 +00:00
rsc
7d4aef6cfd various cleanups 2007-08-10 16:52:31 +00:00
rsc
b6095304b7 Make cp a magic symbol. 2007-08-10 16:37:27 +00:00
rsc
bc01170334 The final curproc[cpu()] is now cp 2007-08-09 19:06:37 +00:00
rsc
ab5c2dbb59 Clearer namei 2007-08-09 19:05:00 +00:00
rsc
95c07f8267 move ialloc body up, avoiding double check for end of loop 2007-08-08 09:53:46 +00:00
rsc
32eea7665a panic like bget 2007-08-08 09:50:46 +00:00
rsc
d80b06a1e0 iincref returns new ref 2007-08-08 09:30:42 +00:00
rsc
5f0c20ec14 fix . .. unlink bug 2007-08-08 09:08:29 +00:00
kaashoek
8e1d1ec934 some comment changes 2006-09-08 14:36:44 +00:00
rsc
be29b8e263 ++ 2006-09-08 14:26:16 +00:00
rsc
d911d83ca1 fix various comments 2006-09-08 13:55:43 +00:00
rsc
1542186378 allow long names again 2006-09-07 15:34:28 +00:00
rsc
0d6bbd3172 clean namei search loop 2006-09-07 15:15:32 +00:00
rsc
bb207a1d42 comments 2006-09-07 14:28:12 +00:00
rsc
1dca3afbbb remove _ prefixes 2006-09-07 13:08:23 +00:00
rsc
0cfc7290e8 wrap long lines 2006-09-06 19:08:14 +00:00
rsc
db8fb62e4d for vs while 2006-09-06 18:47:51 +00:00