Lines Matching refs:segbuf
397 struct nilfs_segment_buffer *segbuf = sci->sc_curseg; in nilfs_segctor_map_segsum_entry() local
404 &segbuf->sb_segsum_buffers)); in nilfs_segctor_map_segsum_entry()
418 struct nilfs_segment_buffer *segbuf = sci->sc_curseg; in nilfs_segctor_reset_segment_buffer() local
426 err = nilfs_segbuf_reset(segbuf, flags, sci->sc_seg_ctime, sci->sc_cno); in nilfs_segctor_reset_segment_buffer()
430 sumbh = NILFS_SEGBUF_FIRST_BH(&segbuf->sb_segsum_buffers); in nilfs_segctor_reset_segment_buffer()
431 sumbytes = segbuf->sb_sum.sumbytes; in nilfs_segctor_reset_segment_buffer()
470 struct nilfs_segment_buffer *segbuf = sci->sc_curseg; in nilfs_segctor_add_super_root() local
473 if (segbuf->sb_sum.nblocks >= segbuf->sb_rest_blocks) { in nilfs_segctor_add_super_root()
477 segbuf = sci->sc_curseg; in nilfs_segctor_add_super_root()
479 err = nilfs_segbuf_extend_payload(segbuf, &segbuf->sb_super_root); in nilfs_segctor_add_super_root()
481 segbuf->sb_sum.flags |= NILFS_SS_SR; in nilfs_segctor_add_super_root()
519 struct nilfs_segment_buffer *segbuf; in nilfs_segctor_end_finfo() local
541 segbuf = sci->sc_curseg; in nilfs_segctor_end_finfo()
542 segbuf->sb_sum.sumbytes = sci->sc_binfo_ptr.offset + in nilfs_segctor_end_finfo()
543 sci->sc_super->s_blocksize * (segbuf->sb_sum.nsumblk - 1); in nilfs_segctor_end_finfo()
553 struct nilfs_segment_buffer *segbuf; in nilfs_segctor_add_file_block() local
557 segbuf = sci->sc_curseg; in nilfs_segctor_add_file_block()
560 if (segbuf->sb_sum.nblocks + required + 1 > segbuf->sb_rest_blocks) { in nilfs_segctor_add_file_block()
569 err = nilfs_segbuf_extend_segsum(segbuf); in nilfs_segctor_add_file_block()
578 nilfs_segbuf_add_file_buffer(segbuf, bh); in nilfs_segctor_add_file_block()
1314 struct nilfs_segment_buffer *segbuf, *prev; in nilfs_segctor_begin_construction() local
1318 segbuf = nilfs_segbuf_new(sci->sc_super); in nilfs_segctor_begin_construction()
1319 if (unlikely(!segbuf)) in nilfs_segctor_begin_construction()
1323 nilfs_segbuf_map(segbuf, nilfs->ns_segnum, in nilfs_segctor_begin_construction()
1325 if (segbuf->sb_rest_blocks < NILFS_PSEG_MIN_BLOCKS) { in nilfs_segctor_begin_construction()
1327 nilfs_segbuf_map(segbuf, nilfs->ns_segnum, 0, nilfs); in nilfs_segctor_begin_construction()
1330 segbuf->sb_sum.seg_seq = nilfs->ns_seg_seq; in nilfs_segctor_begin_construction()
1339 nilfs_segbuf_map_cont(segbuf, prev); in nilfs_segctor_begin_construction()
1340 segbuf->sb_sum.seg_seq = prev->sb_sum.seg_seq; in nilfs_segctor_begin_construction()
1343 if (segbuf->sb_rest_blocks < NILFS_PSEG_MIN_BLOCKS) { in nilfs_segctor_begin_construction()
1344 nilfs_segbuf_map(segbuf, prev->sb_nextnum, 0, nilfs); in nilfs_segctor_begin_construction()
1345 segbuf->sb_sum.seg_seq++; in nilfs_segctor_begin_construction()
1350 err = nilfs_sufile_mark_dirty(nilfs->ns_sufile, segbuf->sb_segnum); in nilfs_segctor_begin_construction()
1359 nilfs_segbuf_set_next_segnum(segbuf, nextnum, nilfs); in nilfs_segctor_begin_construction()
1362 list_add_tail(&segbuf->sb_list, &sci->sc_segbufs); in nilfs_segctor_begin_construction()
1363 sci->sc_segbuf_nblocks = segbuf->sb_rest_blocks; in nilfs_segctor_begin_construction()
1367 nilfs_segbuf_free(segbuf); in nilfs_segctor_begin_construction()
1374 struct nilfs_segment_buffer *segbuf, *prev; in nilfs_segctor_extend_segments() local
1394 segbuf = nilfs_segbuf_new(sci->sc_super); in nilfs_segctor_extend_segments()
1395 if (unlikely(!segbuf)) in nilfs_segctor_extend_segments()
1399 nilfs_segbuf_map(segbuf, prev->sb_nextnum, 0, nilfs); in nilfs_segctor_extend_segments()
1400 sci->sc_segbuf_nblocks += segbuf->sb_rest_blocks; in nilfs_segctor_extend_segments()
1407 segbuf->sb_sum.seg_seq = prev->sb_sum.seg_seq + 1; in nilfs_segctor_extend_segments()
1408 nilfs_segbuf_set_next_segnum(segbuf, nextnextnum, nilfs); in nilfs_segctor_extend_segments()
1410 list_add_tail(&segbuf->sb_list, &list); in nilfs_segctor_extend_segments()
1411 prev = segbuf; in nilfs_segctor_extend_segments()
1417 nilfs_segbuf_free(segbuf); in nilfs_segctor_extend_segments()
1419 list_for_each_entry(segbuf, &list, sb_list) { in nilfs_segctor_extend_segments()
1420 ret = nilfs_sufile_free(sufile, segbuf->sb_nextnum); in nilfs_segctor_extend_segments()
1430 struct nilfs_segment_buffer *segbuf, *prev; in nilfs_free_incomplete_logs() local
1434 segbuf = NILFS_FIRST_SEGBUF(logs); in nilfs_free_incomplete_logs()
1435 if (nilfs->ns_nextnum != segbuf->sb_nextnum) { in nilfs_free_incomplete_logs()
1436 ret = nilfs_sufile_free(sufile, segbuf->sb_nextnum); in nilfs_free_incomplete_logs()
1439 if (atomic_read(&segbuf->sb_err)) { in nilfs_free_incomplete_logs()
1441 if (segbuf->sb_pseg_start != segbuf->sb_fseg_start) in nilfs_free_incomplete_logs()
1446 nilfs_terminate_segment(nilfs, segbuf->sb_fseg_start, in nilfs_free_incomplete_logs()
1447 segbuf->sb_fseg_end); in nilfs_free_incomplete_logs()
1452 prev = segbuf; in nilfs_free_incomplete_logs()
1453 list_for_each_entry_continue(segbuf, logs, sb_list) { in nilfs_free_incomplete_logs()
1454 if (prev->sb_nextnum != segbuf->sb_nextnum) { in nilfs_free_incomplete_logs()
1455 ret = nilfs_sufile_free(sufile, segbuf->sb_nextnum); in nilfs_free_incomplete_logs()
1458 if (atomic_read(&segbuf->sb_err) && in nilfs_free_incomplete_logs()
1459 segbuf->sb_segnum != nilfs->ns_nextnum) in nilfs_free_incomplete_logs()
1461 nilfs_sufile_set_error(sufile, segbuf->sb_segnum); in nilfs_free_incomplete_logs()
1462 prev = segbuf; in nilfs_free_incomplete_logs()
1469 struct nilfs_segment_buffer *segbuf; in nilfs_segctor_update_segusage() local
1473 list_for_each_entry(segbuf, &sci->sc_segbufs, sb_list) { in nilfs_segctor_update_segusage()
1474 live_blocks = segbuf->sb_sum.nblocks + in nilfs_segctor_update_segusage()
1475 (segbuf->sb_pseg_start - segbuf->sb_fseg_start); in nilfs_segctor_update_segusage()
1476 ret = nilfs_sufile_set_segment_usage(sufile, segbuf->sb_segnum, in nilfs_segctor_update_segusage()
1485 struct nilfs_segment_buffer *segbuf; in nilfs_cancel_segusage() local
1488 segbuf = NILFS_FIRST_SEGBUF(logs); in nilfs_cancel_segusage()
1489 ret = nilfs_sufile_set_segment_usage(sufile, segbuf->sb_segnum, in nilfs_cancel_segusage()
1490 segbuf->sb_pseg_start - in nilfs_cancel_segusage()
1491 segbuf->sb_fseg_start, 0); in nilfs_cancel_segusage()
1494 list_for_each_entry_continue(segbuf, logs, sb_list) { in nilfs_cancel_segusage()
1495 ret = nilfs_sufile_set_segment_usage(sufile, segbuf->sb_segnum, in nilfs_cancel_segusage()
1505 struct nilfs_segment_buffer *segbuf = last; in nilfs_segctor_truncate_segments() local
1508 list_for_each_entry_continue(segbuf, &sci->sc_segbufs, sb_list) { in nilfs_segctor_truncate_segments()
1509 sci->sc_segbuf_nblocks -= segbuf->sb_rest_blocks; in nilfs_segctor_truncate_segments()
1510 ret = nilfs_sufile_free(sufile, segbuf->sb_nextnum); in nilfs_segctor_truncate_segments()
1582 struct nilfs_segment_buffer *segbuf, in nilfs_segctor_update_payload_blocknr() argument
1587 unsigned long nfinfo = segbuf->sb_sum.nfinfo; in nilfs_segctor_update_payload_blocknr()
1600 blocknr = segbuf->sb_pseg_start + segbuf->sb_sum.nsumblk; in nilfs_segctor_update_payload_blocknr()
1601 ssp.bh = NILFS_SEGBUF_FIRST_BH(&segbuf->sb_segsum_buffers); in nilfs_segctor_update_payload_blocknr()
1604 list_for_each_entry(bh, &segbuf->sb_payload_buffers, b_assoc_buffers) { in nilfs_segctor_update_payload_blocknr()
1605 if (bh == segbuf->sb_super_root) in nilfs_segctor_update_payload_blocknr()
1655 struct nilfs_segment_buffer *segbuf; in nilfs_segctor_assign() local
1658 list_for_each_entry(segbuf, &sci->sc_segbufs, sb_list) { in nilfs_segctor_assign()
1659 err = nilfs_segctor_update_payload_blocknr(sci, segbuf, mode); in nilfs_segctor_assign()
1662 nilfs_segbuf_fill_in_segsum(segbuf); in nilfs_segctor_assign()
1684 struct nilfs_segment_buffer *segbuf; in nilfs_segctor_prepare_write() local
1687 list_for_each_entry(segbuf, &sci->sc_segbufs, sb_list) { in nilfs_segctor_prepare_write()
1690 list_for_each_entry(bh, &segbuf->sb_segsum_buffers, in nilfs_segctor_prepare_write()
1703 list_for_each_entry(bh, &segbuf->sb_payload_buffers, in nilfs_segctor_prepare_write()
1705 if (bh == segbuf->sb_super_root) { in nilfs_segctor_prepare_write()
1781 struct nilfs_segment_buffer *segbuf; in nilfs_abort_logs() local
1788 list_for_each_entry(segbuf, logs, sb_list) { in nilfs_abort_logs()
1789 list_for_each_entry(bh, &segbuf->sb_segsum_buffers, in nilfs_abort_logs()
1799 list_for_each_entry(bh, &segbuf->sb_payload_buffers, in nilfs_abort_logs()
1801 if (bh == segbuf->sb_super_root) { in nilfs_abort_logs()
1848 struct nilfs_segment_buffer *segbuf) in nilfs_set_next_segment() argument
1850 nilfs->ns_segnum = segbuf->sb_segnum; in nilfs_set_next_segment()
1851 nilfs->ns_nextnum = segbuf->sb_nextnum; in nilfs_set_next_segment()
1852 nilfs->ns_pseg_offset = segbuf->sb_pseg_start - segbuf->sb_fseg_start in nilfs_set_next_segment()
1853 + segbuf->sb_sum.nblocks; in nilfs_set_next_segment()
1854 nilfs->ns_seg_seq = segbuf->sb_sum.seg_seq; in nilfs_set_next_segment()
1855 nilfs->ns_ctime = segbuf->sb_sum.ctime; in nilfs_set_next_segment()
1860 struct nilfs_segment_buffer *segbuf; in nilfs_segctor_complete_write() local
1865 list_for_each_entry(segbuf, &sci->sc_write_logs, sb_list) { in nilfs_segctor_complete_write()
1868 list_for_each_entry(bh, &segbuf->sb_segsum_buffers, in nilfs_segctor_complete_write()
1889 list_for_each_entry(bh, &segbuf->sb_payload_buffers, in nilfs_segctor_complete_write()
1897 if (bh == segbuf->sb_super_root) { in nilfs_segctor_complete_write()
1914 if (!nilfs_segbuf_simplex(segbuf)) { in nilfs_segctor_complete_write()
1915 if (segbuf->sb_sum.flags & NILFS_SS_LOGBGN) { in nilfs_segctor_complete_write()
1919 if (segbuf->sb_sum.flags & NILFS_SS_LOGEND) in nilfs_segctor_complete_write()
1941 segbuf = NILFS_LAST_SEGBUF(&sci->sc_write_logs); in nilfs_segctor_complete_write()
1942 nilfs_set_next_segment(nilfs, segbuf); in nilfs_segctor_complete_write()
1946 nilfs_set_last_segment(nilfs, segbuf->sb_pseg_start, in nilfs_segctor_complete_write()
1947 segbuf->sb_sum.seg_seq, nilfs->ns_cno++); in nilfs_segctor_complete_write()