# HG changeset patch # User Paul Boddie # Date 1644512105 -3600 # Node ID ffd7b371fcfd639212b7f253c848db596efd8cfc # Parent 184132df62ec2966a286ac093f5212c3c1c86e7d Removed file paths from various methods, instead relying on file identifiers. Some operations such as file renaming still need to be aware of file paths because they need to know the parent directories of renamed objects. diff -r 184132df62ec -r ffd7b371fcfd libfsserver/include/fsserver/block_file_opener.h --- a/libfsserver/include/fsserver/block_file_opener.h Wed Feb 09 22:30:29 2022 +0100 +++ b/libfsserver/include/fsserver/block_file_opener.h Thu Feb 10 17:55:05 2022 +0100 @@ -1,7 +1,7 @@ /* * An opener for a file employing a rewritable memory area. * - * Copyright (C) 2021 Paul Boddie + * Copyright (C) 2021, 2022 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -41,7 +41,7 @@ virtual long get_fileid(const char *path, flags_t flags, fileid_t *fileid); - virtual long make_accessor(const char *path, flags_t flags, fileid_t fileid, Accessor **accessor); + virtual long make_accessor(flags_t flags, fileid_t fileid, Accessor **accessor); }; // vim: tabstop=4 expandtab shiftwidth=4 diff -r 184132df62ec -r ffd7b371fcfd libfsserver/include/fsserver/ext2_file_opener.h --- a/libfsserver/include/fsserver/ext2_file_opener.h Wed Feb 09 22:30:29 2022 +0100 +++ b/libfsserver/include/fsserver/ext2_file_opener.h Thu Feb 10 17:55:05 2022 +0100 @@ -40,9 +40,9 @@ /* Convenience methods determining different object types. */ - virtual bool accessing_directory(const char *path, flags_t flags, fileid_t fileid); + virtual bool accessing_directory(flags_t flags, fileid_t fileid); - virtual bool accessing_file(const char *path, flags_t flags, fileid_t fileid); + virtual bool accessing_file(flags_t flags, fileid_t fileid); public: explicit Ext2FileOpener(ResourceRegistry *registry, Ext2FileOperations *ops, user_t user) @@ -56,19 +56,17 @@ virtual long get_fileid(const char *path, flags_t flags, fileid_t *fileid); - virtual long make_accessor(const char *path, flags_t flags, fileid_t fileid, + virtual long make_accessor(flags_t flags, fileid_t fileid, Accessor **accessor); - virtual long make_directory_accessor(const char *path, flags_t flags, - fileid_t fileid, + virtual long make_directory_accessor(flags_t flags, fileid_t fileid, DirectoryAccessor **accessor); - virtual long remove_object(const char *path, fileid_t fileid); + virtual long remove_object(fileid_t fileid); - virtual long rename_object(const char *source, fileid_t source_fileid, - const char *target); + virtual long rename_object(const char *source, const char *target); - virtual long unlink_object(const char *path, fileid_t fileid); + virtual long unlink_object(fileid_t parent_fileid, fileid_t fileid); }; // vim: tabstop=4 expandtab shiftwidth=4 diff -r 184132df62ec -r ffd7b371fcfd libfsserver/include/fsserver/file_opening.h --- a/libfsserver/include/fsserver/file_opening.h Wed Feb 09 22:30:29 2022 +0100 +++ b/libfsserver/include/fsserver/file_opening.h Thu Feb 10 17:55:05 2022 +0100 @@ -31,27 +31,25 @@ class FileOpening { public: - virtual bool accessing_directory(const char *path, flags_t flags, fileid_t fileid) = 0; + virtual bool accessing_directory(flags_t flags, fileid_t fileid) = 0; - virtual bool accessing_file(const char *path, flags_t flags, fileid_t fileid) = 0; + virtual bool accessing_file(flags_t flags, fileid_t fileid) = 0; virtual long get_fileid(const char *path, flags_t flags, fileid_t *fileid) = 0; virtual long get_parent(const char *path, fileid_t *fileid); - virtual long make_accessor(const char *path, flags_t flags, fileid_t fileid, + virtual long make_accessor(flags_t flags, fileid_t fileid, Accessor **accessor) = 0; - virtual long make_directory_accessor(const char *path, flags_t flags, - fileid_t fileid, + virtual long make_directory_accessor(flags_t flags, fileid_t fileid, DirectoryAccessor **accessor) = 0; - virtual long remove_object(const char *path, fileid_t fileid) = 0; + virtual long remove_object(fileid_t fileid) = 0; - virtual long rename_object(const char *source, fileid_t source_fileid, - const char *target) = 0; + virtual long rename_object(const char *source, const char *target) = 0; - virtual long unlink_object(const char *path, fileid_t fileid) = 0; + virtual long unlink_object(fileid_t parent_fileid, fileid_t fileid) = 0; }; // vim: tabstop=4 expandtab shiftwidth=4 diff -r 184132df62ec -r ffd7b371fcfd libfsserver/include/fsserver/host_file_opener.h --- a/libfsserver/include/fsserver/host_file_opener.h Wed Feb 09 22:30:29 2022 +0100 +++ b/libfsserver/include/fsserver/host_file_opener.h Thu Feb 10 17:55:05 2022 +0100 @@ -32,6 +32,7 @@ /* Collection data types. */ typedef std::map HostFileIdentifiers; +typedef std::map HostFilePaths; @@ -45,14 +46,17 @@ /* File identifier register. */ HostFileIdentifiers _fileids; + HostFilePaths _paths; virtual fileid_t _get_fileid(const char *path, bool create); + virtual const char *_get_path(fileid_t fileid); + /* Convenience methods determining different object types. */ - virtual bool accessing_directory(const char *path, flags_t flags, fileid_t fileid); + virtual bool accessing_directory(flags_t flags, fileid_t fileid); - virtual bool accessing_file(const char *path, flags_t flags, fileid_t fileid); + virtual bool accessing_file(flags_t flags, fileid_t fileid); public: explicit HostFileOpener(ResourceRegistry *registry) @@ -66,19 +70,17 @@ virtual long get_fileid(const char *path, flags_t flags, fileid_t *fileid); - virtual long make_accessor(const char *path, flags_t flags, fileid_t fileid, + virtual long make_accessor(flags_t flags, fileid_t fileid, Accessor **accessor); - virtual long make_directory_accessor(const char *path, flags_t flags, - fileid_t fileid, + virtual long make_directory_accessor(flags_t flags, fileid_t fileid, DirectoryAccessor **accessor); - virtual long remove_object(const char *path, fileid_t fileid); + virtual long remove_object(fileid_t fileid); - virtual long rename_object(const char *source, fileid_t source_fileid, - const char *target); + virtual long rename_object(const char *source, const char *target); - virtual long unlink_object(const char *path, fileid_t fileid); + virtual long unlink_object(fileid_t parent_fileid, fileid_t fileid); }; // vim: tabstop=4 expandtab shiftwidth=4 diff -r 184132df62ec -r ffd7b371fcfd libfsserver/include/fsserver/resource_registry.h --- a/libfsserver/include/fsserver/resource_registry.h Wed Feb 09 22:30:29 2022 +0100 +++ b/libfsserver/include/fsserver/resource_registry.h Thu Feb 10 17:55:05 2022 +0100 @@ -1,7 +1,7 @@ /* * A registry of filesystem object resources. * - * Copyright (C) 2021 Paul Boddie + * Copyright (C) 2021, 2022 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -41,22 +41,18 @@ /* Provider initialisation methods. */ - long make_directory_provider(FileOpening *opening, const char *path, - flags_t flags, fileid_t fileid, - Provider **provider); + long make_directory_provider(FileOpening *opening, flags_t flags, + fileid_t fileid, Provider **provider); - long make_file_provider(FileOpening *opening, const char *path, - flags_t flags, fileid_t fileid, - Provider **provider); + long make_file_provider(FileOpening *opening, flags_t flags, + fileid_t fileid, Provider **provider); - long make_provider(FileOpening *opening, const char *path, - flags_t flags, fileid_t fileid, - Provider **provider); + long make_provider(FileOpening *opening, flags_t flags, + fileid_t fileid, Provider **provider); /* Provider manipulation methods. */ - long _remove_provider(FileOpening *opening, const char *path, - fileid_t fileid); + long _remove_provider(FileOpening *opening, const char *path, fileid_t fileid); public: explicit ResourceRegistry(Pages *pages); diff -r 184132df62ec -r ffd7b371fcfd libfsserver/include/fsserver/test_file_opener.h --- a/libfsserver/include/fsserver/test_file_opener.h Wed Feb 09 22:30:29 2022 +0100 +++ b/libfsserver/include/fsserver/test_file_opener.h Thu Feb 10 17:55:05 2022 +0100 @@ -34,9 +34,9 @@ /* Convenience methods determining different object types. */ - virtual bool accessing_directory(const char *path, flags_t flags, fileid_t fileid); + virtual bool accessing_directory(flags_t flags, fileid_t fileid); - virtual bool accessing_file(const char *path, flags_t flags, fileid_t fileid); + virtual bool accessing_file(flags_t flags, fileid_t fileid); public: explicit TestFileOpener(ResourceRegistry *registry, offset_t file_size=0); @@ -47,19 +47,17 @@ virtual long get_fileid(const char *path, flags_t flags, fileid_t *fileid); - virtual long make_accessor(const char *path, flags_t flags, fileid_t fileid, + virtual long make_accessor(flags_t flags, fileid_t fileid, Accessor **accessor); - virtual long make_directory_accessor(const char *path, flags_t flags, - fileid_t fileid, + virtual long make_directory_accessor(flags_t flags, fileid_t fileid, DirectoryAccessor **accessor); - virtual long remove_object(const char *path, fileid_t fileid); + virtual long remove_object(fileid_t fileid); - virtual long rename_object(const char *source, fileid_t source_fileid, - const char *target); + virtual long rename_object(const char *source, const char *target); - virtual long unlink_object(const char *path, fileid_t fileid); + virtual long unlink_object(fileid_t parent_fileid, fileid_t fileid); }; // vim: tabstop=4 expandtab shiftwidth=4 diff -r 184132df62ec -r ffd7b371fcfd libfsserver/lib/files/block_file_opener.cc --- a/libfsserver/lib/files/block_file_opener.cc Wed Feb 09 22:30:29 2022 +0100 +++ b/libfsserver/lib/files/block_file_opener.cc Thu Feb 10 17:55:05 2022 +0100 @@ -1,7 +1,7 @@ /* * An opener for a file employing a rewritable memory area. * - * Copyright (C) 2021 Paul Boddie + * Copyright (C) 2021, 2022 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -57,9 +57,14 @@ /* Return a new accessor for 'fileid'. */ -long BlockFileOpener::make_accessor(const char *path, flags_t flags, - fileid_t fileid, Accessor **accessor) +long BlockFileOpener::make_accessor(flags_t flags, fileid_t fileid, + Accessor **accessor) { + const char *path = _get_path(fileid); + + if (path == NULL) + return -L4_ENOENT; + FILE *fp = fopen(path, "r"); if (fp == NULL) diff -r 184132df62ec -r ffd7b371fcfd libfsserver/lib/files/ext2_file_opener.cc --- a/libfsserver/lib/files/ext2_file_opener.cc Wed Feb 09 22:30:29 2022 +0100 +++ b/libfsserver/lib/files/ext2_file_opener.cc Thu Feb 10 17:55:05 2022 +0100 @@ -38,17 +38,17 @@ /* Test if a directory is being accessed. */ -bool Ext2FileOpener::accessing_directory(const char *path, flags_t flags, fileid_t fileid) +bool Ext2FileOpener::accessing_directory(flags_t flags, fileid_t fileid) { - (void) path; (void) flags; + (void) flags; return _ops->is_directory((ext2_ino_t) fileid); } /* Test if a file is being accessed. */ -bool Ext2FileOpener::accessing_file(const char *path, flags_t flags, fileid_t fileid) +bool Ext2FileOpener::accessing_file(flags_t flags, fileid_t fileid) { - (void) path; (void) flags; + (void) flags; return _ops->is_file((ext2_ino_t) fileid); } @@ -96,10 +96,10 @@ /* Return a new accessor for 'fileid'. */ -long Ext2FileOpener::make_accessor(const char *path, flags_t flags, - fileid_t fileid, Accessor **accessor) +long Ext2FileOpener::make_accessor(flags_t flags, fileid_t fileid, + Accessor **accessor) { - (void) path; (void) flags; + (void) flags; ext2_file_t file; long err = _ops->open_file((ext2_ino_t) fileid, &file); @@ -113,11 +113,10 @@ /* Return a directory object reference for the given file identifier. */ -long Ext2FileOpener::make_directory_accessor(const char *path, flags_t flags, - fileid_t fileid, +long Ext2FileOpener::make_directory_accessor(flags_t flags, fileid_t fileid, DirectoryAccessor **accessor) { - (void) path; (void) flags; + (void) flags; *accessor = new Ext2DirectoryAccessor(_ops, fileid); return L4_EOK; @@ -125,22 +124,22 @@ /* Remove a filesystem object. */ -long Ext2FileOpener::remove_object(const char *path, fileid_t fileid) +long Ext2FileOpener::remove_object(fileid_t fileid) { - (void) path; - return _ops->remove((ext2_ino_t) fileid); } /* Rename a filesystem object, placing source inside the parent of target. */ -long Ext2FileOpener::rename_object(const char *source, fileid_t source_fileid, - const char *target) +long Ext2FileOpener::rename_object(const char *source, const char *target) { - (void) source; + fileid_t source_fileid, source_parent, target_parent; + long err; - fileid_t source_parent, target_parent; - long err; + err = get_fileid(source, 0, &source_fileid); + + if (err) + return err; err = get_parent(source, &source_parent); @@ -159,15 +158,9 @@ /* Unlink a filesystem object. */ -long Ext2FileOpener::unlink_object(const char *path, fileid_t fileid) +long Ext2FileOpener::unlink_object(fileid_t parent_fileid, fileid_t fileid) { - fileid_t parent; - long err = get_parent(path, &parent); - - if (err) - return err; - - return _ops->unlink((ext2_ino_t) parent, (ext2_ino_t) fileid); + return _ops->unlink((ext2_ino_t) parent_fileid, (ext2_ino_t) fileid); } // vim: tabstop=4 expandtab shiftwidth=4 diff -r 184132df62ec -r ffd7b371fcfd libfsserver/lib/files/host_file_opener.cc --- a/libfsserver/lib/files/host_file_opener.cc Wed Feb 09 22:30:29 2022 +0100 +++ b/libfsserver/lib/files/host_file_opener.cc Thu Feb 10 17:55:05 2022 +0100 @@ -36,9 +36,15 @@ { } -bool HostFileOpener::accessing_directory(const char *path, flags_t flags, fileid_t fileid) +bool HostFileOpener::accessing_directory(flags_t flags, fileid_t fileid) { - (void) flags; (void) fileid; + (void) flags; + + const char *path = _get_path(fileid); + + if (path == NULL) + return false; + struct stat st; if (stat(path, &st)) @@ -47,11 +53,16 @@ return (st.st_mode & S_IFDIR) ? true : false; } -bool HostFileOpener::accessing_file(const char *path, flags_t flags, fileid_t fileid) +bool HostFileOpener::accessing_file(flags_t flags, fileid_t fileid) { - (void) flags; (void) fileid; + (void) flags; struct stat st; + const char *path = _get_path(fileid); + + if (path == NULL) + return false; + if (stat(path, &st)) return false; @@ -99,19 +110,37 @@ fileid_t fileid = _fileids.size(); _fileids[s] = fileid; + _paths[fileid] = s; return fileid; } +const char *HostFileOpener::_get_path(fileid_t fileid) +{ + std::lock_guard guard(_lock); + + HostFilePaths::iterator it = _paths.find(fileid); + + if (it != _paths.end()) + return it->second.c_str(); + else + return NULL; +} + /* Return a new accessor for 'fileid'. */ -long HostFileOpener::make_accessor(const char *path, flags_t flags, - fileid_t fileid, Accessor **accessor) +long HostFileOpener::make_accessor(flags_t flags, fileid_t fileid, + Accessor **accessor) { // NOTE: Not testing for create or write flags. (void) flags; + const char *path = _get_path(fileid); + + if (path == NULL) + return -L4_ENOENT; + FILE *fp = fopen(path, "r"); if (fp == NULL) @@ -123,11 +152,15 @@ /* Return a directory accessor for 'fileid'. */ -long HostFileOpener::make_directory_accessor(const char *path, flags_t flags, - fileid_t fileid, +long HostFileOpener::make_directory_accessor(flags_t flags, fileid_t fileid, DirectoryAccessor **accessor) { - (void) flags; (void) fileid; + (void) flags; + + const char *path = _get_path(fileid); + + if (path == NULL) + return -L4_ENOENT; *accessor = new HostDirectoryAccessor(path); return L4_EOK; @@ -135,19 +168,16 @@ /* Remove a filesystem object. */ -long HostFileOpener::remove_object(const char *path, fileid_t fileid) +long HostFileOpener::remove_object(fileid_t fileid) { - (void) path; (void) fileid; + (void) fileid; return L4_EOK; } /* Rename a filesystem object, placing source inside the parent of target. */ -long HostFileOpener::rename_object(const char *source, fileid_t source_fileid, - const char *target) +long HostFileOpener::rename_object(const char *source, const char *target) { - (void) source_fileid; - /* NOTE: Should propagate a more meaningful error. */ if (rename(source, target)) @@ -158,11 +188,16 @@ /* Unlink a filesystem object. */ -long HostFileOpener::unlink_object(const char *path, fileid_t fileid) +long HostFileOpener::unlink_object(fileid_t parent_fileid, fileid_t fileid) { - /* Ignore the fileid and always use the path. */ + /* Ignore the parent and always use the path. */ + + (void) parent_fileid; - (void) fileid; + const char *path = _get_path(fileid); + + if (path == NULL) + return -L4_ENOENT; // NOTE: Return code may need converting. @@ -180,6 +215,11 @@ if (it != _fileids.end()) _fileids.erase(it); + HostFilePaths::iterator pit = _paths.find(fileid); + + if (pit != _paths.end()) + _paths.erase(pit); + return L4_EOK; } diff -r 184132df62ec -r ffd7b371fcfd libfsserver/lib/files/test_file_opener.cc --- a/libfsserver/lib/files/test_file_opener.cc Wed Feb 09 22:30:29 2022 +0100 +++ b/libfsserver/lib/files/test_file_opener.cc Thu Feb 10 17:55:05 2022 +0100 @@ -1,7 +1,7 @@ /* * An opener for a test file containing generated content. * - * Copyright (C) 2021 Paul Boddie + * Copyright (C) 2021, 2022 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -35,15 +35,15 @@ { } -bool TestFileOpener::accessing_directory(const char *path, flags_t flags, fileid_t fileid) +bool TestFileOpener::accessing_directory(flags_t flags, fileid_t fileid) { - (void) path; (void) flags; (void) fileid; + (void) flags; (void) fileid; return false; } -bool TestFileOpener::accessing_file(const char *path, flags_t flags, fileid_t fileid) +bool TestFileOpener::accessing_file(flags_t flags, fileid_t fileid) { - (void) path; (void) flags; (void) fileid; + (void) flags; (void) fileid; return true; } @@ -61,46 +61,44 @@ /* Return a new accessor for 'fileid'. */ -long TestFileOpener::make_accessor(const char *path, flags_t flags, - fileid_t fileid, Accessor **accessor) +long TestFileOpener::make_accessor(flags_t flags, fileid_t fileid, + Accessor **accessor) { - (void) flags; (void) path; + (void) flags; *accessor = new TestFileAccessor(fileid, _file_size); return L4_EOK; } /* Return a new directory accessor for 'fileid'. */ -long TestFileOpener::make_directory_accessor(const char *path, flags_t flags, - fileid_t fileid, +long TestFileOpener::make_directory_accessor(flags_t flags, fileid_t fileid, DirectoryAccessor **accessor) { - (void) flags; (void) path; (void) fileid; (void) accessor; + (void) flags; (void) fileid; (void) accessor; return -L4_EIO; } /* Remove a filesystem object. */ -long TestFileOpener::remove_object(const char *path, fileid_t fileid) +long TestFileOpener::remove_object(fileid_t fileid) { - (void) path; (void) fileid; + (void) fileid; return L4_EOK; } /* Rename a filesystem object, placing source inside the parent of target. */ -long TestFileOpener::rename_object(const char *source, fileid_t source_fileid, - const char *target) +long TestFileOpener::rename_object(const char *source, const char *target) { - (void) source; (void) source_fileid; (void) target; + (void) source; (void) target; return -L4_EIO; } /* Unlink a filesystem object. */ -long TestFileOpener::unlink_object(const char *path, fileid_t fileid) +long TestFileOpener::unlink_object(fileid_t parent_fileid, fileid_t fileid) { - (void) path; (void) fileid; + (void) parent_fileid; (void) fileid; return -L4_EIO; } diff -r 184132df62ec -r ffd7b371fcfd libfsserver/lib/generic/resource_registry.cc --- a/libfsserver/lib/generic/resource_registry.cc Wed Feb 09 22:30:29 2022 +0100 +++ b/libfsserver/lib/generic/resource_registry.cc Thu Feb 10 17:55:05 2022 +0100 @@ -49,14 +49,14 @@ /* Make a directory provider. */ long ResourceRegistry::make_directory_provider(FileOpening *opening, - const char *path, flags_t flags, + flags_t flags, fileid_t fileid, Provider **provider) { /* Make an accessor and a provider to encapsulate it. */ DirectoryAccessor *accessor; - long err = opening->make_directory_accessor(path, flags, fileid, &accessor); + long err = opening->make_directory_accessor(flags, fileid, &accessor); if (err) return err; @@ -68,14 +68,14 @@ /* Make a file provider. */ long ResourceRegistry::make_file_provider(FileOpening *opening, - const char *path, flags_t flags, + flags_t flags, fileid_t fileid, Provider **provider) { /* Make an accessor, page mapper, and a provider to encapsulate them. */ Accessor *accessor; - long err = opening->make_accessor(path, flags, fileid, &accessor); + long err = opening->make_accessor(flags, fileid, &accessor); if (err) return err; @@ -88,16 +88,16 @@ /* Make a provider of the appropriate type. */ long ResourceRegistry::make_provider(FileOpening *opening, - const char *path, flags_t flags, + flags_t flags, fileid_t fileid, Provider **provider) { long err = -L4_EIO; - if (opening->accessing_directory(path, flags, fileid)) - err = make_directory_provider(opening, path, flags, fileid, provider); - else if (opening->accessing_file(path, flags, fileid)) - err = make_file_provider(opening, path, flags, fileid, provider); + if (opening->accessing_directory(flags, fileid)) + err = make_directory_provider(opening, flags, fileid, provider); + else if (opening->accessing_file(flags, fileid)) + err = make_file_provider(opening, flags, fileid, provider); if (err) return err; @@ -160,7 +160,7 @@ /* Make a new provider if necessary. */ if (err == -L4_ENOENT) - err = make_provider(opening, path, flags, fileid, &provider); + err = make_provider(opening, flags, fileid, &provider); if (err) return err; @@ -200,9 +200,16 @@ if (err && (err != -L4_ENOENT)) return err; + fileid_t parent_fileid; + + err = opening->get_parent(path, &parent_fileid); + + if (err) + return err; + /* Unlink the object regardless of whether it can be removed. */ - err = opening->unlink_object(path, fileid); + err = opening->unlink_object(parent_fileid, fileid); if (err) return err; @@ -210,7 +217,7 @@ /* Without a provider being active, remove the object directly. */ if (err) - return opening->remove_object(path, fileid); + return opening->remove_object(fileid); /* With a provider active, request the object's removal upon closure. */ @@ -240,7 +247,7 @@ directory. An empty directory will be replaced by the source directory. */ - if (opening->accessing_directory(source, 0, source_fileid)) + if (opening->accessing_directory(0, source_fileid)) { err = opening->get_fileid(target, 0, &target_fileid); @@ -253,7 +260,7 @@ { /* NOTE: Should really use the equivalent of ENOTDIR. */ - if (!opening->accessing_directory(target, 0, target_fileid)) + if (!opening->accessing_directory(0, target_fileid)) return -L4_EIO; /* NOTE: Test for empty directory. */ @@ -269,13 +276,13 @@ /* The source directory is moved within the filesystem to the parent of the indicated target. */ - return opening->rename_object(source, source_fileid, target); + return opening->rename_object(source, target); } /* If source is a file, the target must be a new or existing file, not a directory. An existing file will be replaced. */ - else if (opening->accessing_file(source, 0, source_fileid)) + else if (opening->accessing_file(0, source_fileid)) { err = opening->get_fileid(target, 0, &target_fileid); @@ -286,7 +293,7 @@ { /* NOTE: Should really use the equivalent of EISDIR. */ - if (!opening->accessing_file(target, 0, target_fileid)) + if (!opening->accessing_file(0, target_fileid)) return -L4_EIO; /* The existing file will be removed. */ @@ -300,7 +307,7 @@ /* The source file is moved within the filesystem to the parent of the indicated target. */ - return opening->rename_object(source, source_fileid, target); + return opening->rename_object(source, target); } /* NOTE: Other object types are to be supported. */