code: mafs

Download patch

ref: 2076600fa398182a04e0500e47abe963f5c66de3
parent: 0fe95aafc8e3a9cc0348793f8ab458790efdb6e3
author: 9ferno <gophone2015@gmail.com>
date: Mon Oct 31 18:59:40 EDT 2022

cleaned up the man pages

--- a/TODO
+++ b/TODO
@@ -18,3 +18,8 @@
 make docs/mafs.ms more interesting?
 test -A announce
 Split out the Free Blocks - Extents section in the document.
+Add a section on sizing npendingwrites
+Clean up the Iobuf locking description
+man/mafs.4 man/mafs.8
+	Add EXAMPLES
+	Add mafs.pdf as a resource
--- a/docs/mafs.ms
+++ b/docs/mafs.ms
@@ -11,7 +11,7 @@
 Mafs - Plan 9 userspace file system
 .ft R
 .sp
-Mafs wants you to be able to understand it, so you can be self-sufficient and fix a crash at two in the morning or satisfy your desire for speed or a feature. This empowerment is priceless for those with skin in the game.
+Mafs wants you to be able to understand it, so you can be self-sufficient and fix a crash at two in the morning or satisfy your need for speed or a feature. This empowerment is priceless for those with skin in the game.
 .sp
 Mafs is a user space file system to provide system stability and security. It is based on kfs.
 .sp
@@ -1111,7 +1111,7 @@
 .sp
 A Chan's state could get out of sync with the contents if another process changes the on-disk state. Ephase error occurs when that happens.
 .sp
-For throughput, multiple processes are used to service 9p i/o requests.
+For throughput, multiple processes are used to service 9p i/o requests when the -s flag is not used.
 .sp
 .sp
 .ne 4
@@ -1126,7 +1126,7 @@
 .in 3n
 .br
 	-s: use stdin and stdout for communication
-	-r myservice: ream the disk using mafs_myservice as the service name
+	-r mafs_myservice: ream the disk using mafs_myservice as the service name
 	-h 10: use 10 hash buckets
 	 mydisk: running Mafs on the mydisk
 .in 0
@@ -1145,7 +1145,7 @@
 	dd -if /dev/zero -of myfile -bs 512 -count 128 # 64KB file
 	mount -c <{disk/mafs -s -r mafs_service -h 10  myfile <[0=1]} /n/mafs_myservice
 
-	# for reusing the contents of myfile later, remove -r (ream).
+	# to reuse the contents of myfile later, remove -r (ream) from the above command.
 	mount -c <{disk/mafs -s -h 10  myfile <[0=1]} /n/mafs_myservice
 .fi
 .sp
--- a/mafs.c
+++ b/mafs.c
@@ -33,7 +33,7 @@
 static void
 usage(void)
 {
-	fprint(2, "usage: mafs [-Ds] [-r service] [-n service] [-h nbuckets] [-w npendingwrites] [-m nmemunits] [-a announce-string]... fsfile\n");
+	fprint(2, "usage: mafs [-Ds] [-r service] [-n service] [-m nmemunits] [-h nbuckets] [-w npendingwrites] [-a announce-string]... file\n");
 	exits("usage");
 }
 
--- a/man/mafs.4
+++ b/man/mafs.4
@@ -4,24 +4,27 @@
 .SH SYNOPSIS
 .B mafs
 [
-.B -D
+.B -Ds
 ] [
-.B -f
-.I file
+.B -n
+.I service
 ] [
+.B -r
+.I service
+] [
+.B -m
+.I nmemunits
+] [
 .B -h
 .I nbuckets
 ] [
-.B -n
-.I name TODO
+.B -w
+.I npendingwrites
 ] [
 .B -a
 .I announce-string
-] ... [
--r
-] [
-.B -s
 ]
+.B file
 .SH DESCRIPTION
 .I Mafs
 is a user space file server on a single partition.
@@ -29,29 +32,43 @@
 The options are:
 .TF "n name"
 .TP
