1.1 --- a/libfsserver/lib/files/ext2_file_opener.cc Fri Jul 16 00:40:22 2021 +0200
1.2 +++ b/libfsserver/lib/files/ext2_file_opener.cc Sun Jul 18 00:47:14 2021 +0200
1.3 @@ -26,13 +26,15 @@
1.4
1.5 /* Return a file identifier for the given 'path'. */
1.6
1.7 -fileid_t Ext2FileOpener::get_fileid(const char *path)
1.8 +fileid_t Ext2FileOpener::get_fileid(const char *path, flags_t flags)
1.9 {
1.10 /* Obtain the inode number. */
1.11
1.12 ext2_ino_t ino;
1.13 errcode_t retval = image_find_path(_fs, &path, &ino);
1.14
1.15 + // NOTE: Support file creation.
1.16 +
1.17 if (retval)
1.18 return FILEID_INVALID;
1.19
1.20 @@ -41,17 +43,20 @@
1.21
1.22 /* Return a new accessor for 'fileid'. */
1.23
1.24 -Accessor *Ext2FileOpener::make_accessor(const char *path, fileid_t fileid)
1.25 +long Ext2FileOpener::make_accessor(const char *path, flags_t flags, fileid_t fileid, Accessor **accessor)
1.26 {
1.27 - (void) path;
1.28 + (void) path; (void) flags;
1.29
1.30 ext2_file_t file;
1.31 errcode_t retval = ext2fs_file_open(_fs, (ext2_ino_t) fileid, EXT2_FILE_WRITE, &file);
1.32
1.33 + // NOTE: Map error conditions.
1.34 +
1.35 if (retval)
1.36 - return NULL;
1.37 + return -L4_EIO;
1.38
1.39 - return new Ext2FileAccessor(file, fileid);
1.40 + *accessor = new Ext2FileAccessor(file, fileid);
1.41 + return L4_EOK;
1.42 }
1.43
1.44 // vim: tabstop=4 expandtab shiftwidth=4