Lines Matching defs:lsn

262 	__le64 last_end_lsn;	// 0x08: lsn for the last log record which ends on the page,
396 struct LFS_RECORD_HDR *lrh; // Log record header of the current lsn.
411 /* Find the oldest lsn from active clients. */
417 u64 lsn = le64_to_cpu(cr->oldest_lsn);
419 /* Ignore this block if it's oldest lsn is 0. */
420 if (lsn && lsn < *oldest_lsn)
421 *oldest_lsn = lsn;
1064 static inline u32 lsn_to_vbo(struct ntfs_log *log, const u64 lsn)
1066 u32 vbo = (lsn << log->seq_num_bits) >> (log->seq_num_bits - 3);
1078 static inline u32 lsn_to_page_off(struct ntfs_log *log, u64 lsn)
1080 return (((u32)lsn) << 3) & log->page_mask;
1088 static inline bool is_lsn_in_file(struct ntfs_log *log, u64 lsn)
1090 return lsn >= log->oldest_lsn &&
1091 lsn <= le64_to_cpu(log->ra->current_lsn);
1098 return le64_to_cpu(hdr->rhdr.lsn);
1104 const struct RECORD_PAGE_HDR *hdr, u64 lsn)
1106 u64 h_lsn = le64_to_cpu(hdr->rhdr.lsn);
1108 (lsn < (lsn_to_vbo(log, h_lsn) & ~log->page_mask) ? 1 : 0))
1114 lsn) >>
1121 const struct CLIENT_REC *client, u64 lsn)
1123 return lsn >= le64_to_cpu(client->oldest_lsn) &&
1124 lsn <= le64_to_cpu(log->ra->current_lsn) && lsn;
1272 info->last_lsn = le64_to_cpu(r_page->rhdr.lsn);
1408 static u32 final_log_off(struct ntfs_log *log, u64 lsn, u32 data_len)
1410 u32 base_vbo = lsn << 3;
1421 * If this lsn is contained this log page we are done.
1450 u64 *lsn)
1471 * If the lsn we were given was not the last lsn on this page,
1472 * then the starting offset for the next lsn is on a quad word
1473 * boundary following the last file offset for the current lsn.
1476 if (this_lsn == le64_to_cpu(page->rhdr.lsn)) {
1487 /* Compute the lsn based on the file offset and the sequence count. */
1488 *lsn = vbo_to_lsn(log, vbo, seq);
1491 * If this lsn is within the legal range for the file, we return true.
1492 * Otherwise false indicates that there are no more lsn's.
1494 if (!is_lsn_in_file(log, *lsn))
1495 *lsn = 0;
1515 * If there is a last lsn the restart area then we know that we will
1517 * If there is no oldest lsn then start at the first page of the file.
1555 u64 lsn = le64_to_cpu(rhdr->lsn);
1561 * If the last lsn on the page occurs was written after the page
1564 lsn_seq = lsn >> log->file_data_bits;
1567 * If the sequence number for the lsn the page is equal or greater
1568 * than lsn we expect, then this is a subsequent write.
1572 vbo != (lsn_to_vbo(log, lsn) & ~log->page_mask));
1810 cur_page->rhdr.lsn == page->rhdr.lsn &&
1826 lsn_cur = le64_to_cpu(cur_page->rhdr.lsn);
1882 * check the ending lsn's.
1909 * If the last lsn is greater than the one on
1924 * Done if the last lsn on this page doesn't match the previous known
1925 * last lsn or the sequence number is not expected.
1927 lsn_cur = le64_to_cpu(page->rhdr.lsn);
2004 * Also remember the last known lsn.
2008 last_ok_lsn = le64_to_cpu(page->rhdr.lsn);
2187 /* Fill last flushed lsn value flush the page. */
2189 page->rhdr.lsn = page->record_hdr.last_end_lsn;
2240 u64 lsn = le64_to_cpu(rh->this_lsn);
2241 u32 vbo = lsn_to_vbo(log, lsn) & ~log->page_mask;
2242 u32 off = lsn_to_page_off(log, lsn) + log->record_header_len;
2263 * The last lsn on this page better be greater or equal
2264 * to the lsn we are copying.
2266 if (lsn > le64_to_cpu(ph->rhdr.lsn)) {
2276 lsn > le64_to_cpu(ph->record_hdr.last_end_lsn)) {
2283 if (ph->rhdr.lsn == ph->record_hdr.last_end_lsn ||
2284 lsn > le64_to_cpu(ph->rhdr.lsn)) {
2305 u64 *lsn)
2315 *lsn = 0;
2331 /* If the lsn values don't match, then the disk is corrupt. */
2336 *lsn = lsnr;
2370 static int find_log_rec(struct ntfs_log *log, u64 lsn, struct lcb *lcb)
2376 /* Read the record header for this lsn. */
2378 err = read_log_page(log, lsn_to_vbo(log, lsn),
2387 * If the lsn the log record doesn't match the desired
2388 * lsn then the disk is corrupt.
2390 if (lsn != le64_to_cpu(rh->this_lsn))
2422 u32 page_off = lsn_to_page_off(log, lsn);
2437 static int read_log_rec_lcb(struct ntfs_log *log, u64 lsn, u32 ctx_mode,
2453 /* Check that the given lsn is the legal range for this client. */
2456 if (!verify_client_lsn(log, cr, lsn))
2465 /* Find the log record indicated by the given lsn. */
2466 err = find_log_rec(log, lsn, lcb);
2482 * Attempt to find the next lsn to return to a client based on the context mode.
2484 static int find_client_next_lsn(struct ntfs_log *log, struct lcb *lcb, u64 *lsn)
2491 *lsn = 0;
2496 /* Loop as long as another lsn can be found. */
2522 *lsn = current_lsn;
2556 *lsn = next_lsn;
2561 static int read_next_log_rec(struct ntfs_log *log, struct lcb *lcb, u64 *lsn)
2565 err = find_client_next_lsn(log, lcb, lsn);
2569 if (!*lsn)
2580 return find_log_rec(log, *lsn, lcb);
2801 u64 lsn;
2806 lsn = le64_to_cpu(hdr->lsn);
2811 if (*rlsn > lsn)
3679 rec->rhdr.lsn = t64;
3681 ib->rhdr.lsn = t64;
3951 /* This is a pseudo lsn. */
3984 * Find the oldest client lsn. Use the last
3985 * flushed lsn as a starting point.
4032 /* Now we need to walk through looking for the last lsn. */
4207 * remembering the oldest lsn values.
4380 /* Start the analysis pass from the Checkpoint lsn. */
4383 /* Read the first lsn. */
4408 * The first lsn after the previous lsn remembered
4671 * the lowest lsn, and return it as the Redo lsn.
4863 * Read the record at the Redo lsn, before falling