diff options
author | Robert Morris <[email protected]> | 2017-08-08 13:26:57 -0400 |
---|---|---|
committer | Robert Morris <[email protected]> | 2017-08-08 13:26:57 -0400 |
commit | aba8423c4a5ae01828040d04f668f07ec544dcd0 (patch) | |
tree | 97fa68d61c7ba04c4343f7a7e29d709a6392d685 | |
parent | 9cec455b17984431af5d652758743f36f810c37f (diff) | |
download | xv6-labs-aba8423c4a5ae01828040d04f668f07ec544dcd0.tar.gz xv6-labs-aba8423c4a5ae01828040d04f668f07ec544dcd0.tar.bz2 xv6-labs-aba8423c4a5ae01828040d04f668f07ec544dcd0.zip |
frans' fixes to iput()
-rw-r--r-- | fs.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -322,12 +322,14 @@ iput(struct inode *ip) acquire(&icache.lock); if(ip->ref == 1 && (ip->flags & I_VALID) && ip->nlink == 0){ // inode has no links and no other references: truncate and free. + acquiresleep(&ip->lock); release(&icache.lock); itrunc(ip); ip->type = 0; iupdate(ip); acquire(&icache.lock); ip->flags = 0; + releasesleep(&ip->lock); } ip->ref--; release(&icache.lock); |