1.1 --- a/libfsserver/lib/files/ext2_file_opener.cc Wed Feb 09 22:30:29 2022 +0100
1.2 +++ b/libfsserver/lib/files/ext2_file_opener.cc Thu Feb 10 17:55:05 2022 +0100
1.3 @@ -38,17 +38,17 @@
1.4
1.5 /* Test if a directory is being accessed. */
1.6
1.7 -bool Ext2FileOpener::accessing_directory(const char *path, flags_t flags, fileid_t fileid)
1.8 +bool Ext2FileOpener::accessing_directory(flags_t flags, fileid_t fileid)
1.9 {
1.10 - (void) path; (void) flags;
1.11 + (void) flags;
1.12 return _ops->is_directory((ext2_ino_t) fileid);
1.13 }
1.14
1.15 /* Test if a file is being accessed. */
1.16
1.17 -bool Ext2FileOpener::accessing_file(const char *path, flags_t flags, fileid_t fileid)
1.18 +bool Ext2FileOpener::accessing_file(flags_t flags, fileid_t fileid)
1.19 {
1.20 - (void) path; (void) flags;
1.21 + (void) flags;
1.22 return _ops->is_file((ext2_ino_t) fileid);
1.23 }
1.24
1.25 @@ -96,10 +96,10 @@
1.26
1.27 /* Return a new accessor for 'fileid'. */
1.28
1.29 -long Ext2FileOpener::make_accessor(const char *path, flags_t flags,
1.30 - fileid_t fileid, Accessor **accessor)
1.31 +long Ext2FileOpener::make_accessor(flags_t flags, fileid_t fileid,
1.32 + Accessor **accessor)
1.33 {
1.34 - (void) path; (void) flags;
1.35 + (void) flags;
1.36
1.37 ext2_file_t file;
1.38 long err = _ops->open_file((ext2_ino_t) fileid, &file);
1.39 @@ -113,11 +113,10 @@
1.40
1.41 /* Return a directory object reference for the given file identifier. */
1.42
1.43 -long Ext2FileOpener::make_directory_accessor(const char *path, flags_t flags,
1.44 - fileid_t fileid,
1.45 +long Ext2FileOpener::make_directory_accessor(flags_t flags, fileid_t fileid,
1.46 DirectoryAccessor **accessor)
1.47 {
1.48 - (void) path; (void) flags;
1.49 + (void) flags;
1.50
1.51 *accessor = new Ext2DirectoryAccessor(_ops, fileid);
1.52 return L4_EOK;
1.53 @@ -125,22 +124,22 @@
1.54
1.55 /* Remove a filesystem object. */
1.56
1.57 -long Ext2FileOpener::remove_object(const char *path, fileid_t fileid)
1.58 +long Ext2FileOpener::remove_object(fileid_t fileid)
1.59 {
1.60 - (void) path;
1.61 -
1.62 return _ops->remove((ext2_ino_t) fileid);
1.63 }
1.64
1.65 /* Rename a filesystem object, placing source inside the parent of target. */
1.66
1.67 -long Ext2FileOpener::rename_object(const char *source, fileid_t source_fileid,
1.68 - const char *target)
1.69 +long Ext2FileOpener::rename_object(const char *source, const char *target)
1.70 {
1.71 - (void) source;
1.72 + fileid_t source_fileid, source_parent, target_parent;
1.73 + long err;
1.74
1.75 - fileid_t source_parent, target_parent;
1.76 - long err;
1.77 + err = get_fileid(source, 0, &source_fileid);
1.78 +
1.79 + if (err)
1.80 + return err;
1.81
1.82 err = get_parent(source, &source_parent);
1.83
1.84 @@ -159,15 +158,9 @@
1.85
1.86 /* Unlink a filesystem object. */
1.87
1.88 -long Ext2FileOpener::unlink_object(const char *path, fileid_t fileid)
1.89 +long Ext2FileOpener::unlink_object(fileid_t parent_fileid, fileid_t fileid)
1.90 {
1.91 - fileid_t parent;
1.92 - long err = get_parent(path, &parent);
1.93 -
1.94 - if (err)
1.95 - return err;
1.96 -
1.97 - return _ops->unlink((ext2_ino_t) parent, (ext2_ino_t) fileid);
1.98 + return _ops->unlink((ext2_ino_t) parent_fileid, (ext2_ino_t) fileid);
1.99 }
1.100
1.101 // vim: tabstop=4 expandtab shiftwidth=4