gefs: remove nokill code

After discussion, it was suggested that it might make more
sense to handle the noswap stuff outside of gefs, like
with any other fileserver.

plan9 file-servers are not privileged. one might even run
them in a test script to mount an image.
This commit is contained in:
cinap_lenrek 2024-11-23 17:37:07 +00:00
parent 4ed03dff93
commit a77fd25d90
3 changed files with 2 additions and 21 deletions

View file

@ -118,4 +118,4 @@ if(test -e /cfg/$sysname/cpustart)
# mode of /proc/*/ctl is inherited across rfork, and sets modes on # mode of /proc/*/ctl is inherited across rfork, and sets modes on
# other /proc files, such as note, so let listen be killed. # other /proc files, such as note, so let listen be killed.
dontkill '^(9660srv|cfs|cs|cwfs.*|disk|dns|dossrv|ether|factotum|hjfs|ipconfig|kb|kfs|mntgen|paqfs|reboot|usbd|venti|wpa)$' dontkill '^(9660srv|cfs|cs|cwfs.*|disk|dns|dossrv|ether|factotum|gefs|hjfs|ipconfig|kb|kfs|mntgen|paqfs|reboot|usbd|venti|wpa)$'

View file

@ -96,4 +96,4 @@ if(~ $terminal *reform*){
reform/audio reform/audio
} }
dontkill '^(9660srv|cfs|cs|cwfs.*|disk|dns|dossrv|ether|factotum|hjfs|ipconfig|kb|kfs|mntgen|paqfs|reboot|usbd|venti|wpa)$' dontkill '^(9660srv|cfs|cs|cwfs.*|disk|dns|dossrv|ether|factotum|gefs|hjfs|ipconfig|kb|kfs|mntgen|paqfs|reboot|usbd|venti|wpa)$'

View file

@ -47,23 +47,6 @@ _trace(char *msg, Bptr bp, vlong v0, vlong v1)
t->v1 = v1; t->v1 = v1;
} }
static void
nokill(void)
{
char buf[128];
int fd;
snprint(buf, sizeof(buf), "/proc/%d/ctl", getpid());
if((fd = open(buf, OWRITE)) == -1){
fprint(2, "nokill: open %s: %r", buf);
return;
}
if(fprint(fd, "noswap\n") == -1){
fprint(2, "nokill: write %s: %r", buf);
return;
}
}
static uvlong static uvlong
memsize(void) memsize(void)
{ {
@ -216,7 +199,6 @@ launch(void (*f)(int, void *), void *arg, char *text)
if (pid < 0) if (pid < 0)
sysfatal("can't fork: %r"); sysfatal("can't fork: %r");
if (pid == 0) { if (pid == 0) {
nokill();
id = aincl(&fs->nworker, 1); id = aincl(&fs->nworker, 1);
if((*errctx = mallocz(sizeof(Errctx), 1)) == nil) if((*errctx = mallocz(sizeof(Errctx), 1)) == nil)
sysfatal("malloc: %r"); sysfatal("malloc: %r");
@ -408,7 +390,6 @@ main(int argc, char **argv)
} }
rfork(RFNOTEG); rfork(RFNOTEG);
nokill();
loadfs(dev); loadfs(dev);
fs->wrchan = mkchan(32); fs->wrchan = mkchan(32);
fs->admchan = mkchan(32); fs->admchan = mkchan(32);