SUMMARY The slave is doing opendir/readdir/close to get the file name list. At this point we're actually already fetching all required info to satisfy a stat via SMB2_FIND_ID_BOTH_DIRECTORY_INFO. With the release of Samba 4.9 there is a new smbc_readdirplus() available. This will return all the stat information we already collected for the directory. This significantly will reduce roundtrips which slows down traversing the directories.
We need to implement smbc_readdirplus2() as we fscked up the API :-(
That only applies to directory listing, right? To list shares and printers and whatnot we'd still need the smbc_dirents from smbc_readdir. Also this documentation seems a bit lackluster ``` /** * DOS attributes of file */ uint16_t attrs; ``` are they mode bits like SMBC_DOS_MODE_HIDDEN?
Yes, this is only for listing directory contents. In the meantime we have smbc_readdirplus2() which addresses some bugs created with smbc_readdirplus().
Git commit ec40cd6ef3f497637f4e7e31e3dc60c221e25f5c by Harald Sitter. Committed on 16/03/2020 at 12:25. Pushed by sitter into branch 'master'. add readdirplus2 support for samba>=4.12 Summary: unlike the dirent itering we do not need a separate stat call with this new api by instead itering on what are effectively stat-like objects. this simply runs before the regular itering which we still use to list shares and workgroups. browse_stat_path has been split into stat and udsentry-construction-from-stat so it can be used across both code paths. fun fact on the side: if there actually was a stat() api that returned libsmb_file_info, we could use that as well and forget about the stats structs in general :S FIXED-IN: 20.04.0 Test Plan: - build samba 4.12 rc - list server - list share - list dir in share - on 4.7 - all of the above Reviewers: ngraham, asn Reviewed By: ngraham Subscribers: kde-frameworks-devel, kfm-devel Tags: #dolphin, #frameworks Differential Revision: https://phabricator.kde.org/D27520 # Conflicts: # smb/CMakeLists.txt # smb/kio_smb.h # smb/kio_smb_browse.cpp M +7 -0 smb/CMakeLists.txt M +1 -0 smb/config-smb.h.cmake M +1 -1 smb/kio_smb.h M +82 -53 smb/kio_smb_browse.cpp https://commits.kde.org/kio-extras/ec40cd6ef3f497637f4e7e31e3dc60c221e25f5c