1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/libfsserver/lib/files/ext2_filesystem.cc Sat Jul 24 18:55:21 2021 +0200
1.3 @@ -0,0 +1,40 @@
1.4 +/*
1.5 + * A resource supporting the creation of user-specific ext2 filesystem opener
1.6 + * resources.
1.7 + *
1.8 + * Copyright (C) 2021 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 + * published by the Free Software Foundation; either version 2 of
1.13 + * the License, or (at your option) any later version.
1.14 + *
1.15 + * This program is distributed in the hope that it will be useful,
1.16 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.17 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.18 + * GNU General Public License for more details.
1.19 + *
1.20 + * You should have received a copy of the GNU General Public License
1.21 + * along with this program; if not, write to the Free Software
1.22 + * Foundation, Inc., 51 Franklin Street, Fifth Floor,
1.23 + * Boston, MA 02110-1301, USA
1.24 + */
1.25 +
1.26 +#include "ext2_file_opener.h"
1.27 +#include "ext2_filesystem.h"
1.28 +#include "resource_server.h"
1.29 +
1.30 +/* Return a file opener object for the given user. */
1.31 +
1.32 +long Ext2Filesystem::open_for_user(sys_uid_t uid, sys_gid_t gid,
1.33 + sys_mode_t umask, l4_cap_idx_t *ref)
1.34 +{
1.35 + Resource *resource = new Ext2FileOpener(this, _fs, uid, gid, umask);
1.36 +
1.37 + /* Complete the initialisation and start a server in a new thread.
1.38 + If the thread does not start, the resource will be finalised. */
1.39 +
1.40 + return ResourceServer(resource).start_thread(ref);
1.41 +}
1.42 +
1.43 +// vim: tabstop=4 expandtab shiftwidth=4