Lines Matching defs:log
207 struct log_group *log)
210 arena->logoff + (lane * LOG_GRP_SIZE), log,
271 static u32 log_seq(struct log_group *log, int log_idx)
273 return le32_to_cpu(log->ent[log_idx].seq);
277 * This function accepts two log entries, and uses the
285 static int btt_log_get_old(struct arena_info *a, struct log_group *log)
296 if (log_seq(log, idx0) == 0) {
297 log->ent[idx0].seq = cpu_to_le32(1);
301 if (log_seq(log, idx0) == log_seq(log, idx1))
303 if (log_seq(log, idx0) + log_seq(log, idx1) > 5)
306 if (log_seq(log, idx0) < log_seq(log, idx1)) {
307 if ((log_seq(log, idx1) - log_seq(log, idx0)) == 1)
312 if ((log_seq(log, idx0) - log_seq(log, idx1)) == 1)
322 * This function copies the desired (old/new) log entry into ent if
324 * where the desired log entry was found. Negative return values
332 struct log_group log;
334 ret = btt_log_group_read(arena, lane, &log);
338 old_ent = btt_log_get_old(arena, &log);
341 "log corruption (%d): lane %d seq [%d, %d]\n",
342 old_ent, lane, log.ent[arena->log_index[0]].seq,
343 log.ent[arena->log_index[1]].seq);
351 memcpy(ent, &log.ent[arena->log_index[ret_ent]], LOG_ENT_SIZE);
357 * This function commits a log entry to media
447 * This function initializes the BTT log with 'fake' entries pointing
584 * so use the stripped out versions from the log as well for
586 * 'raw' version of the log entries as that captured what we
611 * Detecting valid log indices: We read a log group (see the comments in btt.h
620 * written to), it is safe to assume the 'new format' of log entries in slots
628 struct log_group log;
632 ret = btt_log_group_read(arena, i, &log);
638 if (ent_is_padding(&log.ent[j])) {
660 * that all subsequent log groups are either in
666 if (ent_is_padding(&log.ent[j]))
678 if (!ent_is_padding(&log.ent[j]))
697 * If all the entries in the log were in the initial state,
704 * Only allow the known permutations of log/padding indices,
777 /* The log takes a fixed amount of space based on nfree */
796 /* Default log indices are (0,1) */
892 "Unable to deduce log/padding indices\n");
1315 struct log_entry log;
1386 log.lba = cpu_to_le32(premap);
1387 log.old_map = cpu_to_le32(old_postmap);
1388 log.new_map = cpu_to_le32(new_postmap);
1389 log.seq = cpu_to_le32(arena->freelist[lane].seq);
1391 ret = btt_flog_write(arena, lane, sub, &log);