Lines Matching refs: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;
1060 static inline u32 lsn_to_vbo(struct ntfs_log *log, const u64 lsn)
1062 u32 vbo = (lsn << log->seq_num_bits) >> (log->seq_num_bits - 3);
1074 static inline u32 lsn_to_page_off(struct ntfs_log *log, u64 lsn)
1076 return (((u32)lsn) << 3) & log->page_mask;
1084 static inline bool is_lsn_in_file(struct ntfs_log *log, u64 lsn)
1086 return lsn >= log->oldest_lsn &&
1087 lsn <= le64_to_cpu(log->ra->current_lsn);
1094 return le64_to_cpu(hdr->rhdr.lsn);
1100 const struct RECORD_PAGE_HDR *hdr, u64 lsn)
1102 u64 h_lsn = le64_to_cpu(hdr->rhdr.lsn);
1104 (lsn < (lsn_to_vbo(log, h_lsn) & ~log->page_mask) ? 1 : 0))
1110 lsn) >>
1117 const struct CLIENT_REC *client, u64 lsn)
1119 return lsn >= le64_to_cpu(client->oldest_lsn) &&
1120 lsn <= le64_to_cpu(log->ra->current_lsn) && lsn;
1267 info->last_lsn = le64_to_cpu(r_page->rhdr.lsn);
1403 static u32 final_log_off(struct ntfs_log *log, u64 lsn, u32 data_len)
1405 u32 base_vbo = lsn << 3;
1416 * If this lsn is contained this log page we are done.
1445 u64 *lsn)
1466 * If the lsn we were given was not the last lsn on this page,
1467 * then the starting offset for the next lsn is on a quad word
1468 * boundary following the last file offset for the current lsn.
1471 if (this_lsn == le64_to_cpu(page->rhdr.lsn)) {
1482 /* Compute the lsn based on the file offset and the sequence count. */
1483 *lsn = vbo_to_lsn(log, vbo, seq);
1486 * If this lsn is within the legal range for the file, we return true.
1487 * Otherwise false indicates that there are no more lsn's.
1489 if (!is_lsn_in_file(log, *lsn))
1490 *lsn = 0;
1510 * If there is a last lsn the restart area then we know that we will
1512 * If there is no oldest lsn then start at the first page of the file.
1550 u64 lsn = le64_to_cpu(rhdr->lsn);
1556 * If the last lsn on the page occurs was written after the page
1559 lsn_seq = lsn >> log->file_data_bits;
1562 * If the sequence number for the lsn the page is equal or greater
1563 * than lsn we expect, then this is a subsequent write.
1567 vbo != (lsn_to_vbo(log, lsn) & ~log->page_mask));
1805 cur_page->rhdr.lsn == page->rhdr.lsn &&
1821 lsn_cur = le64_to_cpu(cur_page->rhdr.lsn);
1877 * check the ending lsn's.
1904 * If the last lsn is greater than the one on
1919 * Done if the last lsn on this page doesn't match the previous known
1920 * last lsn or the sequence number is not expected.
1922 lsn_cur = le64_to_cpu(page->rhdr.lsn);
1999 * Also remember the last known lsn.
2003 last_ok_lsn = le64_to_cpu(page->rhdr.lsn);
2182 /* Fill last flushed lsn value flush the page. */
2184 page->rhdr.lsn = page->record_hdr.last_end_lsn;
2235 u64 lsn = le64_to_cpu(rh->this_lsn);
2236 u32 vbo = lsn_to_vbo(log, lsn) & ~log->page_mask;
2237 u32 off = lsn_to_page_off(log, lsn) + log->record_header_len;
2258 * The last lsn on this page better be greater or equal
2259 * to the lsn we are copying.
2261 if (lsn > le64_to_cpu(ph->rhdr.lsn)) {
2271 lsn > le64_to_cpu(ph->record_hdr.last_end_lsn)) {
2278 if (ph->rhdr.lsn == ph->record_hdr.last_end_lsn ||
2279 lsn > le64_to_cpu(ph->rhdr.lsn)) {
2300 u64 *lsn)
2310 *lsn = 0;
2326 /* If the lsn values don't match, then the disk is corrupt. */
2331 *lsn = lsnr;
2365 static int find_log_rec(struct ntfs_log *log, u64 lsn, struct lcb *lcb)
2371 /* Read the record header for this lsn. */
2373 err = read_log_page(log, lsn_to_vbo(log, lsn),
2382 * If the lsn the log record doesn't match the desired
2383 * lsn then the disk is corrupt.
2385 if (lsn != le64_to_cpu(rh->this_lsn))
2417 u32 page_off = lsn_to_page_off(log, lsn);
2432 static int read_log_rec_lcb(struct ntfs_log *log, u64 lsn, u32 ctx_mode,
2448 /* Check that the given lsn is the legal range for this client. */
2451 if (!verify_client_lsn(log, cr, lsn))
2460 /* Find the log record indicated by the given lsn. */
2461 err = find_log_rec(log, lsn, lcb);
2477 * Attempt to find the next lsn to return to a client based on the context mode.
2479 static int find_client_next_lsn(struct ntfs_log *log, struct lcb *lcb, u64 *lsn)
2486 *lsn = 0;
2491 /* Loop as long as another lsn can be found. */
2517 *lsn = current_lsn;
2551 *lsn = next_lsn;
2556 static int read_next_log_rec(struct ntfs_log *log, struct lcb *lcb, u64 *lsn)
2560 err = find_client_next_lsn(log, lcb, lsn);
2564 if (!*lsn)
2575 return find_log_rec(log, *lsn, lcb);
2796 u64 lsn;
2801 lsn = le64_to_cpu(hdr->lsn);
2806 if (*rlsn > lsn)
3674 rec->rhdr.lsn = t64;
3676 ib->rhdr.lsn = t64;
3943 /* This is a pseudo lsn. */
3976 * Find the oldest client lsn. Use the last
3977 * flushed lsn as a starting point.
4024 /* Now we need to walk through looking for the last lsn. */
4199 * remembering the oldest lsn values.
4349 /* Start the analysis pass from the Checkpoint lsn. */
4352 /* Read the first lsn. */
4377 * The first lsn after the previous lsn remembered
4640 * the lowest lsn, and return it as the Redo lsn.
4832 * Read the record at the Redo lsn, before falling