]> Devi Nivas Git - cs3210-lab1.git/commitdiff
fs comment nits
authorRobert Morris <rtm@csail.mit.edu>
Tue, 8 Aug 2017 17:24:38 +0000 (13:24 -0400)
committerRobert Morris <rtm@csail.mit.edu>
Tue, 8 Aug 2017 17:24:38 +0000 (13:24 -0400)
fs.c

diff --git a/fs.c b/fs.c
index f27ae6fa39d523ee96c70797daf5d62520b9512c..a0634e485eb32b10a361a40e940ab3e78e66d53d 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -112,20 +112,20 @@ bfree(int dev, uint b)
 // inodes include book-keeping information that is
 // not stored on disk: ip->ref and ip->flags.
 //
-// An inode and its in-memory represtative go through a
+// An inode and its in-memory representation go through a
 // sequence of states before they can be used by the
 // rest of the file system code.
 //
 // * Allocation: an inode is allocated if its type (on disk)
-//   is non-zero. ialloc() allocates, iput() frees if
-//   the link count has fallen to zero.
+//   is non-zero. ialloc() allocates, and iput() frees if
+//   the reference and link counts have fallen to zero.
 //
 // * Referencing in cache: an entry in the inode cache
 //   is free if ip->ref is zero. Otherwise ip->ref tracks
 //   the number of in-memory pointers to the entry (open
-//   files and current directories). iget() to find or
-//   create a cache entry and increment its ref, iput()
-//   to decrement ref.
+//   files and current directories). iget() finds or
+//   creates a cache entry and increments its ref; iput()
+//   decrements ref.
 //
 // * Valid: the information (type, size, &c) in an inode
 //   cache entry is only correct when the I_VALID bit
@@ -283,7 +283,7 @@ ilock(struct inode *ip)
 
   acquiresleep(&ip->lock);
 
-  if(!(ip->flags & I_VALID)){
+  if((ip->flags & I_VALID) == 0){
     bp = bread(ip->dev, IBLOCK(ip->inum, sb));
     dip = (struct dinode*)bp->data + ip->inum%IPB;
     ip->type = dip->type;