Lines Matching refs:lcb
395 struct lcb {
403 static void lcb_put(struct lcb *lcb)
405 if (lcb->alloc)
406 kfree(lcb->log_rec);
407 kfree(lcb->lrh);
408 kfree(lcb);
2365 static int find_log_rec(struct ntfs_log *log, u64 lsn, struct lcb *lcb)
2368 struct LFS_RECORD_HDR *rh = lcb->lrh;
2376 lcb->lrh = rh;
2408 lcb->log_rec = lr;
2409 lcb->alloc = true;
2422 lcb->log_rec = Add2Ptr(rh, sizeof(struct LFS_RECORD_HDR));
2423 lcb->alloc = false;
2433 struct lcb **lcb_)
2437 struct lcb *lcb;
2454 lcb = kzalloc(sizeof(struct lcb), GFP_NOFS);
2455 if (!lcb)
2457 lcb->client = log->client_id;
2458 lcb->ctx_mode = ctx_mode;
2461 err = find_log_rec(log, lsn, lcb);
2465 *lcb_ = lcb;
2469 lcb_put(lcb);
2479 static int find_client_next_lsn(struct ntfs_log *log, struct lcb *lcb, u64 *lsn)
2485 hdr = lcb->lrh;
2488 if (lcb_ctx_next != lcb->ctx_mode)
2502 if (hdr != lcb->lrh)
2511 if (memcmp(&hdr->client, &lcb->client,
2515 kfree(lcb->lrh);
2516 lcb->lrh = hdr;
2523 if (hdr != lcb->lrh)
2528 if (lcb_ctx_undo_next == lcb->ctx_mode)
2530 else if (lcb_ctx_prev == lcb->ctx_mode)
2548 kfree(lcb->lrh);
2549 lcb->lrh = hdr;
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);
2567 if (lcb->alloc)
2568 kfree(lcb->log_rec);
2570 lcb->log_rec = NULL;
2571 lcb->alloc = false;
2572 kfree(lcb->lrh);
2573 lcb->lrh = NULL;
2575 return find_log_rec(log, *lsn, lcb);
3736 struct lcb *lcb = NULL;
4109 err = read_log_rec_lcb(log, t64, lcb_ctx_prev, &lcb);
4113 lrh = lcb->log_rec;
4114 frh = lcb->lrh;
4140 lcb_put(lcb);
4141 lcb = NULL;
4149 err = read_log_rec_lcb(log, t64, lcb_ctx_prev, &lcb);
4153 lrh = lcb->log_rec;
4154 frh = lcb->lrh;
4194 lcb_put(lcb);
4195 lcb = NULL;
4227 err = read_log_rec_lcb(log, t64, lcb_ctx_prev, &lcb);
4231 lrh = lcb->log_rec;
4232 frh = lcb->lrh;
4250 lcb_put(lcb);
4251 lcb = NULL;
4259 err = read_log_rec_lcb(log, t64, lcb_ctx_prev, &lcb);
4263 lrh = lcb->log_rec;
4264 frh = lcb->lrh;
4312 lcb_put(lcb);
4313 lcb = NULL;
4353 err = read_log_rec_lcb(log, checkpt_lsn, lcb_ctx_next, &lcb);
4359 err = read_next_log_rec(log, lcb, &rec_lsn);
4366 frh = lcb->lrh;
4369 lrh = lcb->log_rec;
4635 lcb_put(lcb);
4636 lcb = NULL;
4835 err = read_log_rec_lcb(log, rlsn, lcb_ctx_next, &lcb);
4844 frh = lcb->lrh;
4851 lrh = lcb->log_rec;
4960 err = read_next_log_rec(log, lcb, &rec_lsn);
4964 lcb_put(lcb);
4965 lcb = NULL;
4991 err = read_log_rec_lcb(log, undo_next_lsn, lcb_ctx_undo_next, &lcb);
5001 lrh = lcb->log_rec;
5002 frh = lcb->lrh;
5067 err = read_next_log_rec(log, lcb, &rec_lsn);
5074 lcb_put(lcb);
5075 lcb = NULL;
5137 if (lcb)
5138 lcb_put(lcb);