mirror of
https://github.com/ceph/ceph
synced 2025-02-21 09:57:26 +00:00
Merge pull request #12870 from xiaoxichen/mds_readdir
mds/server: skip unwanted dn in handle_client_readdir Reviewed-by: Yan, Zheng <zyan@redhat.com> Reviewed-by: John Spray <john.spray@redhat.com> Reviewed-by: Greg Farnum <gfarnum@redhat.com>
This commit is contained in:
commit
b5262c2091
@ -428,6 +428,7 @@ protected:
|
||||
|
||||
map_t::iterator begin() { return items.begin(); }
|
||||
map_t::iterator end() { return items.end(); }
|
||||
map_t::iterator lower_bound(dentry_key_t key) { return items.lower_bound(key); }
|
||||
|
||||
unsigned get_num_head_items() const { return num_head_items; }
|
||||
unsigned get_num_head_null() const { return num_head_null; }
|
||||
|
@ -3430,7 +3430,9 @@ void Server::handle_client_readdir(MDRequestRef& mdr)
|
||||
bufferlist dnbl;
|
||||
__u32 numfiles = 0;
|
||||
bool end = (dir->begin() == dir->end());
|
||||
for (CDir::map_t::iterator it = dir->begin();
|
||||
// skip all dns < dentry_key_t(snapid, offset_str, offset_hash)
|
||||
dentry_key_t skip_key(snapid, offset_str.c_str(), offset_hash);
|
||||
for (CDir::map_t::iterator it = offset_str.empty() ? dir->begin() : dir->lower_bound(skip_key);
|
||||
!end && numfiles < max;
|
||||
end = (it == dir->end())) {
|
||||
CDentry *dn = it->second;
|
||||
|
Loading…
Reference in New Issue
Block a user