3413bd92e7
* There's no distinction between "temp" and "perm" nodes anymore. All nodes are allocated with 1 reference belonging to the vfs_alloc() caller. * VFSNode pointers retrieved by any API that returns one (most notably vfs_locate) are guaranteed to have exactly one reference belonging to the caller. What this means is that you must always decref them when you're done using them. If you're implementing such an API (e.g. a custom locate), remember to incref any persistent nodes you return. * Passing a VFSNode* to anything that successfully consumes one (for example, vfs_mount) transfers ownership of the reference to the consumer. In other words, consumers do not incref your nodes, but they will decref them once they don't need them anymore. If you want to keep the node around, then you must incref it first. * Bunch of other stuff. "Ownership" is an abstract concept in this context. Basically it just means "cleanup responsibility".
11 lines
349 B
C
11 lines
349 B
C
/*
|
|
* This software is licensed under the terms of the MIT-License
|
|
* See COPYING for further information.
|
|
* ---
|
|
* Copyright (c) 2011-2017, Lukas Weber <laochailan@web.de>.
|
|
* Copyright (c) 2012-2017, Andrei Alexeyev <akari@alienslab.net>.
|
|
*/
|
|
|
|
#include <stdbool.h>
|
|
|
|
bool vfs_mount_syspath(const char *mountpoint, const char *fspath, bool mkdir);
|