From 39796b4794576dc071720d64bf58ac2f388ec62e Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Tue, 29 Jun 2010 15:50:13 -0700 Subject: [PATCH] client: make fragmap updates a little more space efficient. If the auth is the same as the parent, don't add to the map (and remove if it's already there). Absence is interpreted the same as a value of -1. --- src/client/Client.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 0d8b39fd5ba64..7c45a2bc23000 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -558,7 +558,12 @@ void Client::update_dir_dist(Inode *in, DirStat *dst) { // auth dout(20) << "got dirfrag map for " << in->ino << " frag " << dst->frag << " to mds " << dst->auth << dendl; - in->fragmap[dst->frag] = dst->auth; + if (dst->auth >= 0) { + in->fragmap[dst->frag] = dst->auth; + } else { + in->fragmap.erase(dst->frag); + } + assert(in->dirfragtree.is_leaf(dst->frag)); // replicated in->dir_replicated = !dst->dist.empty(); // FIXME that's just one frag! -- 2.39.5