projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check for no warnings in grade report.
[pintos-anon]
/
src
/
filesys
/
inode.c
diff --git
a/src/filesys/inode.c
b/src/filesys/inode.c
index bd68167baa1c5c4b2bcfd02c73b99c194e102c87..777138b10f479530cb3daed59c5b331e2af1050a 100644
(file)
--- a/
src/filesys/inode.c
+++ b/
src/filesys/inode.c
@@
-162,11
+162,14
@@
inode_close (struct inode *inode)
{
/* Remove from inode list and release lock. */
list_remove (&inode->elem);
{
/* Remove from inode list and release lock. */
list_remove (&inode->elem);
-
+
/* Deallocate blocks if removed. */
/* 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));
+ }
free (inode);
}
free (inode);
}