Zheng's suggestion: "[maybe_export_pin is called by MDCache::add_inode() and
Migrator. For the first case, inode has no dirfrag (I think it's better to call
this function in CInode::get_or_open_dirfrag)"
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
dir->get(CDir::PIN_STICKY);
}
+ if (get_export_pin(false) != mdcache->mds->get_nodeid()) {
+ /* We don't need to look at parents export pins as that would be done when
+ * the parent's dirfrags are loaded.
+ */
+ maybe_export_pin();
+ }
+
return dir;
}
maybe_export_pin();
}
-mds_rank_t CInode::get_export_pin(void) const
+mds_rank_t CInode::get_export_pin(bool inherit) const
{
/* An inode that is export pinned may not necessarily be a subtree root, we
* need to traverse the parents. A base or system inode cannot be pinned.
if (pin >= 0) {
return pin;
}
+ if (!inherit) break;
}
return MDS_RANK_NONE;
}
void maybe_export_pin();
public:
void set_export_pin(mds_rank_t rank);
- mds_rank_t get_export_pin(void) const;
+ mds_rank_t get_export_pin(bool inherit=true) const;
bool is_exportable(mds_rank_t dest) const;
void print(ostream& out) override;
g_conf->mds_cache_size * g_conf->mds_health_cache_threshold) {
exceeded_size_limit = true;
}
-
- /* This is the place where inodes are thrown in the cache, so check if the inode should be somewhere else: */
- in->maybe_export_pin();
}
void MDCache::remove_inode(CInode *o)