# HG changeset patch # User Paul Boddie # Date 1587157639 -7200 # Node ID 979295a97cf9280d7ae182d26022707de7fc36b3 # Parent 416bbed39c537927e5a7463d457c888887c2e3ed Introduced opener context usage to make the VFS server work again. diff -r 416bbed39c53 -r 979295a97cf9 server/src/main.cc --- a/server/src/main.cc Sun Mar 01 21:04:55 2020 +0100 +++ b/server/src/main.cc Fri Apr 17 23:07:19 2020 +0200 @@ -1,7 +1,7 @@ /* * Access several filesystems. * - * Copyright (C) 2018, 2019 Paul Boddie + * Copyright (C) 2018, 2019, 2020 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -90,20 +90,32 @@ return L4_EOK; } + /* Obtain a context. */ + + err = fs_context(&desc); + + if (err) + return err; + /* Find the path within the selected filesystem. */ + strcpy(desc.cobj.buffer, fsobj->buffer); + /* Propagate the message to the identified filesystem. The L4_MSGTAG_PROPAGATE flag is not supported by Fiasco.OC, so this object has to act as intermediary. */ - err = fs_getfs(&desc); + err = fs_context_getfs(&desc); if (err) + { + fsdesc_deallocate_context(&desc); return err; + } - /* Free the capabilities and buffer from this task. */ + /* Free the context and its buffer from this task. */ - fsdesc_deallocate_object(fsobj); + fsdesc_deallocate_context(&desc); /* Export and eventually free the server reference from this task. */ @@ -127,10 +139,6 @@ mount_at_path(fs, path); - /* Free the capability and buffer from this task. */ - - fsdesc_deallocate_buffer(fsobj); - return L4_EOK; } @@ -148,20 +156,32 @@ if (err) return err; + /* Obtain a context. */ + + err = fs_context(&desc); + + if (err) + return err; + /* Find the path within the selected filesystem. */ + strcpy(desc.cobj.buffer, fsobj->buffer); + /* Propagate the message to the identified filesystem. The L4_MSGTAG_PROPAGATE flag is not supported by Fiasco.OC, so this object has to act as intermediary. */ - err = fs_open(&desc, flags); + err = fs_context_open(&desc, flags); if (err) + { + fsdesc_deallocate_context(&desc); return err; + } - /* Free the capabilities and buffer from this task. */ + /* Free the context and its buffer from this task. */ - fsdesc_deallocate_object(fsobj); + fsdesc_deallocate_context(&desc); /* Export and eventually free the server reference from this task. */ @@ -179,13 +199,9 @@ long init_desc(file_descriptor_t *desc, fs_object_t *obj) { - /* Copy the object details into the descriptor. */ - - desc->obj = *obj; - /* Match the path to a mountpoint. */ - char *path = fsdesc_get_name(&desc->obj); + char *path = fsdesc_get_name(obj); if (path == NULL) return -L4_EINVAL;