int rc;
ENTRY;
+ if (unlikely(osd->od_is_ost))
+ RETURN(-ENOENT);
+
parent = omm->omm_remote_parent;
sprintf(name, DFID_NOBRACE, PFID(fid));
dentry = osd_child_dentry_by_inode(oti->oti_env, parent->d_inode,
if (rc)
RETURN(rc);
- /* prepare structures for MDS */
- rc = osd_mdt_init(env, dev);
- if (rc)
- osd_ost_fini(dev);
+ if (!dev->od_is_ost) {
+ rc = osd_mdt_init(env, dev);
+ if (rc)
+ osd_ost_fini(dev);
+ }
RETURN(rc);
}
* only happened for the RPC from other MDT during the
* OI scrub, or for the client side RPC with FID only,
* such as FID to path, or from old connected client. */
- if (!remote && !fid_is_on_ost(info, dev, fid, OI_CHECK_FLD)) {
+ if (!remote) {
rc1 = osd_lookup_in_remote_parent(info, dev, fid, id);
if (!rc1) {
remote = true;
/* done with de, release bh */
brelse(bh);
if (rc != 0) {
- if (unlikely(ino == osd_remote_parent_ino(dev))) {
+ if (unlikely(is_remote_parent_ino(dev, ino))) {
const char *name = (const char *)key;
/* If the parent is on remote MDT, and there
int rc = 0;
ENTRY;
- LASSERT(obj->oo_inode != dev->od_mdt_map->omm_remote_parent->d_inode);
+ LASSERT(!is_remote_parent_ino(dev, obj->oo_inode->i_ino));
if (attr & LUDA_VERIFY) {
- if (unlikely(ino == osd_remote_parent_ino(dev))) {
+ if (unlikely(is_remote_parent_ino(dev, ino))) {
attr |= LUDA_IGNORE;
/* If the parent is on remote MDT, and there
* is no FID-in-dirent, then we have to get
/* If the parent is on remote MDT, and there
* is no FID-in-dirent, then we have to get
* the parent FID from the linkEA. */
- if (ino == osd_remote_parent_ino(dev) && is_dotdot) {
+ if (is_remote_parent_ino(dev, ino) && is_dotdot) {
rc = osd_get_pfid_from_linkea(env, obj, fid);
} else {
if (is_dotdot == false &&
return (!fid_is_namespace_visible(fid) && !fid_is_idif(fid));
}
-static inline unsigned long osd_remote_parent_ino(struct osd_device *dev)
+static inline bool is_remote_parent_ino(struct osd_device *o, unsigned long ino)
{
- return dev->od_mdt_map->omm_remote_parent->d_inode->i_ino;
+ if (o->od_is_ost)
+ return false;
+
+ LASSERT(o->od_mdt_map != NULL);
+
+ return ino == o->od_mdt_map->omm_remote_parent->d_inode->i_ino;
}
/**
/* Not handle the backend root object and agent parent object.
* They are neither visible to namespace nor have OI mappings. */
if (unlikely(pos == osd_sb(dev)->s_root->d_inode->i_ino ||
- pos == osd_remote_parent_ino(dev)))
+ is_remote_parent_ino(dev, pos)))
RETURN(SCRUB_NEXT_CONTINUE);
osd_id_gen(lid, pos, OSD_OII_NOGEN);