unsigned int page;
unsigned int off;
obd_id *data;
- __u64 connect_flags;
__u32 size;
int rc = 0;
ENTRY;
off = idx % OBJID_PER_PAGE();
data = mds->mds_lov_page_array[page];
- size = sizeof(__u64);
- connect_flags = idx;
- rc = obd_get_info(lov_exp, sizeof(KEY_CONNECT_FLAG), KEY_CONNECT_FLAG,
- &size, &connect_flags, NULL);
- if (rc)
- GOTO(out, rc);
-
- if (data[off] < 2 || connect_flags & OBD_CONNECT_SKIP_ORPHAN) {
+ if (data[off] < 2) {
/* We never read this lastid; ask the osc */
struct obd_id_info lastid;
filter_set_last_id(filter, id, doa.o_seq);
rc = filter_update_last_objid(exp->exp_obd, doa.o_seq, 1);
} else {
- /* don't reuse orphan object, return last used objid */
+ /*
+ * We have destroyed orphan objects, but don't want to reuse
+ * them. Therefore we don't reset last_id to the last created
+ * objects. Instead, we report back to the MDS the object id
+ * of the last orphan, so that the MDS can restart allocating
+ * objects from this id + 1 and thus skip the whole orphan
+ * object id range
+ */
oa->o_id = last;
rc = 0;
}
oscc->oscc_last_id = oa->o_id;
ocd = &imp->imp_connect_data;
if (ocd->ocd_connect_flags & OBD_CONNECT_SKIP_ORPHAN) {
+ /*
+ * The OST reports back in oa->o_id from where
+ * we should restart in order to skip orphan
+ * objects
+ */
CDEBUG(D_HA, "%s: Skip orphan set, reset last "
"objid\n", oscc->oscc_obd->obd_name);
oscc->oscc_next_id = oa->o_id + 1;