summaryrefslogtreecommitdiff
path: root/fs.c
diff options
context:
space:
mode:
authorrsc <rsc>2007-08-24 22:17:54 +0000
committerrsc <rsc>2007-08-24 22:17:54 +0000
commit8d2e9a4867c21f1ff84b78cd82f386394d768b3a (patch)
treedfd1fe01a481434fa247d6ad587a05f5b80dd7ae /fs.c
parentd7b44dbcfc6c0eec97c60832409f75fc64444d1d (diff)
downloadxv6-labs-8d2e9a4867c21f1ff84b78cd82f386394d768b3a.tar.gz
xv6-labs-8d2e9a4867c21f1ff84b78cd82f386394d768b3a.tar.bz2
xv6-labs-8d2e9a4867c21f1ff84b78cd82f386394d768b3a.zip
shuffle for formatting
Diffstat (limited to 'fs.c')
-rw-r--r--fs.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/fs.c b/fs.c
index eef20e8..1256937 100644
--- a/fs.c
+++ b/fs.c
@@ -247,6 +247,7 @@ iunlockput(struct inode *ip)
iput(ip);
}
+//PAGEBREAK!
// Allocate a new inode with the given type on device dev.
struct inode*
ialloc(uint dev, short type)
@@ -295,6 +296,7 @@ iupdate(struct inode *ip)
brelse(bp);
}
+//PAGEBREAK!
// Inode contents
//
// The contents (data) associated with each inode is stored
@@ -522,6 +524,7 @@ dirlink(struct inode *dp, char *name, uint ino)
return 0;
}
+//PAGEBREAK!
// Paths
// Copy the next path element from path into name.
@@ -560,6 +563,21 @@ skipelem(char *path, char *name)
return path;
}
+static struct inode* _namei(char*, int, char*);
+
+struct inode*
+namei(char *path)
+{
+ char name[DIRSIZ];
+ return _namei(path, 0, name);
+}
+
+struct inode*
+nameiparent(char *path, char *name)
+{
+ return _namei(path, 1, name);
+}
+
// Look up and return the inode for a path name.
// If parent is set, return the inode for the parent
// and write the final path element to name, which
@@ -602,15 +620,3 @@ _namei(char *path, int parent, char *name)
return ip;
}
-struct inode*
-namei(char *path)
-{
- char name[DIRSIZ];
- return _namei(path, 0, name);
-}
-
-struct inode*
-nameiparent(char *path, char *name)
-{
- return _namei(path, 1, name);
-}