Lines Matching refs:bh
45 static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) in ntfs_end_buffer_async_read() argument
54 page = bh->b_page; in ntfs_end_buffer_async_read()
62 set_buffer_uptodate(bh); in ntfs_end_buffer_async_read()
65 bh_offset(bh); in ntfs_end_buffer_async_read()
75 if (unlikely(file_ofs + bh->b_size > init_size)) { in ntfs_end_buffer_async_read()
83 memset(kaddr + bh_offset(bh) + ofs, 0, in ntfs_end_buffer_async_read()
84 bh->b_size - ofs); in ntfs_end_buffer_async_read()
89 clear_buffer_uptodate(bh); in ntfs_end_buffer_async_read()
92 "0x%llx.", (unsigned long long)bh->b_blocknr); in ntfs_end_buffer_async_read()
96 clear_buffer_async_read(bh); in ntfs_end_buffer_async_read()
97 unlock_buffer(bh); in ntfs_end_buffer_async_read()
98 tmp = bh; in ntfs_end_buffer_async_read()
109 } while (tmp != bh); in ntfs_end_buffer_async_read()
174 struct buffer_head *bh, *head, *arr[MAX_BUF_PER_PAGE]; in ntfs_read_block() local
198 bh = head = page_buffers(page); in ntfs_read_block()
199 BUG_ON(!bh); in ntfs_read_block()
230 if (unlikely(buffer_uptodate(bh))) in ntfs_read_block()
232 if (unlikely(buffer_mapped(bh))) { in ntfs_read_block()
233 arr[nr++] = bh; in ntfs_read_block()
236 bh->b_bdev = vol->sb->s_bdev; in ntfs_read_block()
261 bh->b_blocknr = ((lcn << vol->cluster_size_bits) in ntfs_read_block()
263 set_buffer_mapped(bh); in ntfs_read_block()
266 arr[nr++] = bh; in ntfs_read_block()
301 bh->b_blocknr = -1; in ntfs_read_block()
318 bh->b_blocknr = -1UL; in ntfs_read_block()
319 clear_buffer_mapped(bh); in ntfs_read_block()
323 set_buffer_uptodate(bh); in ntfs_read_block()
324 } while (i++, iblock++, (bh = bh->b_this_page) != head); in ntfs_read_block()
541 struct buffer_head *bh, *head; in ntfs_write_block() local
576 bh = head = page_buffers(page); in ntfs_write_block()
577 BUG_ON(!bh); in ntfs_write_block()
627 clear_buffer_dirty(bh); in ntfs_write_block()
628 set_buffer_uptodate(bh); in ntfs_write_block()
633 if (!buffer_dirty(bh)) in ntfs_write_block()
692 if (buffer_mapped(bh)) in ntfs_write_block()
696 bh->b_bdev = vol->sb->s_bdev; in ntfs_write_block()
717 bh->b_blocknr = ((lcn << vol->cluster_size_bits) + in ntfs_write_block()
719 set_buffer_mapped(bh); in ntfs_write_block()
729 bpos = (unsigned long *)(kaddr + bh_offset(bh)); in ntfs_write_block()
741 bh->b_blocknr = -1; in ntfs_write_block()
742 clear_buffer_dirty(bh); in ntfs_write_block()
773 bh->b_blocknr = -1; in ntfs_write_block()
774 clear_buffer_dirty(bh); in ntfs_write_block()
775 zero_user(page, bh_offset(bh), blocksize); in ntfs_write_block()
776 set_buffer_uptodate(bh); in ntfs_write_block()
783 bh->b_blocknr = -1; in ntfs_write_block()
792 } while (block++, (bh = bh->b_this_page) != head); in ntfs_write_block()
799 bh = head; in ntfs_write_block()
805 if (!buffer_uptodate(bh)) { in ntfs_write_block()
807 bh = head; in ntfs_write_block()
810 } while ((bh = bh->b_this_page) != head); in ntfs_write_block()
817 if (buffer_mapped(bh) && buffer_dirty(bh)) { in ntfs_write_block()
818 lock_buffer(bh); in ntfs_write_block()
819 if (test_clear_buffer_dirty(bh)) { in ntfs_write_block()
820 BUG_ON(!buffer_uptodate(bh)); in ntfs_write_block()
821 mark_buffer_async_write(bh); in ntfs_write_block()
823 unlock_buffer(bh); in ntfs_write_block()
830 clear_buffer_dirty(bh); in ntfs_write_block()
832 } while ((bh = bh->b_this_page) != head); in ntfs_write_block()
858 struct buffer_head *next = bh->b_this_page; in ntfs_write_block()
859 if (buffer_async_write(bh)) { in ntfs_write_block()
860 submit_bh(REQ_OP_WRITE, 0, bh); in ntfs_write_block()
863 bh = next; in ntfs_write_block()
864 } while (bh != head); in ntfs_write_block()
909 struct buffer_head *bh, *head, *tbh, *rec_start_bh; in ntfs_write_mst_block() local
943 bh = head = page_buffers(page); in ntfs_write_mst_block()
944 BUG_ON(!bh); in ntfs_write_mst_block()
967 clear_buffer_dirty(bh); in ntfs_write_mst_block()
968 set_buffer_uptodate(bh); in ntfs_write_mst_block()
980 clear_buffer_dirty(bh); in ntfs_write_mst_block()
989 clear_buffer_dirty(bh); in ntfs_write_mst_block()
992 if (!buffer_dirty(bh)) { in ntfs_write_mst_block()
998 rec_start_bh = bh; in ntfs_write_mst_block()
1001 if (unlikely(!buffer_mapped(bh))) { in ntfs_write_mst_block()
1006 bh->b_bdev = vol->sb->s_bdev; in ntfs_write_mst_block()
1026 bh->b_blocknr = ((lcn << in ntfs_write_mst_block()
1029 set_buffer_mapped(bh); in ntfs_write_mst_block()
1058 bh->b_blocknr = -1; in ntfs_write_mst_block()
1076 if (rec_start_bh != bh) { in ntfs_write_mst_block()
1086 bh); in ntfs_write_mst_block()
1092 BUG_ON(!buffer_uptodate(bh)); in ntfs_write_mst_block()
1094 bhs[nr_bhs++] = bh; in ntfs_write_mst_block()
1095 } while (block++, (bh = bh->b_this_page) != head); in ntfs_write_mst_block()
1715 struct buffer_head *bh, *head, *buffers_to_free = NULL; in mark_ntfs_record_dirty() local
1724 bh = head = alloc_page_buffers(page, bh_size, true); in mark_ntfs_record_dirty()
1730 set_buffer_uptodate(bh); in mark_ntfs_record_dirty()
1731 tail = bh; in mark_ntfs_record_dirty()
1732 bh = bh->b_this_page; in mark_ntfs_record_dirty()
1733 } while (bh); in mark_ntfs_record_dirty()
1737 buffers_to_free = bh; in mark_ntfs_record_dirty()
1739 bh = head = page_buffers(page); in mark_ntfs_record_dirty()
1740 BUG_ON(!bh); in mark_ntfs_record_dirty()
1742 bh_ofs = bh_offset(bh); in mark_ntfs_record_dirty()
1747 set_buffer_dirty(bh); in mark_ntfs_record_dirty()
1748 } while ((bh = bh->b_this_page) != head); in mark_ntfs_record_dirty()
1753 bh = buffers_to_free->b_this_page; in mark_ntfs_record_dirty()
1755 buffers_to_free = bh; in mark_ntfs_record_dirty()