mirror of
https://github.com/ceph/ceph
synced 2025-03-05 07:48:55 +00:00
fixed stupid cache client shutdown bug
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1136 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
parent
559d2bfa58
commit
f583f341c6
@ -1772,6 +1772,10 @@ int Client::getdir(const char *relpath, map<string,inode_t>& contents)
|
||||
for (list<InodeStat*>::const_iterator pin = reply->get_dir_in().begin();
|
||||
pin != reply->get_dir_in().end();
|
||||
++pin, ++pdn) {
|
||||
// ignore .
|
||||
if (*pdn == ".")
|
||||
continue;
|
||||
|
||||
// count entries
|
||||
res++;
|
||||
|
||||
@ -1786,11 +1790,14 @@ int Client::getdir(const char *relpath, map<string,inode_t>& contents)
|
||||
// contents to caller too!
|
||||
contents[*pdn] = in->inode;
|
||||
}
|
||||
if (dir->is_empty())
|
||||
close_dir(dir);
|
||||
}
|
||||
|
||||
// add .. too?
|
||||
contents["."] = diri->inode;
|
||||
if (diri != root)
|
||||
contents[".."] = diri->inode;
|
||||
contents[".."] = diri->dn->dir->parent_inode->inode;
|
||||
|
||||
// FIXME: remove items in cache that weren't in my readdir?
|
||||
// ***
|
||||
|
@ -410,6 +410,7 @@ protected:
|
||||
|
||||
// link to dir
|
||||
dn->dir = dir;
|
||||
//cout << "link dir " << dir->parent_inode->inode.ino << " '" << name << "' -> inode " << in->inode.ino << endl;
|
||||
dir->dentries[dn->name] = dn;
|
||||
|
||||
// link to inode
|
||||
@ -428,6 +429,7 @@ protected:
|
||||
dn->inode = 0;
|
||||
in->dn = 0;
|
||||
put_inode(in);
|
||||
assert(!in->is_dir() || in->dir == 0);
|
||||
|
||||
// unlink from dir
|
||||
dn->dir->dentries.erase(dn->name);
|
||||
@ -448,6 +450,8 @@ protected:
|
||||
strcpy((char*)dn->name, name.c_str());
|
||||
dir->dentries[dn->name] = dn;
|
||||
*/
|
||||
//cout << "relink dir " << dir->parent_inode->inode.ino << " '" << name << "' -> inode " << dn->inode->inode.ino << endl;
|
||||
|
||||
dir->dentries[name] = dn;
|
||||
|
||||
// unlink from old dir
|
||||
|
Loading…
Reference in New Issue
Block a user