9fans archive / 1996 / 05 / 25 / prev next
From: Nickolay Saukh nms@nns.ru
Subject: Small patch for kfs to show free space on disk
Date: Thu, 9 May 1996 18:22:44 -0400
Here is small patch for /sys/src/cmd/disk/kfs/con.c which allows
to get the following numbers from kfs
number of free blocks
file system size in blocks
block size
Don't forget rebuild kernel (9pcdisk for PCs).
---------- cut here to destroy your CRT ----------
417a
"free", cmd_free, "",
.
408a
void
cmd_free(void)
{
Iobuf *p;
Superb *s;
p = getbuf(cur_fs->dev, superaddr(cur_fs->dev), Bread);
s = (Superb*) p->iobuf;
cprint("%ld %ld %d\n", s->tfree, s->fsize, RBUFSIZE);
putbuf(p);
}
.
---------- cut here to destroy your CRT ----------