summaryrefslogtreecommitdiff
path: root/fs.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2014-08-04 13:06:48 -0400
committerRobert Morris <[email protected]>2014-08-04 13:06:48 -0400
commit2c56547272e43b483d560a61692f1e24926a82fb (patch)
tree514014c69ff9cfe2a67159b9a3f514a3a619aea6 /fs.c
parent020c8e2384877ffc13579f633ac3c723f80baf8c (diff)
downloadxv6-labs-2c56547272e43b483d560a61692f1e24926a82fb.tar.gz
xv6-labs-2c56547272e43b483d560a61692f1e24926a82fb.tar.bz2
xv6-labs-2c56547272e43b483d560a61692f1e24926a82fb.zip
every iput() and namei() must be inside a transaction
Diffstat (limited to 'fs.c')
-rw-r--r--fs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs.c b/fs.c
index 9d6dfd1..7621d08 100644
--- a/fs.c
+++ b/fs.c
@@ -314,6 +314,8 @@ iunlock(struct inode *ip)
// be recycled.
// If that was the last reference and the inode has no links
// to it, free the inode (and its content) on disk.
+// All calls to iput() must be inside a transaction in
+// case it has to free the inode.
void
iput(struct inode *ip)
{
@@ -601,6 +603,7 @@ skipelem(char *path, char *name)
// Look up and return the inode for a path name.
// If parent != 0, return the inode for the parent and copy the final
// path element into name, which must have room for DIRSIZ bytes.
+// Must be called inside a transaction since it calls iput().
static struct inode*
namex(char *path, int nameiparent, char *name)
{