struct lu_server_fld *fld;
struct dt_object *obj;
const struct dt_it_ops *iops;
+ struct dt_key *key;
+ int rc;
if (param == NULL || param->fsp_stop)
return NULL;
LASSERT(obj != NULL);
iops = &obj->do_index_ops->dio_it;
- iops->load(¶m->fsp_env, param->fsp_it, *pos);
+ rc = iops->load(¶m->fsp_env, param->fsp_it, *pos);
+ if (rc <= 0)
+ return NULL;
+
+ key = iops->key(¶m->fsp_env, param->fsp_it);
+ if (IS_ERR(key))
+ return NULL;
+
+ *pos = be64_to_cpu(*(__u64 *)key);
- *pos = be64_to_cpu(*(__u64 *)iops->key(¶m->fsp_env, param->fsp_it));
return param;
}
RETURN(rc);
}
- rc = fld_index_init(env, fld, dt);
+ rc = fld_index_init(env, fld, dt, type);
if (rc)
GOTO(out_cache, rc);
}
int fld_index_init(const struct lu_env *env, struct lu_server_fld *fld,
- struct dt_device *dt)
+ struct dt_device *dt, int type)
{
struct dt_object *dt_obj = NULL;
struct lu_fid fid;
else
rc = 0;
- if (index == 0) {
+ if (index == 0 && type == LU_SEQ_RANGE_MDT) {
/* Note: fld_insert_entry will detect whether these
* special entries already exist inside FLDB */
mutex_lock(&fld->lsf_lock);
struct dt_device;
int fld_index_init(const struct lu_env *env, struct lu_server_fld *fld,
- struct dt_device *dt);
+ struct dt_device *dt, int type);
void fld_index_fini(const struct lu_env *env, struct lu_server_fld *fld);
struct lu_server_fld *fld;
struct dt_object *obj;
const struct dt_it_ops *iops;
+ struct dt_key *key;
+ int rc;
if (param == NULL || param->fsp_stop)
return NULL;
LASSERT(obj != NULL);
iops = &obj->do_index_ops->dio_it;
- iops->load(¶m->fsp_env, param->fsp_it, *pos);
+ rc = iops->load(¶m->fsp_env, param->fsp_it, *pos);
+ if (rc <= 0)
+ return NULL;
+
+ key = iops->key(¶m->fsp_env, param->fsp_it);
+ if (IS_ERR(key))
+ return NULL;
+
+ *pos = be64_to_cpu(*(__u64 *)key);
- *pos = be64_to_cpu(*(__u64 *)iops->key(¶m->fsp_env, param->fsp_it));
return param;
}