Whamcloud - gitweb
LU-1187 osd: add remote entry insert for ZFS DNE.
[fs/lustre-release.git] / lustre / osd-zfs / osd_oi.c
index 427bde0..9cb4f1f 100644 (file)
@@ -219,6 +219,12 @@ int osd_fld_lookup(const struct lu_env *env, struct osd_device *osd,
        struct seq_server_site  *ss = osd_seq_site(osd);
        int                     rc;
 
+       if (fid_is_root(fid)) {
+               range->lsr_flags = LU_SEQ_RANGE_MDT;
+               range->lsr_index = 0;
+               return 0;
+       }
+
        if (fid_is_idif(fid)) {
                range->lsr_flags = LU_SEQ_RANGE_OST;
                range->lsr_index = fid_idif_ost_idx(fid);
@@ -227,6 +233,7 @@ int osd_fld_lookup(const struct lu_env *env, struct osd_device *osd,
 
        if (!fid_is_norm(fid)) {
                range->lsr_flags = LU_SEQ_RANGE_MDT;
+               /* If ss is NULL, it suppose not get lsr_index at all */
                if (ss != NULL)
                        range->lsr_index = ss->ss_node_id;
                return 0;
@@ -235,10 +242,9 @@ int osd_fld_lookup(const struct lu_env *env, struct osd_device *osd,
        LASSERT(ss != NULL);
        range->lsr_flags = -1;
        rc = fld_server_lookup(env, ss->ss_server_fld, fid_seq(fid), range);
-       if (rc != 0) {
+       if (rc != 0)
                CERROR("%s can not find "DFID": rc = %d\n",
-                      osd2lu_dev(osd)->ld_obd->obd_name, PFID(fid), rc);
-       }
+                      osd_name(osd), PFID(fid), rc);
        return rc;
 }
 
@@ -348,9 +354,6 @@ static struct osd_seq *osd_find_or_add_seq(const struct lu_env *env,
                GOTO(out, rc);
        }
 
-       if (seq == 0)
-               osd->od_ost_compat_grp0 = odb;
-
        for (i = 0; i < OSD_OST_MAP_SIZE; i++) {
                sprintf(key, "d%d", i);
                rc = osd_oi_find_or_create(env, osd, odb, key, &sdb);
@@ -437,10 +440,8 @@ uint64_t osd_get_name_n_idx(const struct lu_env *env, struct osd_device *osd,
        LASSERT(fid);
        LASSERT(buf);
 
-       if (fid_is_on_ost(env, osd, fid) == 1) {
+       if (fid_is_on_ost(env, osd, fid) == 1 || fid_seq(fid) == FID_SEQ_ECHO) {
                zapid = osd_get_idx_for_ost_obj(env, osd, fid, buf);
-       } else if (fid_is_last_id(fid)) {
-               zapid = osd->od_ost_compat_grp0;
        } else if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE)) {
                /* special objects with fixed known fids get their name */
                char *name = oid2name(fid_oid(fid));