1.1 --- a/server/src/main.cc Sun Mar 01 21:04:55 2020 +0100
1.2 +++ b/server/src/main.cc Fri Apr 17 23:07:19 2020 +0200
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * Access several filesystems.
1.6 *
1.7 - * Copyright (C) 2018, 2019 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2018, 2019, 2020 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -90,20 +90,32 @@
1.13 return L4_EOK;
1.14 }
1.15
1.16 + /* Obtain a context. */
1.17 +
1.18 + err = fs_context(&desc);
1.19 +
1.20 + if (err)
1.21 + return err;
1.22 +
1.23 /* Find the path within the selected filesystem. */
1.24
1.25 + strcpy(desc.cobj.buffer, fsobj->buffer);
1.26 +
1.27 /* Propagate the message to the identified filesystem.
1.28 The L4_MSGTAG_PROPAGATE flag is not supported by Fiasco.OC, so this
1.29 object has to act as intermediary. */
1.30
1.31 - err = fs_getfs(&desc);
1.32 + err = fs_context_getfs(&desc);
1.33
1.34 if (err)
1.35 + {
1.36 + fsdesc_deallocate_context(&desc);
1.37 return err;
1.38 + }
1.39
1.40 - /* Free the capabilities and buffer from this task. */
1.41 + /* Free the context and its buffer from this task. */
1.42
1.43 - fsdesc_deallocate_object(fsobj);
1.44 + fsdesc_deallocate_context(&desc);
1.45
1.46 /* Export and eventually free the server reference from this task. */
1.47
1.48 @@ -127,10 +139,6 @@
1.49
1.50 mount_at_path(fs, path);
1.51
1.52 - /* Free the capability and buffer from this task. */
1.53 -
1.54 - fsdesc_deallocate_buffer(fsobj);
1.55 -
1.56 return L4_EOK;
1.57 }
1.58
1.59 @@ -148,20 +156,32 @@
1.60 if (err)
1.61 return err;
1.62
1.63 + /* Obtain a context. */
1.64 +
1.65 + err = fs_context(&desc);
1.66 +
1.67 + if (err)
1.68 + return err;
1.69 +
1.70 /* Find the path within the selected filesystem. */
1.71
1.72 + strcpy(desc.cobj.buffer, fsobj->buffer);
1.73 +
1.74 /* Propagate the message to the identified filesystem.
1.75 The L4_MSGTAG_PROPAGATE flag is not supported by Fiasco.OC, so this
1.76 object has to act as intermediary. */
1.77
1.78 - err = fs_open(&desc, flags);
1.79 + err = fs_context_open(&desc, flags);
1.80
1.81 if (err)
1.82 + {
1.83 + fsdesc_deallocate_context(&desc);
1.84 return err;
1.85 + }
1.86
1.87 - /* Free the capabilities and buffer from this task. */
1.88 + /* Free the context and its buffer from this task. */
1.89
1.90 - fsdesc_deallocate_object(fsobj);
1.91 + fsdesc_deallocate_context(&desc);
1.92
1.93 /* Export and eventually free the server reference from this task. */
1.94
1.95 @@ -179,13 +199,9 @@
1.96
1.97 long init_desc(file_descriptor_t *desc, fs_object_t *obj)
1.98 {
1.99 - /* Copy the object details into the descriptor. */
1.100 -
1.101 - desc->obj = *obj;
1.102 -
1.103 /* Match the path to a mountpoint. */
1.104
1.105 - char *path = fsdesc_get_name(&desc->obj);
1.106 + char *path = fsdesc_get_name(obj);
1.107
1.108 if (path == NULL)
1.109 return -L4_EINVAL;