rc = seq_proc_write_common(file, buffer, count,
data, &seq->lss_space);
if (rc == 0) {
- CDEBUG(D_INFO, "%s: Sequences space has "
- "changed to "DRANGE"\n", seq->lss_name,
- PRANGE(&seq->lss_space));
+ CDEBUG(D_INFO, "%s: Space: "DRANGE"\n",
+ seq->lss_name, PRANGE(&seq->lss_space));
}
up(&seq->lss_sem);
int count, int *eof, void *data)
{
struct lu_server_seq *seq = (struct lu_server_seq *)data;
+ struct client_obd *cli;
int rc;
ENTRY;
*eof = 1;
if (seq->lss_cli) {
- struct obd_export *exp = seq->lss_cli->lcs_exp;
-
- rc = snprintf(page, count, "%s\n",
- exp->exp_client_uuid.uuid);
+ if (seq->lss_cli->lcs_exp != NULL) {
+ cli = &seq->lss_cli->lcs_exp->exp_obd->u.cli;
+ rc = snprintf(page, count, "%s\n",
+ cli->cl_target_uuid.uuid);
+ } else {
+ rc = snprintf(page, count, "%s\n",
+ seq->lss_cli->lcs_srv->lss_name);
+ }
} else {
- rc = snprintf(page, count, "<not assigned>\n");
+ rc = snprintf(page, count, "<none>\n");
}
RETURN(rc);
seq->lss_width = val;
if (rc == 0) {
- CDEBUG(D_INFO, "%s: Allocation unit has changed to "
- LPU64"\n", seq->lss_name, seq->lss_width);
+ CDEBUG(D_INFO, "%s: Width: "LPU64"\n",
+ seq->lss_name, seq->lss_width);
}
up(&seq->lss_sem);
data, &seq->lcs_space);
if (rc == 0) {
- CDEBUG(D_INFO, "%s: Sequences space has "
- "changed to "DRANGE"\n", seq->lcs_name,
- PRANGE(&seq->lcs_space));
+ CDEBUG(D_INFO, "%s: Space: "DRANGE"\n",
+ seq->lcs_name, PRANGE(&seq->lcs_space));
}
up(&seq->lcs_sem);
}
static int
-seq_client_proc_read_next_fid(char *page, char **start, off_t off,
- int count, int *eof, void *data)
+seq_client_proc_read_fid(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
{
struct lu_client_seq *seq = (struct lu_client_seq *)data;
int rc;
if (seq->lcs_exp != NULL) {
cli = &seq->lcs_exp->exp_obd->u.cli;
rc = snprintf(page, count, "%s\n", cli->cl_target_uuid.uuid);
- } else
- /*
- * Export-less sequence, see mdt_seq_init().
- */
- rc = snprintf(page, count, "none\n");
+ } else {
+ rc = snprintf(page, count, "%s\n", seq->lcs_srv->lss_name);
+ }
RETURN(rc);
}
{ "space", seq_client_proc_read_space, seq_client_proc_write_space, NULL },
{ "width", seq_client_proc_read_width, seq_client_proc_write_width, NULL },
{ "server", seq_client_proc_read_server, NULL, NULL },
- { "next_fid", seq_client_proc_read_next_fid, NULL, NULL },
+ { "fid", seq_client_proc_read_fid, NULL, NULL },
{ NULL }};
#endif
}
static int mdd_dir_page_build(const struct lu_env *env, int first,
- void *area, int nob,
- struct dt_it_ops *iops, struct dt_it *it,
- __u32 *start, __u32 *end, struct lu_dirent **last)
+ void *area, int nob, struct dt_it_ops *iops,
+ struct dt_it *it, __u32 *start, __u32 *end,
+ struct lu_dirent **last)
{
- int result;
+ struct lu_fid *fid2 = &mdd_env_info(env)->mti_fid2;
struct mdd_thread_info *info = mdd_env_info(env);
struct lu_fid *fid = &info->mti_fid;
+ int result;
struct lu_dirent *ent;
if (first) {
len = iops->key_size(env, it);
fid = (struct lu_fid *)iops->rec(env, it);
+ fid_be_to_cpu(fid2, fid);
recsize = (sizeof(*ent) + len + 3) & ~3;
hash = iops->store(env, it);
+ if (ent != area) {
+ /*
+ * This is not first entry, *start is initialized so
+ * that we can check hash for validness, that is, if it
+ * fits into allowed range. It should not be smaller
+ * than *start. Otherwise - iam iterator is buggy.
+ */
+ if (hash < *start) {
+ CERROR("Entry hash (%#8.8x) < page hash (%#8.8x) - ["
+ "%p %p %d "DFID": %#8.8x (%d) \"%*.*s\"]\n",
+ hash, *start, name, ent, nob, PFID(fid2), hash,
+ len, len, len, name);
+ result = iops->next(env, it);
+ continue;
+ }
+ }
+
*end = hash;
+
CDEBUG(D_INFO, "%p %p %d "DFID": %#8.8x (%d) \"%*.*s\"\n",
- name, ent, nob, PFID(fid), hash, len, len, len, name);
+ name, ent, nob, PFID(fid2), hash, len, len, len, name);
if (nob >= recsize) {
fid_be_to_cpu(&ent->lde_fid, fid);