9ns: Implement fsync with chan_ctl
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 6 Apr 2018 18:27:02 +0000 (14:27 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Mon, 30 Apr 2018 18:37:05 +0000 (14:37 -0400)
commitf3a56f078eb8f2c2d5e9ef7f48e20c7dc9cb3bc4
tree75934eb7fd0d031dc307d2d7857f08c09271ba08
parent8395010cd0eaf019a3e54ba7bb48f30f3af63a83
9ns: Implement fsync with chan_ctl

If you fsync on a directory, we'll sync the entire FS for the given device.
You can use the sync helper to cause fsyncs.

Note your bind order matters.  If you mount or bind with "-a", it'll be at
the bottom of the union mount list.  You probably want -b.  For example:

$ mount -a -c -C /srv/some_chan /mnt
$ sync /mnt  # this calls #kfs.chan_ctl

That will sync kfs's /mnt, not gtfs's, since both kfs and gtfs have a chan
at /mnt/ that can be opened.

$ mount -b -c -C /srv/some_chan /mnt
$ sync /mnt  # this calls #gtfs.chan_ctl

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/drivers/dev/gtfs.c
kern/drivers/dev/kfs.c
kern/drivers/dev/tmpfs.c
kern/include/ns.h
kern/src/ns/sysfile.c
kern/src/syscall.c
tests/sync.c [new file with mode: 0644]