ref: a296aa4ac06f282fd5383ed04224c4911c26e8dd
parent: ae88f14a80cadce73bbe2a7320f2831c2828ce4d
author: 9ferno <gophone2015@gmail.com>
date: Sun Nov 13 00:17:06 EST 2022
update document with users informaton
--- a/docs/mafs.ms
+++ b/docs/mafs.ms
@@ -299,8 +299,8 @@
box height fieldht invis "qid.version 0"
box height fieldht invis "qid.path 64"
box height fieldht invis "size 0"
- box height fieldht invis "pdblkno 3"
- box height fieldht invis "pqpath 63"
+ box height fieldht invis "pdblkno 19"
+ box height fieldht invis "pqpath 19"
box height fieldht invis "mtime 1653302180819962729"
box height fieldht invis "mode 20000000777"
box height fieldht invis "uid 10006"
@@ -307,7 +307,7 @@
box height fieldht invis "gid -1"
box height fieldht invis "muid 10006"
box height fieldht invis "direct blocks"
- box height fieldht invis " 0 19"
+ box height fieldht invis " 0 21"
box height fieldht invis " 1 0"
box height fieldht invis " 2 0"
box height fieldht invis "."
@@ -323,7 +323,7 @@
box height fieldht invis " 4 0"
box height fieldht invis " 5 0"
box height fieldht invis "name dir1"
- "Block 18 contents: /dir1 Dentry" at Bound.nw + 0,0.1i ljust
+ "Block 20 contents: /dir1 Dentry" at Bound.nw + 0,0.1i ljust
"Representation of a file in a directory: /dir1/file1" ljust at Bound.n + 0,0.3i
}
move 4*boxwid
@@ -335,7 +335,7 @@
box height fieldht invis "qid.version 0"
box height fieldht invis "qid.path 65"
box height fieldht invis "size 5"
- box height fieldht invis "pdblkno 18"
+ box height fieldht invis "pdblkno 20"
box height fieldht invis "pqpath 64"
box height fieldht invis "mtime 1653302180823455071"
box height fieldht invis "mode 666"
@@ -343,7 +343,7 @@
box height fieldht invis "gid -1"
box height fieldht invis "muid 10006"
box height fieldht invis "direct blocks"
- box height fieldht invis " 0 20"; {"content is in Block 20" at last box.e + 1i,0 ljust}
+ box height fieldht invis " 0 22"; {"content is in Block 22" at last box.e + 1i,0 ljust}
box height fieldht invis " 1 0"
box height fieldht invis " 2 0"
box height fieldht invis "."
@@ -359,13 +359,13 @@
box height fieldht invis " 4 0"
box height fieldht invis " 5 0"
box height fieldht invis "name file1"
- "Block 19 contents: file1 Dentry" at Bound.nw + 0,0.1i ljust
+ "Block 21 contents: file1 Dentry" at Bound.nw + 0,0.1i ljust
}
.PE
.sp
-Contents of block 20 are:
+Contents of block 22 are:
.nf
- disk/block tests/test.1/disk 20
+ disk/block tests/test.9/disk 22
Tdata 65
test
.fi
@@ -379,8 +379,8 @@
box height fieldht invis "qid.version 0"
box height fieldht invis "qid.path 66"
box height fieldht invis "size 0"
- box height fieldht invis "pdblkno 3"
- box height fieldht invis "pqpath 63"
+ box height fieldht invis "pdblkno 19"
+ box height fieldht invis "pqpath 19"
box height fieldht invis "mtime 1653302180819962729"
box height fieldht invis "mode 20000000777"
box height fieldht invis "uid 10006"
@@ -387,8 +387,8 @@
box height fieldht invis "gid -1"
box height fieldht invis "muid 10006"
box height fieldht invis "direct blocks"
- box height fieldht invis " 0 22"
- box height fieldht invis " 1 24"
+ box height fieldht invis " 0 24"
+ box height fieldht invis " 1 26"
box height fieldht invis "."
box height fieldht invis "."
box height fieldht invis "."
@@ -398,7 +398,7 @@
box height fieldht invis "."
box height fieldht invis " 5 0"
box height fieldht invis "name dir2"
- "Block 21 contents: /dir2 directory entry" at Bound.nw + 0,0.1i ljust
+ "Block 23 contents: /dir2 directory entry" at Bound.nw + 0,0.1i ljust
"Representation of two files in a directory (/dir2/file1 and /dir2/file2)" ljust at Bound.nw + 0.2,0.3i
}
move 4*boxwid
@@ -410,7 +410,7 @@
box height fieldht invis "qid.version 0"
box height fieldht invis "qid.path 67"
box height fieldht invis "size 5"
- box height fieldht invis "pdblkno 21"
+ box height fieldht invis "pdblkno 23"
box height fieldht invis "pqpath 66"
box height fieldht invis "mtime 1653302180823455071"
box height fieldht invis "mode 666"
@@ -418,7 +418,7 @@
box height fieldht invis "gid -1"
box height fieldht invis "muid 10006"
box height fieldht invis "direct blocks"
- box height fieldht invis " 0 23"
+ box height fieldht invis " 0 25"
box height fieldht invis " 1 0"
box height fieldht invis "."
box height fieldht invis "."
@@ -429,7 +429,7 @@
box height fieldht invis "."
box height fieldht invis " 5 0"
box height fieldht invis "name file1"
- "Block 22 contents: file1 directory entry" at Bound.nw + 0,0.1i ljust
+ "Block 24 contents: file1 directory entry" at Bound.nw + 0,0.1i ljust
}
down
move 9*bigboxht
@@ -441,7 +441,7 @@
box height fieldht invis "qid.version 0"
box height fieldht invis "qid.path 68"
box height fieldht invis "size 5"
- box height fieldht invis "pdblkno 21"
+ box height fieldht invis "pdblkno 23"
box height fieldht invis "pqpath 66"
box height fieldht invis "mtime 1653302180823455071"
box height fieldht invis "mode 666"
@@ -449,7 +449,7 @@
box height fieldht invis "gid -1"
box height fieldht invis "muid 10006"
box height fieldht invis "direct blocks"
- box height fieldht invis " 0 25"
+ box height fieldht invis " 0 27"
box height fieldht invis " 1 0"
box height fieldht invis "."
box height fieldht invis "."
@@ -460,7 +460,7 @@
box height fieldht invis "."
box height fieldht invis " 5 0"
box height fieldht invis "name file2"
- "Block 24 contents: file2 directory entry" at Bound.nw + 0,0.1i ljust
+ "Block 26 contents: file2 directory entry" at Bound.nw + 0,0.1i ljust
}
.PE
.sp
@@ -526,7 +526,7 @@
box height fieldht invis "qid.version 0"
box height fieldht invis "qid.path 70"
box height fieldht invis "size 2056192"
- box height fieldht invis "pdblkno 26"
+ box height fieldht invis "pdblkno 28"
box height fieldht invis "pqpath 69"
box height fieldht invis "mtime 1653302180819962729"
box height fieldht invis "mode 20000000777"
@@ -534,18 +534,18 @@
box height fieldht invis "gid -1"
box height fieldht invis "muid 10006"
box height fieldht invis "direct blocks"
- box height fieldht invis " 0 28"
- box height fieldht invis " 1 29"
- box height fieldht invis " 2 30"
+ box height fieldht invis " 0 30"
+ box height fieldht invis " 1 31"
+ box height fieldht invis " 2 32"
box height fieldht invis "."
box height fieldht invis "."
box height fieldht invis "indirect blocks"
- box height fieldht invis " 0 61"
- box height fieldht invis " 1 124"
- box height fieldht invis " 2 4031"
+ box height fieldht invis " 0 63"
+ box height fieldht invis " 1 128"
+ box height fieldht invis " 2 4045"
box height fieldht invis " 3 0"
box height fieldht invis "name 2MB.file"
- "Block 27 contents" at Bound.nw + 0,0.1i ljust
+ "Block 29 contents" at Bound.nw + 0,0.1i ljust
"Representation of a 2 MB file (/dir3/2MB.file)" ljust at Bound.n + 0,0.3i
}
move 4*boxwid
@@ -555,7 +555,7 @@
move 0.1i
box height fieldht invis "Tdata 70"
box height fieldht invis "0 0123456789"; {"contents of 2MB.file" at last box.e + 1i,0 ljust}
- "Block 28 contents" at Bound.nw + 0,0.1i ljust
+ "Block 30 contents" at Bound.nw + 0,0.1i ljust
}
.PE
.PS
@@ -568,27 +568,27 @@
box height fieldht invis "qid.version 0"
box height fieldht invis "qid.path 72"
box height fieldht invis "size 26214400"
- box height fieldht invis "pdblkno 4045"
+ box height fieldht invis "pdblkno 4187"
box height fieldht invis "pqpath 71"
box height fieldht invis "mtime 1653302180819962729"
- box height fieldht invis "mode 20000000777"
+ box height fieldht invis "mode 664"
box height fieldht invis "uid 10006"
box height fieldht invis "gid -1"
box height fieldht invis "muid 10006"
box height fieldht invis "direct blocks"
- box height fieldht invis " 0 4195"
- box height fieldht invis " 1 4196"
- box height fieldht invis " 2 4197"
+ box height fieldht invis " 0 4189"
+ box height fieldht invis " 1 4190"
+ box height fieldht invis " 2 4191"
box height fieldht invis "."
box height fieldht invis "."
- box height fieldht invis " 31 4226"
+ box height fieldht invis " 31 4220"
box height fieldht invis "indirect blocks"
- box height fieldht invis " 0 4228"
- box height fieldht invis " 1 4291"
- box height fieldht invis " 2 8198"
+ box height fieldht invis " 0 4222"
+ box height fieldht invis " 1 4285"
+ box height fieldht invis " 2 8204"
box height fieldht invis " 3 0"
box height fieldht invis "name 25MB.file"
- "Block 4046 contents" at Bound.nw + 0,0.1i ljust
+ "Block 4188 contents" at Bound.nw + 0,0.1i ljust
"Representation of a 25MB file (/dir4/25MB.file)" ljust at Bound.n + 0,0.3i
}
move 4*boxwid
@@ -601,33 +601,33 @@
box height fieldht invis "."; {"of 25MB.file" at last box.e + 1i,0 ljust}
box height fieldht invis "."
box height fieldht invis "."
- "Block 4195 contents" at Bound.nw + 0,0.1i ljust
+ "Block 4189 contents" at Bound.nw + 0,0.1i ljust
}
move to Start - 0,9.5*bigboxht
{
down
- { Bound: box height 6*bigboxht width 3.3*boxwid }
+ { Bound: box height 3*bigboxht width 3.3*boxwid }
move 0.1i
box height fieldht invis "Tind0 72"
- box height fieldht invis " 0 4227"
- box height fieldht invis " 1 4229"
- box height fieldht invis " 2 4230"
+ box height fieldht invis " 0 4221"
+ box height fieldht invis " 1 4223"
+ box height fieldht invis " 2 4224"
box height fieldht invis "."
box height fieldht invis "."
- box height fieldht invis " 61 4289"
- "Block 4228 contents" at Bound.nw + 0,0.1i ljust
+ box height fieldht invis " 61 4283"
+ "Block 4222 contents" at Bound.nw + 0,0.1i ljust
}
right
move 4*boxwid
{
down
- { Bound: box height 4*bigboxht width 3.3*boxwid }
+ { Bound: box height 3*bigboxht width 3.3*boxwid }
move 0.1i
box height fieldht invis "Tdata 72"
- box height fieldht invis "789"; {"more content" at last box.e + 1i,0 ljust}
+ box height fieldht invis "123456789"; {"more content" at last box.e + 1i,0 ljust}
box height fieldht invis "."; {"of 25MB.file" at last box.e + 1i,0 ljust}
box height fieldht invis "."
- "Block 4227 contents" at Bound.nw + 0,0.1i ljust
+ "Block 4221 contents" at Bound.nw + 0,0.1i ljust
}
.PE
.sp
@@ -639,29 +639,30 @@
System Files
=
Block Description Directory entry Content
-_
0 magic
1 config Y
2 super Y
-3 / Y
_
-4 /adm/ Y
-5 /adm/config Y
-6 /adm/super Y
+3 /adm Y
+4 /adm/config Y
+5 /adm/super Y
_
-7 /adm/users Y
-8 /adm/users Y
+6 /adm/bkp/ Y
+7 /adm/bkp/config.0 Y
+8 /adm/bkp/super.0 Y
+9 /adm/bkp/root.0 Y
+10 /adm/bkp/config.1 Y
+11 /adm/bkp/super.1 Y
+12 /adm/bkp/root.1 Y
_
-9 /adm/bkp/ Y
-10 /adm/bkp/config.0 Y
-11 /adm/bkp/super.0 Y
-12 /adm/bkp/root.0 Y
-13 /adm/bkp/config.1 Y
-14 /adm/bkp/super.1 Y
-15 /adm/bkp/root.1 Y
+13 /adm/users Y
+14 /adm/users/inuse Y
+15 /adm/users/inuse Y
_
-16 /adm/ctl (virtual file, empty contents) Y
-17 /adm/frees Y
+16 /adm/frees Y
+17 /adm/ctl (virtual file, empty contents) Y
+18 /adm/users/staging Y
+19 / Y
.TE
.ta 5n 10n 15n 20n 25n 30n 35n 40n 45n 50n 55n 60n 65n 70n 75n 80n
.sp
@@ -697,6 +698,16 @@
kfs and cwfs use 8192 byte blocks. Hence, they store multiple directory entries (Dentry) per block. They use slot numbers to identify a particular directory entry in a block of directory entries. M[a]fs avoids that be using 512 byte blocks thus having only one directory entry per block. This avoids locking up other sibling directory entries on access.
.sp
.sp
+.ne 4
+Users
+.sp
+Users are defined in /adm/users/inuse file. Any changes to it are made through the /adm/users/staging file. All changes are written to the staging file and then inuse file is updated by writing the command users to the /adm/ctl file.
+.sp
+Either all changes to /adm/users/inuse are installed or nothing is installed from the /adm/users/staging file.
+.sp
+The format of /adm/users/inuse is described in users(6).
+.sp
+.sp
.ft B
Buffer cache - Hash buckets with a circular linked list of Iobuf's for collisions.
.ft R
@@ -1185,15 +1196,16 @@
File Description chatty9p
_
9p.c 9p transactions 2
-sub.c initialization and super block related routines. 2
+blk.c routines to show blocks.
+console.c obsolete. /adm/ctl is the console.
+ctl.c /adm/ctl operations.
dentry.c encode/decode the file system abstraction into block operations. 3
-iobuf.c routines on Iobuf's. The bkp() routines operate on Iobuf's. 5
extents.[ch] routines to manage the free blocks. 6
-ctl.c /adm/ctl operations.
+iobuf.c routines on Iobuf's. The bkp() routines operate on Iobuf's. 5
+sub.c initialization and super block related routines. 2
tag.c routines to manage a relative index (reli) in a directory entry.
-blk.c routines to show blocks.
+user.c user management routines.
writer.c disk writer routines.
-console.c obsolete. /adm/ctl is the console.
.TE
.ta 5n 10n 15n 20n 25n 30n 35n 40n 45n 50n 55n 60n 65n 70n 75n 80n
.in 0
@@ -1565,6 +1577,34 @@
14.11 MB/s
echo halt >> /n/mafs_ramafs_file/adm/ctl; lc /srv
unmount /n/ramfs
+
+ dd -if /dev/zero -of /n/ramfs/file -count 700 -bs 1m
+ hjfs -f /n/ramfs/file -r
+ echo allow >>/srv/hjfs.cmd
+ mount -c /srv/hjfs /n/hjfs/
+ cat /dev/zero | tput -p > /n/hjfs/zeros.file
+ 65.18 MB/s
+ 66.13 MB/s
+ 65.97 MB/s
+ 65.91 MB/s
+ 65.81 MB/s
+ 65.60 MB/s
+ 65.38 MB/s
+ 64.38 MB/s
+ 63.36 MB/s
+ 62.66 MB/s
+ 62.09 MB/s
+ 58.63 MB/s
+ 54.77 MB/s
+ 51.46 MB/s
+ 48.60 MB/s
+ 46.09 MB/s
+ 43.88 MB/s
+ 41.91 MB/s
+ 40.15 MB/s
+ 38.56 MB/s
+ 37.13 MB/s
+ 35.82 MB/s
.fi
.sp
.sp
--- a/man/mafs.8
+++ b/man/mafs.8
@@ -7,12 +7,10 @@
.B halt
.PP
.B sync
+.PP
+.B users
.PD
.PP
-.B newuser
-.I name
-.RI [ options ]
-.PP
.B disk/block
.I drive
.I block_number
@@ -50,67 +48,6 @@
.PP
.I Sync
blocks until all the pending writes to the disk are completed.
-.sp
-.PP
-The following commands should be written to /adm/users of a
-.IR mafs (4)
-file server.
-.PP
-.I Newuser
-requires a
-.I name
-argument.
-With no options it adds user
-.IR name ,
-with group leader
-.IR name ,
-to
-.B /adm/users
-and makes the directory
-.BI /usr/ name
-owned by user and group
-.IR name .
-The options are
-.TF =leaderxx
-.TP
-.B :
-Add a group: add the name to
-.B /adm/users
-but don't create the directory.
-By convention, groups are numbered starting from 10000, users from 0.
-.TP
-.I newname
-Rename existing user
-.I name
-to
-.IR newname .
-.TP
-.BI = leader
-Change the leader of
-.I name
-to
-.IR leader .
-If
-.I leader
-is missing, remove the existing leader.
-.TP
-.BI + member
-Add
-.I member
-to the member list of
-.IR name .
-.TP
-.BI - member
-Remove existing
-.I member
-from the member list of
-.IR name .
-.PP
-After a successful
-.I newuser
-command the file server overwrites
-.B /adm/users
-to reflect the internal state of the user table.
.PD
.PP
.I disk/block
--- /dev/null
+++ b/tests/test.9/blocks/29
@@ -1,0 +1,52 @@
+Tdentry 70
+qid.version 0
+qid.path 70
+size 2056192
+pdblkno 28
+pqpath 69
+mtime 1665294406000000000
+mode 664
+uid 10006
+gid -1
+muid 10006
+direct blocks
+ 0 30
+ 1 31
+ 2 32
+ 3 33
+ 4 34
+ 5 35
+ 6 36
+ 7 37
+ 8 38
+ 9 39
+ 10 40
+ 11 41
+ 12 42
+ 13 43
+ 14 44
+ 15 45
+ 16 46
+ 17 47
+ 18 48
+ 19 49
+ 20 50
+ 21 51
+ 22 52
+ 23 53
+ 24 54
+ 25 55
+ 26 56
+ 27 57
+ 28 58
+ 29 59
+ 30 60
+ 31 61
+indirect blocks
+ 0 63
+ 1 128
+ 2 4045
+ 3 0
+ 4 0
+ 5 0
+name 2MB.file
--- /dev/null
+++ b/tests/test.9/blocks/30
@@ -1,0 +1,38 @@
+Tdata 70
+0 0123456789
+1 0123456789
+2 0123456789
+3 0123456789
+4 0123456789
+5 0123456789
+6 0123456789
+7 0123456789
+8 0123456789
+9 0123456789
+10 0123456789
+11 0123456789
+12 0123456789
+13 0123456789
+14 0123456789
+15 0123456789
+16 0123456789
+17 0123456789
+18 0123456789
+19 0123456789
+20 0123456789
+21 0123456789
+22 0123456789
+23 0123456789
+24 0123456789
+25 0123456789
+26 0123456789
+27 0123456789
+28 0123456789
+29 0123456789
+30 0123456789
+31 0123456789
+32 0123456789
+33 0123456789
+34 0123456789
+35 0123456789
+36 012345F
--- /dev/null
+++ b/tests/test.9/blocks/4188
@@ -1,0 +1,52 @@
+Tdentry 72
+qid.version 0
+qid.path 72
+size 26214400
+pdblkno 4187
+pqpath 71
+mtime 1665292864000000000
+mode 664
+uid 10006
+gid -1
+muid 10006
+direct blocks
+ 0 4189
+ 1 4190
+ 2 4191
+ 3 4192
+ 4 4193
+ 5 4194
+ 6 4195
+ 7 4196
+ 8 4197
+ 9 4198
+ 10 4199
+ 11 4200
+ 12 4201
+ 13 4202
+ 14 4203
+ 15 4204
+ 16 4205
+ 17 4206
+ 18 4207
+ 19 4208
+ 20 4209
+ 21 4210
+ 22 4211
+ 23 4212
+ 24 4213
+ 25 4214
+ 26 4215
+ 27 4216
+ 28 4217
+ 29 4218
+ 30 4219
+ 31 4220
+indirect blocks
+ 0 4222
+ 1 4285
+ 2 8204
+ 3 0
+ 4 0
+ 5 0
+name 25MB.file
--- /dev/null
+++ b/tests/test.9/blocks/4189
@@ -1,0 +1,38 @@
+Tdata 72
+0 0123456789
+1 0123456789
+2 0123456789
+3 0123456789
+4 0123456789
+5 0123456789
+6 0123456789
+7 0123456789
+8 0123456789
+9 0123456789
+10 0123456789
+11 0123456789
+12 0123456789
+13 0123456789
+14 0123456789
+15 0123456789
+16 0123456789
+17 0123456789
+18 0123456789
+19 0123456789
+20 0123456789
+21 0123456789
+22 0123456789
+23 0123456789
+24 0123456789
+25 0123456789
+26 0123456789
+27 0123456789
+28 0123456789
+29 0123456789
+30 0123456789
+31 0123456789
+32 0123456789
+33 0123456789
+34 0123456789
+35 0123456789
+36 012345H
--- /dev/null
+++ b/tests/test.9/blocks/4221
@@ -1,0 +1,33 @@
+Tdata 72
+123456789
+1076 0123456789
+1077 0123456789
+1078 0123456789
+1079 0123456789
+1080 0123456789
+1081 0123456789
+1082 0123456789
+1083 0123456789
+1084 0123456789
+1085 0123456789
+1086 0123456789
+1087 0123456789
+1088 0123456789
+1089 0123456789
+1090 0123456789
+1091 0123456789
+1092 0123456789
+1093 0123456789
+1094 0123456789
+1095 0123456789
+1096 0123456789
+1097 0123456789
+1098 0123456789
+1099 0123456789
+1100 0123456789
+1101 0123456789
+1102 0123456789
+1103 0123456789
+1104 0123456789
+1105 0123456789
+1106 01234567H
--- /dev/null
+++ b/tests/test.9/blocks/4222
@@ -1,0 +1,63 @@
+Tind0 72
+ 0 4221
+ 1 4223
+ 2 4224
+ 3 4225
+ 4 4226
+ 5 4227
+ 6 4228
+ 7 4229
+ 8 4230
+ 9 4231
+ 10 4232
+ 11 4233
+ 12 4234
+ 13 4235
+ 14 4236
+ 15 4237
+ 16 4238
+ 17 4239
+ 18 4240
+ 19 4241
+ 20 4242
+ 21 4243
+ 22 4244
+ 23 4245
+ 24 4246
+ 25 4247
+ 26 4248
+ 27 4249
+ 28 4250
+ 29 4251
+ 30 4252
+ 31 4253
+ 32 4254
+ 33 4255
+ 34 4256
+ 35 4257
+ 36 4258
+ 37 4259
+ 38 4260
+ 39 4261
+ 40 4262
+ 41 4263
+ 42 4264
+ 43 4265
+ 44 4266
+ 45 4267
+ 46 4268
+ 47 4269
+ 48 4270
+ 49 4271
+ 50 4272
+ 51 4273
+ 52 4274
+ 53 4275
+ 54 4276
+ 55 4277
+ 56 4278
+ 57 4279
+ 58 4280
+ 59 4281
+ 60 4282
+ 61 4283
--- a/tests/test.9/notes
+++ b/tests/test.9/notes
@@ -25,6 +25,13 @@
20 - /dir1 directory entry
21 - /dir1/file1 directory entry
22 - /dir1/file1 contents
+
+23 - /dir2 directory entry
+24 - /dir2/file1 directory entry
+25 - /dir1/file1 contents
+26 - /dir2/file2 directory entry
+27 - /dir1/file2 contents
+
57162 - /adm/frees contents
65543 - / direntry