LASSERTF(iter->lpi_magic == POOL_IT_MAGIC, "%08X\n", iter->lpi_magic);
+ (*pos)++;
/* test if end of file */
- if (*pos >= pool_tgt_count(iter->lpi_pool))
+ if (*pos > pool_tgt_count(iter->lpi_pool))
return NULL;
OBD_FAIL_TIMEOUT(OBD_FAIL_OST_LIST_ASSERT, cfs_fail_val);
iter->lpi_idx = prev_idx; /* we stay on the last entry */
return NULL;
}
- (*pos)++;
+
/* return != NULL to continue */
return iter;
}
struct lu_tgt_descs *ltd = is_mdt ? &lod->lod_mdt_descs :
&lod->lod_ost_descs;
- if (*pos >= ltd->ltd_tgts_size - 1)
+ (*pos)++;
+ if (*pos > ltd->ltd_tgts_size - 1)
return NULL;
*pos = find_next_bit(ltd->ltd_tgt_bitmap,
- ltd->ltd_tgts_size, *pos + 1);
+ ltd->ltd_tgts_size, *pos);
if (*pos < ltd->ltd_tgts_size)
return LTD_TGT(ltd, *pos);
else
*/
static void *mdt_hsm_actions_debugfs_start(struct seq_file *s, loff_t *pos)
{
- struct agent_action_iterator *aai = s->private;
+ struct agent_action_iterator *aai = s->private;
+
ENTRY;
LASSERTF(aai->aai_magic == AGENT_ACTIONS_IT_MAGIC, "%08X\n",
aai->aai_cat_index = 0;
aai->aai_index = 0;
aai->aai_eof = false;
- *pos = 1;
}
if (aai->aai_eof)
static void *mdt_hsm_actions_debugfs_next(struct seq_file *s, void *v,
loff_t *pos)
{
- RETURN(NULL);
+ struct agent_action_iterator *aai = s->private;
+
+ (*pos)++;
+ if (aai->aai_eof)
+ RETURN(NULL);
+ RETURN(aai);
}
/**
struct llog_rec_hdr *hdr,
void *data)
{
- struct llog_agent_req_rec *larr = (struct llog_agent_req_rec *)hdr;
- struct seq_file *s = data;
- struct agent_action_iterator *aai;
- int sz;
- char buf[12];
+ struct llog_agent_req_rec *larr = (struct llog_agent_req_rec *)hdr;
+ struct seq_file *s = data;
+ struct agent_action_iterator *aai = s->private;
+ int sz;
+ char buf[12];
+
ENTRY;
- aai = s->private;
LASSERTF(aai->aai_magic == AGENT_ACTIONS_IT_MAGIC, "%08X\n",
aai->aai_magic);
*/
static int mdt_hsm_actions_debugfs_show(struct seq_file *s, void *v)
{
- struct agent_action_iterator *aai = s->private;
- struct coordinator *cdt = &aai->aai_mdt->mdt_coordinator;
- int rc;
+ struct agent_action_iterator *aai = s->private;
+ struct coordinator *cdt = &aai->aai_mdt->mdt_coordinator;
+ int rc;
+
ENTRY;
LASSERTF(aai->aai_magic == AGENT_ACTIONS_IT_MAGIC, "%08X\n",
aai->aai_eof = true;
if (rc == LLOG_PROC_BREAK) /* buffer full */
rc = 0;
+
RETURN(rc);
}
static void mdt_hsm_actions_debugfs_stop(struct seq_file *s, void *v)
{
struct agent_action_iterator *aai = s->private;
+
ENTRY;
LASSERTF(aai->aai_magic == AGENT_ACTIONS_IT_MAGIC, "%08X\n",