Start ref count at 0; get_snap_realm() will increment it after alloc.
Fix the ref drop order so that the xlist is empty.
Signed-off-by: Sage Weil <sage@inktank.com>
if (!in->is_any_caps()) {
ldout(cct, 15) << "remove_cap last one, closing snaprealm " << in->snaprealm << dendl;
+ in->snaprealm_item.remove_myself();
put_snap_realm(in->snaprealm);
in->snaprealm = 0;
- in->snaprealm_item.remove_myself();
}
}
xlist<Inode*> inodes_with_caps;
SnapRealm(inodeno_t i) :
- ino(i), nref(1), created(0), seq(0),
+ ino(i), nref(0), created(0), seq(0),
pparent(NULL) { }
void build_snap_context();