From: Ben Pfaff Date: Tue, 21 Jun 2005 00:53:01 +0000 (+0000) Subject: Update patch. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0229b2e73dec29d59ed80ff236501064a5824acb;p=pintos-anon Update patch. --- diff --git a/solutions/p4.patch b/solutions/p4.patch index 2cc4d97..d481c70 100644 --- a/solutions/p4.patch +++ b/solutions/p4.patch @@ -1532,7 +1532,7 @@ diff -u src/filesys/inode.c~ src/filesys/inode.c /* Closes INODE and writes it to disk. If this was the last reference to INODE, frees its memory. If INODE was also a removed inode, frees its blocks. */ -@@ -158,18 +181,59 @@ inode_close (struct inode *inode) +@@ -158,21 +181,60 @@ inode_close (struct inode *inode) return; /* Release resources if this was the last opener. */ @@ -1542,13 +1542,16 @@ diff -u src/filesys/inode.c~ src/filesys/inode.c /* Remove from inode list and release lock. */ list_remove (&inode->elem); + lock_release (&open_inodes_lock); - + /* Deallocate blocks if removed. */ - if (inode->removed) -- free_map_release (inode->sector, -- bytes_to_sectors (inode->data.length)); -- + if (inode->removed) +- { +- free_map_release (inode->sector, 1); +- free_map_release (inode->data.start, +- bytes_to_sectors (inode->data.length)); +- } + deallocate_inode (inode); + free (inode); } + else