Changeset 4224ef7 in mainline for uspace/srv/vfs/vfs_ops.c


Ignore:
Timestamp:
2019-08-06T18:18:37Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
e55741e
Parents:
dd5c623
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-05-11 16:50:40)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-06 18:18:37)
Message:

sysman: Add VFS FS server autostart

  • VFS autostart instrumentation removes explicit dependency on FS servers.
  • Compositor service properly named, it's now resolved as implicit dependency.

Conflicts:

boot/Makefile.common
uspace/lib/gui/window.c
uspace/srv/locsrv/locsrv.c
uspace/srv/vfs/vfs.c
uspace/srv/vfs/vfs_ops.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_ops.c

    rdd5c623 r4224ef7  
    137137        while (true) {
    138138                fs_handle = fs_name_to_handle(instance, fsname, false);
     139                if (!fs_handle) {
     140                        if ((flags & IPC_FLAG_AUTOSTART)) {
     141                                /*
     142                                 * Temporarily release the lock, we don't need it while
     143                                 * waiting for start request (which may lead to deadlock).
     144                                 */
     145                                fibril_mutex_unlock(&fs_list_lock);
     146                                rc = vfs_fs_request_start(fs_name, instance);
     147                                fibril_mutex_lock(&fs_list_lock);
     148
     149                                if (rc != EOK) {
     150                                        fibril_mutex_unlock(&fs_list_lock);
     151                                        async_answer_0(callid, rc);
     152                                        async_answer_0(rid, rc);
     153                                        free(mp);
     154                                        free(fs_name);
     155                                        free(opts);
     156                                        return;
     157                                }
     158                                /*
     159                                 * Succesful start request, new server should be
     160                                 * registered.
     161                                 */
     162                                continue;
     163                        }
     164                }
    139165
    140166                if (fs_handle != 0 || !(flags & VFS_MOUNT_BLOCKING))
     
    188214
    189215        return EOK;
     216}
     217
     218static int vfs_fs_request_start(const char *fs_name, unsigned int instance)
     219{
     220        char *unit_name = NULL;
     221
     222        assert(instance == 0);
     223        /*
     224         * Unit name is made simply by considering service of the same name as
     225         * given FS name.
     226         * TODO instance identifier is not implemented.
     227         */
     228        asprintf(&unit_name, "%s%c%s", fs_name, UNIT_NAME_SEPARATOR,
     229            UNIT_SVC_TYPE_NAME);
     230        if (unit_name == NULL) {
     231                return ENOMEM;
     232        }
     233
     234        int rc = sysman_unit_start(unit_name, IPC_FLAG_BLOCKING);
     235
     236        free(unit_name);
     237        return rc;
    190238}
    191239
Note: See TracChangeset for help on using the changeset viewer.