}
::decode(dirty, bl);
}
+
+ void update_inode(CInode *in) {
+ in->inode = inode;
+ in->xattrs = xattrs;
+ if (in->inode.is_dir()) {
+ in->dirfragtree = dirfragtree;
+ delete in->default_layout;
+ in->default_layout = dir_layout;
+ /*
+ * we can do this before linking hte inode bc the split_at would
+ * be a no-op.. we have no children (namely open snaprealms) to
+ * divy up
+ */
+ in->decode_snap_blob(snapbl);
+ } else if (in->inode.is_symlink()) {
+ in->symlink = symlink;
+ }
+ }
+
void print(ostream& out) {
out << " fullbit dn " << dn << " [" << dnfirst << "," << dnlast << "] dnv " << dnv
<< " inode " << inode.ino
bool isnew = in ? false:true;
if (!in)
in = new CInode(mds->mdcache, true);
- in->inode = root->inode;
- in->xattrs = root->xattrs;
- if (in->inode.is_dir()) {
- in->dirfragtree = root->dirfragtree;
- delete in->default_layout;
- in->default_layout = root->dir_layout;
- /*
- * we can do this before linking hte inode bc the split_at would
- * be a no-op.. we have no children (namely open snaprealms) to
- * divy up
- */
- in->decode_snap_blob(root->snapbl);
- }
- if (in->inode.is_symlink()) in->symlink = root->symlink;
+ root->update_inode(in);
if (isnew)
mds->mdcache->add_inode(in);
if (root->dirty) in->_mark_dirty(logseg);
CInode *in = mds->mdcache->get_inode(p->inode.ino, p->dnlast);
if (!in) {
in = new CInode(mds->mdcache, true, p->dnfirst, p->dnlast);
- in->inode = p->inode;
- in->xattrs = p->xattrs;
- if (in->inode.is_dir()) {
- in->dirfragtree = p->dirfragtree;
- delete in->default_layout;
- in->default_layout = p->dir_layout;
- /*
- * we can do this before linking hte inode bc the split_at would
- * be a no-op.. we have no children (namely open snaprealms) to
- * divy up
- */
- in->decode_snap_blob(p->snapbl);
- }
- if (in->inode.is_symlink()) in->symlink = p->symlink;
+ p->update_inode(in);
mds->mdcache->add_inode(in);
if (!dn->get_linkage()->is_null()) {
if (dn->get_linkage()->is_primary()) {
}
if (in->get_parent_dn() && in->inode.anchored != p->inode.anchored)
in->get_parent_dn()->adjust_nested_anchors( (int)p->inode.anchored - (int)in->inode.anchored );
- in->inode = p->inode;
- in->xattrs = p->xattrs;
- if (in->inode.is_dir()) {
- in->dirfragtree = p->dirfragtree;
- delete in->default_layout;
- in->default_layout = p->dir_layout;
- in->decode_snap_blob(p->snapbl);
- }
- if (in->inode.is_symlink()) in->symlink = p->symlink;
+ p->update_inode(in);
if (p->dirty) in->_mark_dirty(logseg);
if (dn->get_linkage()->get_inode() != in) {
if (!dn->get_linkage()->is_null()) // note: might be remote. as with stray reintegration.