mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-17 22:58:26 +00:00
os: add File_system_session::num_entries RPC
This patch splits the querying of the number of directory entries from the directory's 'status' information. Subsuming the number of directory entries as part of the status makes 'stat' calls too costly for some file systems that need to read a directory for determining the number of entries. So when stat'ing the entries of one directory that contains sub directories, all entries of each sub directory are visited. Thanks to Cedric Degea for pointing out this performance bottleneck! With this change, the 'status' function returns a 'Status::size' value of 0 when called for a directory handle. Fixes #4603
This commit is contained in:
@ -112,6 +112,11 @@ class File_system::Session_client : public Genode::Rpc_client<Session>
|
||||
{
|
||||
call<Rpc_move>(from_dir, from_name, to_dir, to_name);
|
||||
}
|
||||
|
||||
unsigned num_entries(Dir_handle dir) override
|
||||
{
|
||||
return call<Rpc_num_entries>(dir);
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__FILE_SYSTEM_SESSION__CLIENT_H_ */
|
||||
|
Reference in New Issue
Block a user