summaryrefslogtreecommitdiff
path: root/fs.c
diff options
context:
space:
mode:
authorkaashoek <kaashoek>2006-08-14 14:13:52 +0000
committerkaashoek <kaashoek>2006-08-14 14:13:52 +0000
commitbdb66433031ca96f2fd127995186623cd10c45b3 (patch)
tree037ffd2021f27718fba32c27cacd9ca52682b613 /fs.c
parentd15f0d1033a7da6448966d9626ec2776781e4188 (diff)
downloadxv6-labs-bdb66433031ca96f2fd127995186623cd10c45b3.tar.gz
xv6-labs-bdb66433031ca96f2fd127995186623cd10c45b3.tar.bz2
xv6-labs-bdb66433031ca96f2fd127995186623cd10c45b3.zip
set size for directories correctly in wdir and mkfs
mkdir ls shows stat info for each dir entry
Diffstat (limited to 'fs.c')
-rw-r--r--fs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs.c b/fs.c
index cf717a2..2370e0e 100644
--- a/fs.c
+++ b/fs.c
@@ -355,7 +355,8 @@ writei(struct inode *ip, char *addr, uint off, uint n)
}
if (r > 0) {
if (off > ip->size) {
- ip->size = off;
+ if (ip->type == T_DIR) ip->size = ((off / BSIZE) + 1) * BSIZE;
+ else ip->size = off;
}
iupdate(ip);
}