Lines Matching refs:bh
525 struct buffer_head *bh = jh2bh(jh); in jbd_unexpected_dirty_buffer() local
527 if (test_clear_buffer_dirty(bh)) in jbd_unexpected_dirty_buffer()
528 set_buffer_jbddirty(bh); in jbd_unexpected_dirty_buffer()
546 struct buffer_head *bh; in do_get_write_access() local
563 bh = jh2bh(jh); in do_get_write_access()
567 lock_buffer(bh); in do_get_write_access()
568 jbd_lock_bh_state(bh); in do_get_write_access()
583 if (buffer_dirty(bh)) { in do_get_write_access()
606 unlock_buffer(bh); in do_get_write_access()
610 jbd_unlock_bh_state(bh); in do_get_write_access()
658 DEFINE_WAIT_BIT(wait, &bh->b_state, BH_Unshadow); in do_get_write_access()
661 wqh = bit_waitqueue(&bh->b_state, BH_Unshadow); in do_get_write_access()
664 jbd_unlock_bh_state(bh); in do_get_write_access()
695 jbd_unlock_bh_state(bh); in do_get_write_access()
705 jbd_lock_bh_state(bh); in do_get_write_access()
753 jbd_unlock_bh_state(bh); in do_get_write_access()
763 jbd2_free(frozen_buffer, bh->b_size); in do_get_write_access()
781 int jbd2_journal_get_write_access(handle_t *handle, struct buffer_head *bh) in jbd2_journal_get_write_access() argument
783 struct journal_head *jh = jbd2_journal_add_journal_head(bh); in jbd2_journal_get_write_access()
814 int jbd2_journal_get_create_access(handle_t *handle, struct buffer_head *bh) in jbd2_journal_get_create_access() argument
818 struct journal_head *jh = jbd2_journal_add_journal_head(bh); in jbd2_journal_get_create_access()
835 jbd_lock_bh_state(bh); in jbd2_journal_get_create_access()
861 jbd_unlock_bh_state(bh); in jbd2_journal_get_create_access()
904 int jbd2_journal_get_undo_access(handle_t *handle, struct buffer_head *bh) in jbd2_journal_get_undo_access() argument
907 struct journal_head *jh = jbd2_journal_add_journal_head(bh); in jbd2_journal_get_undo_access()
932 jbd_lock_bh_state(bh); in jbd2_journal_get_undo_access()
938 jbd_unlock_bh_state(bh); in jbd2_journal_get_undo_access()
944 memcpy(jh->b_committed_data, bh->b_data, bh->b_size); in jbd2_journal_get_undo_access()
946 jbd_unlock_bh_state(bh); in jbd2_journal_get_undo_access()
950 jbd2_free(committed_data, bh->b_size); in jbd2_journal_get_undo_access()
965 void jbd2_journal_set_triggers(struct buffer_head *bh, in jbd2_journal_set_triggers() argument
968 struct journal_head *jh = bh2jh(bh); in jbd2_journal_set_triggers()
976 struct buffer_head *bh = jh2bh(jh); in jbd2_buffer_commit_trigger() local
981 triggers->t_commit(triggers, bh, mapped_data, bh->b_size); in jbd2_buffer_commit_trigger()
1014 int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh) in jbd2_journal_dirty_metadata() argument
1018 struct journal_head *jh = bh2jh(bh); in jbd2_journal_dirty_metadata()
1025 jbd_lock_bh_state(bh); in jbd2_journal_dirty_metadata()
1052 set_buffer_jbddirty(bh); in jbd2_journal_dirty_metadata()
1078 jbd_unlock_bh_state(bh); in jbd2_journal_dirty_metadata()
1090 jbd2_journal_release_buffer(handle_t *handle, struct buffer_head *bh) in jbd2_journal_release_buffer() argument
1092 BUFFER_TRACE(bh, "entry"); in jbd2_journal_release_buffer()
1112 int jbd2_journal_forget (handle_t *handle, struct buffer_head *bh) in jbd2_journal_forget() argument
1121 BUFFER_TRACE(bh, "entry"); in jbd2_journal_forget()
1123 jbd_lock_bh_state(bh); in jbd2_journal_forget()
1126 if (!buffer_jbd(bh)) in jbd2_journal_forget()
1128 jh = bh2jh(bh); in jbd2_journal_forget()
1153 clear_buffer_dirty(bh); in jbd2_journal_forget()
1154 clear_buffer_jbddirty(bh); in jbd2_journal_forget()
1182 jbd2_journal_remove_journal_head(bh); in jbd2_journal_forget()
1183 __brelse(bh); in jbd2_journal_forget()
1184 if (!buffer_jbd(bh)) { in jbd2_journal_forget()
1186 jbd_unlock_bh_state(bh); in jbd2_journal_forget()
1187 __bforget(bh); in jbd2_journal_forget()
1215 jbd_unlock_bh_state(bh); in jbd2_journal_forget()
1216 __brelse(bh); in jbd2_journal_forget()
1458 struct buffer_head *bh = jh2bh(jh); in __jbd2_journal_temp_unlink_buffer() local
1460 J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); in __jbd2_journal_temp_unlink_buffer()
1496 if (test_clear_buffer_jbddirty(bh)) in __jbd2_journal_temp_unlink_buffer()
1497 mark_buffer_dirty(bh); /* Expose it to the VM */ in __jbd2_journal_temp_unlink_buffer()
1521 __journal_try_to_free_buffer(journal_t *journal, struct buffer_head *bh) in __journal_try_to_free_buffer() argument
1525 jh = bh2jh(bh); in __journal_try_to_free_buffer()
1527 if (buffer_locked(bh) || buffer_dirty(bh)) in __journal_try_to_free_buffer()
1539 jbd2_journal_remove_journal_head(bh); in __journal_try_to_free_buffer()
1540 __brelse(bh); in __journal_try_to_free_buffer()
1620 struct buffer_head *bh; in jbd2_journal_try_to_free_buffers() local
1626 bh = head; in jbd2_journal_try_to_free_buffers()
1636 jh = jbd2_journal_grab_journal_head(bh); in jbd2_journal_try_to_free_buffers()
1640 jbd_lock_bh_state(bh); in jbd2_journal_try_to_free_buffers()
1641 __journal_try_to_free_buffer(journal, bh); in jbd2_journal_try_to_free_buffers()
1643 jbd_unlock_bh_state(bh); in jbd2_journal_try_to_free_buffers()
1644 if (buffer_jbd(bh)) in jbd2_journal_try_to_free_buffers()
1646 } while ((bh = bh->b_this_page) != head); in jbd2_journal_try_to_free_buffers()
1688 struct buffer_head *bh = jh2bh(jh); in __dispose_buffer() local
1695 clear_buffer_jbddirty(bh); in __dispose_buffer()
1699 jbd2_journal_remove_journal_head(bh); in __dispose_buffer()
1700 __brelse(bh); in __dispose_buffer()
1752 static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh) in journal_unmap_buffer() argument
1759 BUFFER_TRACE(bh, "entry"); in journal_unmap_buffer()
1767 if (!buffer_jbd(bh)) in journal_unmap_buffer()
1772 jbd_lock_bh_state(bh); in journal_unmap_buffer()
1775 jh = jbd2_journal_grab_journal_head(bh); in journal_unmap_buffer()
1790 if (!buffer_dirty(bh)) { in journal_unmap_buffer()
1808 jbd_unlock_bh_state(bh); in journal_unmap_buffer()
1822 jbd_unlock_bh_state(bh); in journal_unmap_buffer()
1828 clear_buffer_jbddirty(bh); in journal_unmap_buffer()
1839 set_buffer_freed(bh); in journal_unmap_buffer()
1847 jbd_unlock_bh_state(bh); in journal_unmap_buffer()
1866 jbd_unlock_bh_state(bh); in journal_unmap_buffer()
1869 clear_buffer_dirty(bh); in journal_unmap_buffer()
1870 J_ASSERT_BH(bh, !buffer_jbddirty(bh)); in journal_unmap_buffer()
1871 clear_buffer_mapped(bh); in journal_unmap_buffer()
1872 clear_buffer_req(bh); in journal_unmap_buffer()
1873 clear_buffer_new(bh); in journal_unmap_buffer()
1874 bh->b_bdev = NULL; in journal_unmap_buffer()
1891 struct buffer_head *head, *bh, *next; in jbd2_journal_invalidatepage() local
1904 head = bh = page_buffers(page); in jbd2_journal_invalidatepage()
1906 unsigned int next_off = curr_off + bh->b_size; in jbd2_journal_invalidatepage()
1907 next = bh->b_this_page; in jbd2_journal_invalidatepage()
1911 lock_buffer(bh); in jbd2_journal_invalidatepage()
1912 may_free &= journal_unmap_buffer(journal, bh); in jbd2_journal_invalidatepage()
1913 unlock_buffer(bh); in jbd2_journal_invalidatepage()
1916 bh = next; in jbd2_journal_invalidatepage()
1918 } while (bh != head); in jbd2_journal_invalidatepage()
1934 struct buffer_head *bh = jh2bh(jh); in __jbd2_journal_file_buffer() local
1936 J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); in __jbd2_journal_file_buffer()
1952 if (test_clear_buffer_dirty(bh) || in __jbd2_journal_file_buffer()
1953 test_clear_buffer_jbddirty(bh)) in __jbd2_journal_file_buffer()
1991 set_buffer_jbddirty(bh); in __jbd2_journal_file_buffer()
2017 struct buffer_head *bh = jh2bh(jh); in __jbd2_journal_refile_buffer() local
2019 J_ASSERT_JH(jh, jbd_is_locked_bh_state(bh)); in __jbd2_journal_refile_buffer()
2034 was_dirty = test_clear_buffer_jbddirty(bh); in __jbd2_journal_refile_buffer()
2043 set_buffer_jbddirty(bh); in __jbd2_journal_refile_buffer()
2062 struct buffer_head *bh = jh2bh(jh); in jbd2_journal_refile_buffer() local
2064 jbd_lock_bh_state(bh); in jbd2_journal_refile_buffer()
2068 jbd_unlock_bh_state(bh); in jbd2_journal_refile_buffer()
2069 jbd2_journal_remove_journal_head(bh); in jbd2_journal_refile_buffer()
2072 __brelse(bh); in jbd2_journal_refile_buffer()