code: mafs

Download patch

ref: 6c33d034afbc80bce4cb1caa9102672b051eb89f
parent: b5d191e8cfa4fac05a02ea309df2541a2652ff23
author: 9ferno <gophone2015@gmail.com>
date: Thu Nov 10 17:08:34 EST 2022

cleanup obsolete code

--- a/9p.c
+++ b/9p.c
@@ -1036,7 +1036,6 @@
 	default:
 		return;
 	}
-	procname = name;
 	snprint(name, 16, "%s worker %d", service, id);
 	procsetname(name);
 	work(b, id);
--- a/TODO
+++ b/TODO
@@ -1,11 +1,12 @@
+test exclusive use file access
 mafswrite():
 	add user and remove user messages
 	users format has changed as per this http://9p.io/wiki/plan9/Setting_up_Fossil/index.html
-APPEND files
 profiling
 read only mode
 need rlock() when looking up user id, group id, or user attributes
 Clean up the Iobuf locking description?
+APPEND files
 
 not a priority, are they even needed?
 -------------------------------------
--- a/dat.h
+++ b/dat.h
@@ -89,19 +89,13 @@
 typedef	struct	Content	Content;
 typedef	struct	Dentry1	Dentry1;
 typedef	struct	Dentry	Dentry;
-typedef	struct	Fblock	Fblock;
 typedef struct	Qid9p1	Qid9p1;
-typedef	union	Rabuf	Rabuf;
 typedef	struct	Super1	Super1;
 typedef	struct	Superb	Superb;
 typedef	struct	Tag	Tag;
+typedef	struct	Tlock	Tlock;
 typedef	struct	User	User;
 typedef struct	Aux Aux;
-typedef struct	Log Log;
-
-typedef	struct	P9call	P9call;
-typedef	struct	Tlock	Tlock;
-typedef	struct	Uid	Uid;
 
 /*
  * DONT TOUCH -- data structures stored on disk
--- a/mafs.c
+++ b/mafs.c
@@ -1,18 +1,6 @@
 #include	"all.h"
 #include	"pool.h"
 
-int	sfd;
-int	cmdmode = 0660;
-int	rfd;
-int	chat;
-
-Uid*	uid;
-char*	uidspace;
-short*	gidspace;
-RWLock	mainlock;
-Tlock	*tlocks;
-char	*procname;
-
 char *devfile = nil;	/* device file path */
 char service[Namelen] = "\0";
 u8	noauth = 0;
@@ -44,8 +32,6 @@
 	int pid, ctl;
 	u64 nmemunits, size;
 
-	procname = "init";
-
 	/* mainmem->flags |= POOL_PARANOIA|POOL_LOGGING; */
 
 	/*
@@ -56,7 +42,6 @@
 	nbuckets = 0;
 	npendingwrites = 0;
 	nmemunits = 0;
-	sfd = -1;
 	doream = stdio = 0;
 
 	pid = getpid();
--- a/mfs.c
+++ b/mfs.c
@@ -1,18 +1,6 @@
 #include	"all.h"
 #include	"pool.h"
 
-int	sfd;
-int	cmdmode = 0660;
-int	rfd;
-int	chat;
-
-Uid*	uid;
-char*	uidspace;
-short*	gidspace;
-RWLock	mainlock;
-Tlock	*tlocks;
-char	*procname;
-
 char *devfile = nil;	/* device file path */
 char service[Namelen] = "\0";
 u8	noauth = 0;
@@ -43,8 +31,6 @@
 	int pid, ctl;
 	u64 nmemunits, size;
 
-	procname = "init";
-
 	/* mainmem->flags |= POOL_PARANOIA|POOL_LOGGING; */
 
 	/*
@@ -54,7 +40,6 @@
 
 	nbuckets = 0;
 	nmemunits = 0;
-	sfd = -1;
 	doream = stdio = 0;
 
 	pid = getpid();
--- a/writer.c
+++ b/writer.c
@@ -293,7 +293,6 @@
 	default:
 		return;
 	}
-	procname = name;
 	snprint(name, Namelen, "%s writer", service);
 	procsetname(name);
 	while(stopwrites == 0 || drts.n > 0){