- obd->obd_recovery_max_time = val;
- return count;
-}
-EXPORT_SYMBOL(lprocfs_obd_wr_recovery_maxtime);
-
-
-/**** Changelogs *****/
-#define D_CHANGELOG 0
-
-/* How many records per seq_show. Too small, we spawn llog_process threads
- too often; too large, we run out of buffer space */
-#define CHANGELOG_CHUNK_SIZE 100
-
-static int changelog_show_cb(struct llog_handle *llh, struct llog_rec_hdr *hdr,
- void *data)
-{
- struct seq_file *seq = (struct seq_file *)data;
- struct changelog_seq_iter *csi = seq->private;
- struct llog_changelog_rec *rec = (struct llog_changelog_rec *)hdr;
- char *ptr;
- int cnt, rc;
- ENTRY;
-
- if ((rec->cr_hdr.lrh_type != CHANGELOG_REC) ||
- (rec->cr.cr_type >= CL_LAST)) {
- CERROR("Not a changelog rec %d/%d\n", rec->cr_hdr.lrh_type,
- rec->cr.cr_type);
- RETURN(-EINVAL);
- }
-
- CDEBUG(D_CHANGELOG, "rec="LPU64" start="LPU64" cat=%d:%d start=%d:%d\n",
- rec->cr.cr_index, csi->csi_startrec,
- llh->lgh_hdr->llh_cat_idx, llh->lgh_cur_idx,
- csi->csi_startcat, csi->csi_startidx);
-
- if (rec->cr.cr_index < csi->csi_startrec)
- /* Skip entries earlier than what we are interested in */
- RETURN(0);
- if (rec->cr.cr_index == csi->csi_startrec) {
- /* Remember where we started, since seq_read will re-read
- * the data when it reallocs space. Sigh, if only there was
- * a way to tell seq_file how big the buf should be in the
- * first place...
- */
- csi->csi_startcat = llh->lgh_hdr->llh_cat_idx;
- csi->csi_startidx = rec->cr_hdr.lrh_index - 1;
- }
- if (csi->csi_wrote > CHANGELOG_CHUNK_SIZE) {
- /* Stop at some point with a reasonable seq_file buffer size.
- * Start from here the next time.
- */
- csi->csi_endrec = rec->cr.cr_index - 1;
- csi->csi_startcat = llh->lgh_hdr->llh_cat_idx;
- csi->csi_startidx = rec->cr_hdr.lrh_index - 1;
- csi->csi_wrote = 0;
- RETURN(LLOG_PROC_BREAK);
- }
-
- CDEBUG(D_CHANGELOG, LPU64" %02d%-5s "LPU64" 0x%x t="DFID" p="DFID
- " %.*s\n", rec->cr.cr_index, rec->cr.cr_type,
- changelog_type2str(rec->cr.cr_type), rec->cr.cr_time,
- rec->cr.cr_flags & CLF_FLAGMASK,
- PFID(&rec->cr.cr_tfid), PFID(&rec->cr.cr_pfid),
- rec->cr.cr_namelen, rec->cr.cr_name);
-
- cnt = sizeof(rec->cr) + rec->cr.cr_namelen;
- ptr = (char *)(&rec->cr);
- CDEBUG(D_CHANGELOG, "packed rec %d starting at %p\n", cnt, ptr);
- rc = 0;
- while ((cnt-- > 0) && (rc == 0)) {
- rc = seq_putc(seq, *ptr);
- ptr++;
- }
-
- if (rc < 0) {
- /* Ran out of room in the seq buffer. seq_read will dump
- * the whole buffer and re-seq_start with a larger one;
- * no point in continuing the llog_process */
- CDEBUG(D_CHANGELOG, "rec="LPU64" overflow "LPU64"<-"LPU64"\n",
- rec->cr.cr_index, csi->csi_startrec, csi->csi_endrec);
- csi->csi_endrec = csi->csi_startrec - 1;
- csi->csi_wrote = 0;
- RETURN(LLOG_PROC_BREAK);
- }
-
- csi->csi_wrote++;
- csi->csi_endrec = rec->cr.cr_index;