Skip to content

Commit

Permalink
mds: add dentries in dirfrag to LRU in reverse order
Browse files Browse the repository at this point in the history
Files in a dirfrag are usually processed in the order of readdir
results. Files at the beginning of are more likely to be used in
the future than files at the last.

Signed-off-by: Yan, Zheng <[email protected]>
  • Loading branch information
Yan, Zheng committed Apr 2, 2014
1 parent f0978a8 commit 16af25f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mds/CDir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1540,10 +1540,10 @@ void CDir::_omap_fetched(bufferlist& hdrbl, map<string, bufferlist>& omap,

bool stray = inode->is_stray();

unsigned pos = 0;
for (map<string, bufferlist>::iterator p = omap.begin();
p != omap.end();
++p, ++pos) {
unsigned pos = omap.size() - 1;
for (map<string, bufferlist>::reverse_iterator p = omap.rbegin();
p != omap.rend();
++p, --pos) {
// dname
string dname;
snapid_t first, last;
Expand Down

0 comments on commit 16af25f

Please sign in to comment.