summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7b6aaef)
if the underlying storage does not support range lookups,
then FLD disables any mappings with server index different
from 0, thus disabling DNE and FID-on-OST features.
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: Id93b01385acfafde024dff33557656afdcd1e4b3
Reviewed-on: http://review.whamcloud.com/4133
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
+ if (fld->lsf_no_range_lookup) {
+ /* Stub for underlying FS which can't lookup ranges */
+ return 0;
+ }
+
/* for ldiskfs OSD it's enough to declare operation with any ops
* with DMU we'll probably need to specify exact key/value */
rc = dt_obj->do_index_ops->dio_declare_delete(env, dt_obj, NULL, th);
/* for ldiskfs OSD it's enough to declare operation with any ops
* with DMU we'll probably need to specify exact key/value */
rc = dt_obj->do_index_ops->dio_declare_delete(env, dt_obj, NULL, th);
};
const struct dt_index_features fld_index_features = {
};
const struct dt_index_features fld_index_features = {
- .dif_flags = DT_IND_UPDATE,
+ .dif_flags = DT_IND_UPDATE | DT_IND_RANGE,
.dif_keysize_min = sizeof(seqno_t),
.dif_keysize_max = sizeof(seqno_t),
.dif_recsize_min = sizeof(struct lu_seq_range),
.dif_keysize_min = sizeof(seqno_t),
.dif_keysize_max = sizeof(seqno_t),
.dif_recsize_min = sizeof(struct lu_seq_range),
+ if (fld->lsf_no_range_lookup) {
+ /* Stub for underlying FS which can't lookup ranges */
+ return 0;
+ }
+
start = range->lsr_start;
LASSERT(range_is_sane(range));
start = range->lsr_start;
LASSERT(range_is_sane(range));
+ if (fld->lsf_no_range_lookup) {
+ /* Stub for underlying FS which can't lookup ranges */
+ if (range->lsr_index != 0) {
+ CERROR("%s: FLD backend does not support range"
+ "lookups, so DNE and FIDs-on-OST are not"
+ "supported in this configuration\n",
+ fld->lsf_name);
+ return -EINVAL;
+ }
+ }
+
start = range->lsr_start;
LASSERT(range_is_sane(range));
start = range->lsr_start;
LASSERT(range_is_sane(range));
+ if (fld->lsf_no_range_lookup) {
+ /* Stub for underlying FS which can't lookup ranges */
+ range->lsr_start = 0;
+ range->lsr_end = ~0;
+ range->lsr_index = 0;
+ range->lsr_flags = LU_SEQ_RANGE_MDT;
+
+ range_cpu_to_be(range, range);
+ return 0;
+ }
+
info = lu_context_key_get(&env->le_ctx, &fld_thread_key);
fld_rec = &info->fti_rec;
info = lu_context_key_get(&env->le_ctx, &fld_thread_key);
fld_rec = &info->fti_rec;
lu_object_put(env, &dt_obj->do_lu);
fld->lsf_obj = NULL;
}
lu_object_put(env, &dt_obj->do_lu);
fld->lsf_obj = NULL;
}
- } else
- CERROR("%s: File \"%s\" is not an index!\n",
- fld->lsf_name, fld_index_name);
+ } else if (rc == -ERANGE) {
+ CWARN("%s: File \"%s\" doesn't support range lookup, "
+ "using stub. DNE and FIDs on OST will not work "
+ "with this backend\n",
+ fld->lsf_name, fld_index_name);
+
+ LASSERT(dt_obj->do_index_ops == NULL);
+ fld->lsf_no_range_lookup = 1;
+ rc = 0;
+ } else {
+ CERROR("%s: File \"%s\" is not index, rc %d!\n",
+ fld->lsf_name, fld_index_name, rc);
+ lu_object_put(env, &fld->lsf_obj->do_lu);
+ fld->lsf_obj = NULL;
+ }
/**
* Fld service name in form "fld-srv-lustre-MDTXXX" */
char lsf_name[80];
/**
* Fld service name in form "fld-srv-lustre-MDTXXX" */
char lsf_name[80];
+
+ /**
+ * Backend does not support range lookups,
+ * indexes other that 0 will be prohibited */
+ int lsf_no_range_lookup;
};
struct lu_client_fld {
};
struct lu_client_fld {