1 /* 2 * A resource supporting the creation of user-specific ext2 filesystem opener 3 * resources. 4 * 5 * Copyright (C) 2021 Paul Boddie <paul@boddie.org.uk> 6 * 7 * This program is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU General Public License as 9 * published by the Free Software Foundation; either version 2 of 10 * the License, or (at your option) any later version. 11 * 12 * This program is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 * Boston, MA 02110-1301, USA 21 */ 22 23 #pragma once 24 25 #include <ext2fs/ext2fs.h> 26 27 #include <fsserver/filesystem_resource.h> 28 29 30 31 /* Support for providing access to user-specific filesystems. */ 32 33 class Ext2Filesystem : public FilesystemResource 34 { 35 protected: 36 ext2_filsys _fs; 37 38 public: 39 explicit Ext2Filesystem(Pages *pages, ext2_filsys fs) 40 : FilesystemResource(pages), _fs(fs) 41 { 42 } 43 44 /* Filesystem interface methods. */ 45 46 virtual long open_for_user(sys_uid_t uid, sys_gid_t gid, sys_mode_t umask, 47 l4_cap_idx_t *opener); 48 }; 49 50 // vim: tabstop=4 expandtab shiftwidth=4