<< dendl;
if (dn->inode) {
Inode *diri = dn->dir->parent_inode;
- diri->dir_release_count++;
clear_dir_complete_and_ordered(diri, true);
}
unlink(dn, false, false); // drop dir, drop dentry
if (old_dentry) {
if (old_dentry->dir != dir) {
Inode *old_diri = old_dentry->dir->parent_inode;
- old_diri->dir_ordered_count++;
clear_dir_complete_and_ordered(old_diri, false);
}
unlink(old_dentry, dir == old_dentry->dir, false); // drop dentry, keep dir open if its the same dir
}
Inode *diri = dir->parent_inode;
- diri->dir_ordered_count++;
clear_dir_complete_and_ordered(diri, false);
dn = link(dir, dname, in, dn);
}
void Client::clear_dir_complete_and_ordered(Inode *diri, bool complete)
{
+ if (complete)
+ diri->dir_release_count++;
+ else
+ diri->dir_ordered_count++;
if (diri->flags & I_COMPLETE) {
if (complete) {
ldout(cct, 10) << " clearing (I_COMPLETE|I_DIR_ORDERED) on " << *diri << dendl;
Dentry *d = request->dentry();
if (d) {
Inode *diri = d->dir->parent_inode;
- diri->dir_release_count++;
clear_dir_complete_and_ordered(diri, true);
}
if (diri->dir && diri->dir->dentries.count(dname)) {
dn = diri->dir->dentries[dname];
if (dn->inode) {
- diri->dir_ordered_count++;
clear_dir_complete_and_ordered(diri, false);
unlink(dn, true, true); // keep dir, dentry
}
Dentry *olddn = in->get_first_parent();
ceph_assert(olddn->dir != dir || olddn->name != name);
Inode *old_diri = olddn->dir->parent_inode;
- old_diri->dir_release_count++;
clear_dir_complete_and_ordered(old_diri, true);
unlink(olddn, true, true); // keep dir, dentry
}
!(had & CEPH_CAP_FILE_CACHE))
in->cache_gen++;
- if ((issued & CEPH_CAP_FILE_SHARED) &&
- !(had & CEPH_CAP_FILE_SHARED)) {
- in->shared_gen++;
-
+ if ((issued & CEPH_CAP_FILE_SHARED) !=
+ (had & CEPH_CAP_FILE_SHARED)) {
+ if (issued & CEPH_CAP_FILE_SHARED)
+ in->shared_gen++;
if (in->is_dir())
clear_dir_complete_and_ordered(in, true);
}