diff options
author | Damien Zammit <damien@zamaudio.com> | 2021-03-09 00:04:56 +1100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-03-08 22:17:03 +0100 |
commit | b261eb886e4ee068515484727955e416517a03b4 (patch) | |
tree | edf55004020d488a008e1cd8ab70a94724e89094 /pci-arbiter/pcifs.c | |
parent | a5fc9f2e767f034830ee5b179123b093180bf259 (diff) | |
download | hurd-b261eb886e4ee068515484727955e416517a03b4.tar.gz hurd-b261eb886e4ee068515484727955e416517a03b4.tar.bz2 hurd-b261eb886e4ee068515484727955e416517a03b4.zip |
pci-arbiter: Introduce machdev into this server
* pci-arbiter/Makefile
Add machdev lib and simplify
* pci-arbiter/main.c
(pci_device_{open,close,shutdown}): New methods
(netfs_server_func): Thread the demuxer loop
(pcifs_startup): Custom startup method
(main): Use machdev for server and detach worker threads
* pci-arbiter/options.{c,h}
Add disk-server-task and priv ports
* pci-arbiter/startup-ops.c
Delete file
Message-Id: <20210308130457.693821-4-damien@zamaudio.com>
Diffstat (limited to 'pci-arbiter/pcifs.c')
-rw-r--r-- | pci-arbiter/pcifs.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/pci-arbiter/pcifs.c b/pci-arbiter/pcifs.c index e09bdd13..699d5942 100644 --- a/pci-arbiter/pcifs.c +++ b/pci-arbiter/pcifs.c @@ -92,20 +92,11 @@ alloc_file_system (struct pcifs ** fs) } error_t -init_file_system (file_t underlying_node, struct pcifs * fs) +init_root_node (void) { - error_t err; struct node *np; io_statbuf_t *underlying_node_stat = &underlying_stat; - if (underlying_node) - { - /* Initialize status from underlying node. */ - err = io_stat (underlying_node, underlying_node_stat); - if (err) - return err; - } - np = netfs_make_node_alloc (sizeof (struct netnode)); if (!np) return ENOMEM; @@ -120,19 +111,29 @@ init_file_system (file_t underlying_node, struct pcifs * fs) fshelp_touch (&np->nn_stat, TOUCH_ATIME | TOUCH_MTIME | TOUCH_CTIME, pcifs_maptime); + netfs_root_node = np; + return 0; +} + +error_t +init_file_system (struct pcifs * fs) +{ + error_t err; + struct node *np = netfs_root_node; + fs->entries = calloc (1, sizeof (struct pcifs_dirent)); if (!fs->entries) - { - return ENOMEM; - } + return ENOMEM; /* Create the root entry */ err = create_dir_entry (-1, -1, -1, -1, -1, "", 0, np->nn_stat, np, 0, fs->entries); + if (err) + return err; fs->num_entries = 1; - fs->root = netfs_root_node = np; + fs->root = np; fs->root->nn->ln = fs->entries; pthread_mutex_init (&fs->node_cache_lock, 0); pthread_mutex_init (&fs->pci_conf_lock, 0); |