-.BI "-f " file
+.I file
 Use
 .I file
 as the disk.
 .TP
+.BI "-n " service
+Use
+.I service
+as the name of the service instead of the
+.I service
+provide with -r, just for this run. mafs posts the file /srv/service that can be used to mount this filesystem.
+.TP
+.BI "-r " service
+Ream the file system, erasing all of the old data. Use
+.I service
+as the name of the service. mafs posts the file /srv/service that can be used to mount this filesystem.
+.TP
+.B -s
+Read and write protocol messages on standard file descriptors zero and one.
+.TP
+.BI "-m " nmemunits
+Allocate
+.I nbuckets
+hash buckets to use for Iobuf cache. Each bucket links into a least recently used circular linked list of Iobuf's.
+.TP
 .BI "-h " nbuckets
 Allocate
 .I nbuckets
 hash buckets to use for Iobuf cache. Each bucket links into a least recently used circular linked list of Iobuf's.
 .TP
-.BI "-n " name
-Use
-.I name
-as the name of the service.
+.BI "-w " npendingwrites
+Allocate
+.I nbuckets
+hash buckets to use for Iobuf cache. Each bucket links into a least recently used circular linked list of Iobuf's.
 .TP
 .BI "-a " announce-string
 will announce and listen on the specified network address.
-.TP
-.B -r
-Ream the file system, erasing all of the old data.
-.TP
-.B -s
-Read and write protocol messages on standard file descriptors zero and one.
 .PD
 .SH SOURCE
 .B /sys/src/cmd/mafs
@@ -59,7 +76,5 @@
 .IR mafs (8),
 .IR prep (8),
 .IR sd (3)
-.SH BUGS
-.LP
-.I Mafs
-is a work in progress.
+.br
+Mafs - Plan 9 userspace file system
--- a/man/mafs.8
+++ b/man/mafs.8
@@ -4,49 +4,24 @@
 .SH SYNOPSIS
 .PD 0
 .PP
-.B chatty
-.PP
-.B df
-.PP
-.B echo
-.RB [on | off]
-.PP
 .B halt
 .PP
 .B sync
+.sp
 .PP
 .B newuser
 .I name
 .RI [ options ]
-.PP
-.B users
 .SH DESCRIPTION
-The following commands should be written to /adm/ctl of a
+Reading /adm/ctl prints the number of free, used and total blocks/megabytes. The following commands should be written to /adm/ctl of a
 .IR mafs (4)
 file server.
 .PP
-.I Chatty
-enables chatty 9p.
-.PP
-.I Df
-prints the number of free, used and total blocks/megabytes.
-.PP
-.I Echo
-expects the argument
-.I on
-or
-.I off.
-.I  On
-causes all executed commands to be printed on the system console.
-.I Off
-reverses the effects of
-.I on.
-.PP
 .I Halt
-exits the program.
+stops the mafs service after pending writes to the disk are completed.
 .PP
 .I Sync
-writes dirty blocks in memory to the magnetic disk cache.
+blocks until all the pending writes to the disk are completed.
 .sp
 .PP
 The following commands should be written to /adm/users of a
@@ -108,22 +83,15 @@
 command the file server overwrites
 .B /adm/users
 to reflect the internal state of the user table.
-.PP
-.I Users
-reads the contents of file 
-.B /adm/users
-to initialize the file server's internal representation of the
-users structure.
 .SH EXAMPLES
-Check disk usage (output appears on the system console).
+Check disk usage (traditional df) of a mafs mounted at /n/mafs_myservice.
 .IP
 .EX
-% echo df >>/adm/ctl
+% cat /n/mafs_myservice/adm/ctl
 .EE
 .SH SEE ALSO
 .IR mafs (4)
+.br
+Mafs - Plan 9 userspace file system
 .SH SOURCE
 .B /sys/src/cmd/mafs
-.SH BUGS
-.B WIP
-still a work in progress.