mirror of
https://github.com/ceph/ceph
synced 2024-12-17 08:57:28 +00:00
Merge pull request #10168 from batrick/client-inode-des
client: move Inode specific cleanup to destructor Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
commit
f8ecf532fb
@ -2831,9 +2831,6 @@ void Client::put_inode(Inode *in, int n)
|
||||
if (use_faked_inos())
|
||||
_release_faked_ino(in);
|
||||
|
||||
in->cap_item.remove_myself();
|
||||
in->snaprealm_item.remove_myself();
|
||||
in->snapdir_parent.reset();
|
||||
if (in == root) {
|
||||
root = 0;
|
||||
root_ancestor = 0;
|
||||
@ -2841,14 +2838,6 @@ void Client::put_inode(Inode *in, int n)
|
||||
root_parents.erase(root_parents.begin());
|
||||
}
|
||||
|
||||
if (!in->oset.objects.empty()) {
|
||||
ldout(cct, 0) << __func__ << ": leftover objects on inode 0x"
|
||||
<< std::hex << in->ino << std::dec << dendl;
|
||||
assert(in->oset.objects.empty());
|
||||
}
|
||||
|
||||
delete in->fcntl_locks;
|
||||
delete in->flock_locks;
|
||||
delete in;
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,24 @@
|
||||
#include "ClientSnapRealm.h"
|
||||
#include "UserGroups.h"
|
||||
|
||||
#include "mds/flock.h"
|
||||
|
||||
Inode::~Inode()
|
||||
{
|
||||
cap_item.remove_myself();
|
||||
snaprealm_item.remove_myself();
|
||||
snapdir_parent.reset();
|
||||
|
||||
if (!oset.objects.empty()) {
|
||||
lsubdout(client->cct, client, 0) << __func__ << ": leftover objects on inode 0x"
|
||||
<< std::hex << ino << std::dec << dendl;
|
||||
assert(oset.objects.empty());
|
||||
}
|
||||
|
||||
delete fcntl_locks;
|
||||
delete flock_locks;
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream &out, const Inode &in)
|
||||
{
|
||||
out << in.vino() << "("
|
||||
|
@ -244,7 +244,7 @@ struct Inode {
|
||||
memset(&dir_layout, 0, sizeof(dir_layout));
|
||||
memset("a, 0, sizeof(quota));
|
||||
}
|
||||
~Inode() { }
|
||||
~Inode();
|
||||
|
||||
vinodeno_t vino() const { return vinodeno_t(ino, snapid); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user