Lines Matching refs:jh
33 static void __jbd2_journal_temp_unlink_buffer(struct journal_head *jh);
34 static void __jbd2_journal_unfile_buffer(struct journal_head *jh);
921 static void jbd2_freeze_jh_data(struct journal_head *jh) in jbd2_freeze_jh_data() argument
924 struct buffer_head *bh = jh2bh(jh); in jbd2_freeze_jh_data()
926 J_EXPECT_JH(jh, buffer_uptodate(bh), "Possible IO failure.\n"); in jbd2_freeze_jh_data()
929 jbd2_buffer_frozen_trigger(jh, source, jh->b_triggers); in jbd2_freeze_jh_data()
930 memcpy(jh->b_frozen_data, source, bh->b_size); in jbd2_freeze_jh_data()
937 jh->b_frozen_triggers = jh->b_triggers; in jbd2_freeze_jh_data()
951 do_get_write_access(handle_t *handle, struct journal_head *jh, in do_get_write_access() argument
963 jbd2_debug(5, "journal_head %p, force_copy %d\n", jh, force_copy); in do_get_write_access()
965 JBUFFER_TRACE(jh, "entry"); in do_get_write_access()
967 bh = jh2bh(jh); in do_get_write_access()
973 spin_lock(&jh->b_state_lock); in do_get_write_access()
994 if (buffer_dirty(bh) && jh->b_transaction) { in do_get_write_access()
1000 JBUFFER_TRACE(jh, "Journalling dirty buffer"); in do_get_write_access()
1014 spin_unlock(&jh->b_state_lock); in do_get_write_access()
1024 if (jh->b_transaction == transaction || in do_get_write_access()
1025 jh->b_next_transaction == transaction) { in do_get_write_access()
1034 jh->b_modified = 0; in do_get_write_access()
1041 if (!jh->b_transaction) { in do_get_write_access()
1042 JBUFFER_TRACE(jh, "no transaction"); in do_get_write_access()
1043 J_ASSERT_JH(jh, !jh->b_next_transaction); in do_get_write_access()
1044 JBUFFER_TRACE(jh, "file as BJ_Reserved"); in do_get_write_access()
1060 JBUFFER_TRACE(jh, "Journalling dirty buffer"); in do_get_write_access()
1063 __jbd2_journal_file_buffer(jh, transaction, BJ_Reserved); in do_get_write_access()
1074 if (jh->b_frozen_data) { in do_get_write_access()
1075 JBUFFER_TRACE(jh, "has frozen data"); in do_get_write_access()
1076 J_ASSERT_JH(jh, jh->b_next_transaction == NULL); in do_get_write_access()
1080 JBUFFER_TRACE(jh, "owned by older transaction"); in do_get_write_access()
1081 J_ASSERT_JH(jh, jh->b_next_transaction == NULL); in do_get_write_access()
1082 J_ASSERT_JH(jh, jh->b_transaction == journal->j_committing_transaction); in do_get_write_access()
1094 JBUFFER_TRACE(jh, "on shadow: sleep"); in do_get_write_access()
1095 spin_unlock(&jh->b_state_lock); in do_get_write_access()
1112 if (jh->b_jlist == BJ_Metadata || force_copy) { in do_get_write_access()
1113 JBUFFER_TRACE(jh, "generate frozen data"); in do_get_write_access()
1115 JBUFFER_TRACE(jh, "allocate memory for buffer"); in do_get_write_access()
1116 spin_unlock(&jh->b_state_lock); in do_get_write_access()
1117 frozen_buffer = jbd2_alloc(jh2bh(jh)->b_size, in do_get_write_access()
1121 jh->b_frozen_data = frozen_buffer; in do_get_write_access()
1123 jbd2_freeze_jh_data(jh); in do_get_write_access()
1132 jh->b_next_transaction = transaction; in do_get_write_access()
1135 spin_unlock(&jh->b_state_lock); in do_get_write_access()
1141 jbd2_journal_cancel_revoke(handle, jh); in do_get_write_access()
1147 JBUFFER_TRACE(jh, "exit"); in do_get_write_access()
1155 struct journal_head *jh; in jbd2_write_access_granted() local
1177 jh = READ_ONCE(bh->b_private); in jbd2_write_access_granted()
1178 if (!jh) in jbd2_write_access_granted()
1181 if (undo && !jh->b_committed_data) in jbd2_write_access_granted()
1183 if (READ_ONCE(jh->b_transaction) != handle->h_transaction && in jbd2_write_access_granted()
1184 READ_ONCE(jh->b_next_transaction) != handle->h_transaction) in jbd2_write_access_granted()
1196 if (unlikely(jh->b_bh != bh)) in jbd2_write_access_granted()
1218 struct journal_head *jh; in jbd2_journal_get_write_access() local
1241 jh = jbd2_journal_add_journal_head(bh); in jbd2_journal_get_write_access()
1245 rc = do_get_write_access(handle, jh, 0); in jbd2_journal_get_write_access()
1246 jbd2_journal_put_journal_head(jh); in jbd2_journal_get_write_access()
1274 struct journal_head *jh = jbd2_journal_add_journal_head(bh); in jbd2_journal_get_create_access() local
1277 jbd2_debug(5, "journal_head %p\n", jh); in jbd2_journal_get_create_access()
1284 JBUFFER_TRACE(jh, "entry"); in jbd2_journal_get_create_access()
1292 spin_lock(&jh->b_state_lock); in jbd2_journal_get_create_access()
1293 J_ASSERT_JH(jh, (jh->b_transaction == transaction || in jbd2_journal_get_create_access()
1294 jh->b_transaction == NULL || in jbd2_journal_get_create_access()
1295 (jh->b_transaction == journal->j_committing_transaction && in jbd2_journal_get_create_access()
1296 jh->b_jlist == BJ_Forget))); in jbd2_journal_get_create_access()
1298 J_ASSERT_JH(jh, jh->b_next_transaction == NULL); in jbd2_journal_get_create_access()
1299 J_ASSERT_JH(jh, buffer_locked(jh2bh(jh))); in jbd2_journal_get_create_access()
1301 if (jh->b_transaction == NULL) { in jbd2_journal_get_create_access()
1310 clear_buffer_dirty(jh2bh(jh)); in jbd2_journal_get_create_access()
1312 jh->b_modified = 0; in jbd2_journal_get_create_access()
1314 JBUFFER_TRACE(jh, "file as BJ_Reserved"); in jbd2_journal_get_create_access()
1316 __jbd2_journal_file_buffer(jh, transaction, BJ_Reserved); in jbd2_journal_get_create_access()
1318 } else if (jh->b_transaction == journal->j_committing_transaction) { in jbd2_journal_get_create_access()
1320 jh->b_modified = 0; in jbd2_journal_get_create_access()
1322 JBUFFER_TRACE(jh, "set next transaction"); in jbd2_journal_get_create_access()
1324 jh->b_next_transaction = transaction; in jbd2_journal_get_create_access()
1327 spin_unlock(&jh->b_state_lock); in jbd2_journal_get_create_access()
1336 JBUFFER_TRACE(jh, "cancelling revoke"); in jbd2_journal_get_create_access()
1337 jbd2_journal_cancel_revoke(handle, jh); in jbd2_journal_get_create_access()
1339 jbd2_journal_put_journal_head(jh); in jbd2_journal_get_create_access()
1372 struct journal_head *jh; in jbd2_journal_get_undo_access() local
1381 jh = jbd2_journal_add_journal_head(bh); in jbd2_journal_get_undo_access()
1382 JBUFFER_TRACE(jh, "entry"); in jbd2_journal_get_undo_access()
1389 err = do_get_write_access(handle, jh, 1); in jbd2_journal_get_undo_access()
1394 if (!jh->b_committed_data) in jbd2_journal_get_undo_access()
1395 committed_data = jbd2_alloc(jh2bh(jh)->b_size, in jbd2_journal_get_undo_access()
1398 spin_lock(&jh->b_state_lock); in jbd2_journal_get_undo_access()
1399 if (!jh->b_committed_data) { in jbd2_journal_get_undo_access()
1402 JBUFFER_TRACE(jh, "generate b_committed data"); in jbd2_journal_get_undo_access()
1404 spin_unlock(&jh->b_state_lock); in jbd2_journal_get_undo_access()
1408 jh->b_committed_data = committed_data; in jbd2_journal_get_undo_access()
1410 memcpy(jh->b_committed_data, bh->b_data, bh->b_size); in jbd2_journal_get_undo_access()
1412 spin_unlock(&jh->b_state_lock); in jbd2_journal_get_undo_access()
1414 jbd2_journal_put_journal_head(jh); in jbd2_journal_get_undo_access()
1434 struct journal_head *jh = jbd2_journal_grab_journal_head(bh); in jbd2_journal_set_triggers() local
1436 if (WARN_ON_ONCE(!jh)) in jbd2_journal_set_triggers()
1438 jh->b_triggers = type; in jbd2_journal_set_triggers()
1439 jbd2_journal_put_journal_head(jh); in jbd2_journal_set_triggers()
1442 void jbd2_buffer_frozen_trigger(struct journal_head *jh, void *mapped_data, in jbd2_buffer_frozen_trigger() argument
1445 struct buffer_head *bh = jh2bh(jh); in jbd2_buffer_frozen_trigger()
1453 void jbd2_buffer_abort_trigger(struct journal_head *jh, in jbd2_buffer_abort_trigger() argument
1459 triggers->t_abort(triggers, jh2bh(jh)); in jbd2_buffer_abort_trigger()
1489 struct journal_head *jh; in jbd2_journal_dirty_metadata() local
1499 jh = bh2jh(bh); in jbd2_journal_dirty_metadata()
1500 jbd2_debug(5, "journal_head %p\n", jh); in jbd2_journal_dirty_metadata()
1501 JBUFFER_TRACE(jh, "entry"); in jbd2_journal_dirty_metadata()
1509 if (data_race(jh->b_transaction != transaction && in jbd2_journal_dirty_metadata()
1510 jh->b_next_transaction != transaction)) { in jbd2_journal_dirty_metadata()
1511 spin_lock(&jh->b_state_lock); in jbd2_journal_dirty_metadata()
1512 J_ASSERT_JH(jh, jh->b_transaction == transaction || in jbd2_journal_dirty_metadata()
1513 jh->b_next_transaction == transaction); in jbd2_journal_dirty_metadata()
1514 spin_unlock(&jh->b_state_lock); in jbd2_journal_dirty_metadata()
1516 if (jh->b_modified == 1) { in jbd2_journal_dirty_metadata()
1518 if (data_race(jh->b_transaction == transaction && in jbd2_journal_dirty_metadata()
1519 jh->b_jlist != BJ_Metadata)) { in jbd2_journal_dirty_metadata()
1520 spin_lock(&jh->b_state_lock); in jbd2_journal_dirty_metadata()
1521 if (jh->b_transaction == transaction && in jbd2_journal_dirty_metadata()
1522 jh->b_jlist != BJ_Metadata) in jbd2_journal_dirty_metadata()
1527 jh->b_jlist); in jbd2_journal_dirty_metadata()
1528 J_ASSERT_JH(jh, jh->b_transaction != transaction || in jbd2_journal_dirty_metadata()
1529 jh->b_jlist == BJ_Metadata); in jbd2_journal_dirty_metadata()
1530 spin_unlock(&jh->b_state_lock); in jbd2_journal_dirty_metadata()
1536 spin_lock(&jh->b_state_lock); in jbd2_journal_dirty_metadata()
1550 if (jh->b_modified == 0) { in jbd2_journal_dirty_metadata()
1560 jh->b_modified = 1; in jbd2_journal_dirty_metadata()
1571 if (jh->b_transaction == transaction && jh->b_jlist == BJ_Metadata) { in jbd2_journal_dirty_metadata()
1572 JBUFFER_TRACE(jh, "fastpath"); in jbd2_journal_dirty_metadata()
1573 if (unlikely(jh->b_transaction != in jbd2_journal_dirty_metadata()
1580 jh->b_transaction, in jbd2_journal_dirty_metadata()
1581 jh->b_transaction ? jh->b_transaction->t_tid : 0, in jbd2_journal_dirty_metadata()
1598 if (jh->b_transaction != transaction) { in jbd2_journal_dirty_metadata()
1599 JBUFFER_TRACE(jh, "already on other transaction"); in jbd2_journal_dirty_metadata()
1600 if (unlikely(((jh->b_transaction != in jbd2_journal_dirty_metadata()
1602 (jh->b_next_transaction != transaction))) { in jbd2_journal_dirty_metadata()
1611 jh->b_transaction, in jbd2_journal_dirty_metadata()
1612 jh->b_transaction ? in jbd2_journal_dirty_metadata()
1613 jh->b_transaction->t_tid : 0, in jbd2_journal_dirty_metadata()
1614 jh->b_next_transaction, in jbd2_journal_dirty_metadata()
1615 jh->b_next_transaction ? in jbd2_journal_dirty_metadata()
1616 jh->b_next_transaction->t_tid : 0, in jbd2_journal_dirty_metadata()
1617 jh->b_jlist); in jbd2_journal_dirty_metadata()
1627 J_ASSERT_JH(jh, jh->b_frozen_data == NULL); in jbd2_journal_dirty_metadata()
1629 JBUFFER_TRACE(jh, "file as BJ_Metadata"); in jbd2_journal_dirty_metadata()
1631 __jbd2_journal_file_buffer(jh, transaction, BJ_Metadata); in jbd2_journal_dirty_metadata()
1634 spin_unlock(&jh->b_state_lock); in jbd2_journal_dirty_metadata()
1636 JBUFFER_TRACE(jh, "exit"); in jbd2_journal_dirty_metadata()
1661 struct journal_head *jh; in jbd2_journal_forget() local
1672 jh = jbd2_journal_grab_journal_head(bh); in jbd2_journal_forget()
1673 if (!jh) { in jbd2_journal_forget()
1678 spin_lock(&jh->b_state_lock); in jbd2_journal_forget()
1682 if (!J_EXPECT_JH(jh, !jh->b_committed_data, in jbd2_journal_forget()
1689 was_modified = jh->b_modified; in jbd2_journal_forget()
1695 jh->b_modified = 0; in jbd2_journal_forget()
1697 if (jh->b_transaction == transaction) { in jbd2_journal_forget()
1698 J_ASSERT_JH(jh, !jh->b_frozen_data); in jbd2_journal_forget()
1706 JBUFFER_TRACE(jh, "belongs to current transaction: unfile"); in jbd2_journal_forget()
1728 if (jh->b_cp_transaction) { in jbd2_journal_forget()
1729 __jbd2_journal_temp_unlink_buffer(jh); in jbd2_journal_forget()
1730 __jbd2_journal_file_buffer(jh, transaction, BJ_Forget); in jbd2_journal_forget()
1732 __jbd2_journal_unfile_buffer(jh); in jbd2_journal_forget()
1733 jbd2_journal_put_journal_head(jh); in jbd2_journal_forget()
1736 } else if (jh->b_transaction) { in jbd2_journal_forget()
1737 J_ASSERT_JH(jh, (jh->b_transaction == in jbd2_journal_forget()
1741 JBUFFER_TRACE(jh, "belongs to older transaction"); in jbd2_journal_forget()
1751 if (!jh->b_next_transaction) { in jbd2_journal_forget()
1753 jh->b_next_transaction = transaction; in jbd2_journal_forget()
1756 J_ASSERT(jh->b_next_transaction == transaction); in jbd2_journal_forget()
1772 if (!jh->b_cp_transaction) { in jbd2_journal_forget()
1773 JBUFFER_TRACE(jh, "belongs to none transaction"); in jbd2_journal_forget()
1782 if (jbd2_journal_try_remove_checkpoint(jh) >= 0) { in jbd2_journal_forget()
1794 __jbd2_journal_file_buffer(jh, transaction, BJ_Forget); in jbd2_journal_forget()
1799 spin_unlock(&jh->b_state_lock); in jbd2_journal_forget()
1800 jbd2_journal_put_journal_head(jh); in jbd2_journal_forget()
1979 __blist_add_buffer(struct journal_head **list, struct journal_head *jh) in __blist_add_buffer() argument
1982 jh->b_tnext = jh->b_tprev = jh; in __blist_add_buffer()
1983 *list = jh; in __blist_add_buffer()
1987 jh->b_tprev = last; in __blist_add_buffer()
1988 jh->b_tnext = first; in __blist_add_buffer()
1989 last->b_tnext = first->b_tprev = jh; in __blist_add_buffer()
2003 __blist_del_buffer(struct journal_head **list, struct journal_head *jh) in __blist_del_buffer() argument
2005 if (*list == jh) { in __blist_del_buffer()
2006 *list = jh->b_tnext; in __blist_del_buffer()
2007 if (*list == jh) in __blist_del_buffer()
2010 jh->b_tprev->b_tnext = jh->b_tnext; in __blist_del_buffer()
2011 jh->b_tnext->b_tprev = jh->b_tprev; in __blist_del_buffer()
2025 static void __jbd2_journal_temp_unlink_buffer(struct journal_head *jh) in __jbd2_journal_temp_unlink_buffer() argument
2029 struct buffer_head *bh = jh2bh(jh); in __jbd2_journal_temp_unlink_buffer()
2031 lockdep_assert_held(&jh->b_state_lock); in __jbd2_journal_temp_unlink_buffer()
2032 transaction = jh->b_transaction; in __jbd2_journal_temp_unlink_buffer()
2036 J_ASSERT_JH(jh, jh->b_jlist < BJ_Types); in __jbd2_journal_temp_unlink_buffer()
2037 if (jh->b_jlist != BJ_None) in __jbd2_journal_temp_unlink_buffer()
2038 J_ASSERT_JH(jh, transaction != NULL); in __jbd2_journal_temp_unlink_buffer()
2040 switch (jh->b_jlist) { in __jbd2_journal_temp_unlink_buffer()
2045 J_ASSERT_JH(jh, transaction->t_nr_buffers >= 0); in __jbd2_journal_temp_unlink_buffer()
2059 __blist_del_buffer(list, jh); in __jbd2_journal_temp_unlink_buffer()
2060 jh->b_jlist = BJ_None; in __jbd2_journal_temp_unlink_buffer()
2073 static void __jbd2_journal_unfile_buffer(struct journal_head *jh) in __jbd2_journal_unfile_buffer() argument
2075 J_ASSERT_JH(jh, jh->b_transaction != NULL); in __jbd2_journal_unfile_buffer()
2076 J_ASSERT_JH(jh, jh->b_next_transaction == NULL); in __jbd2_journal_unfile_buffer()
2078 __jbd2_journal_temp_unlink_buffer(jh); in __jbd2_journal_unfile_buffer()
2079 jh->b_transaction = NULL; in __jbd2_journal_unfile_buffer()
2082 void jbd2_journal_unfile_buffer(journal_t *journal, struct journal_head *jh) in jbd2_journal_unfile_buffer() argument
2084 struct buffer_head *bh = jh2bh(jh); in jbd2_journal_unfile_buffer()
2088 spin_lock(&jh->b_state_lock); in jbd2_journal_unfile_buffer()
2090 __jbd2_journal_unfile_buffer(jh); in jbd2_journal_unfile_buffer()
2092 spin_unlock(&jh->b_state_lock); in jbd2_journal_unfile_buffer()
2093 jbd2_journal_put_journal_head(jh); in jbd2_journal_unfile_buffer()
2142 struct journal_head *jh; in jbd2_journal_try_to_free_buffers() local
2149 jh = jbd2_journal_grab_journal_head(bh); in jbd2_journal_try_to_free_buffers()
2150 if (!jh) in jbd2_journal_try_to_free_buffers()
2153 spin_lock(&jh->b_state_lock); in jbd2_journal_try_to_free_buffers()
2154 if (!jh->b_transaction && !jh->b_next_transaction) { in jbd2_journal_try_to_free_buffers()
2157 if (jh->b_cp_transaction != NULL) in jbd2_journal_try_to_free_buffers()
2158 jbd2_journal_try_remove_checkpoint(jh); in jbd2_journal_try_to_free_buffers()
2161 spin_unlock(&jh->b_state_lock); in jbd2_journal_try_to_free_buffers()
2162 jbd2_journal_put_journal_head(jh); in jbd2_journal_try_to_free_buffers()
2184 static int __dispose_buffer(struct journal_head *jh, transaction_t *transaction) in __dispose_buffer() argument
2187 struct buffer_head *bh = jh2bh(jh); in __dispose_buffer()
2189 if (jh->b_cp_transaction) { in __dispose_buffer()
2190 JBUFFER_TRACE(jh, "on running+cp transaction"); in __dispose_buffer()
2191 __jbd2_journal_temp_unlink_buffer(jh); in __dispose_buffer()
2198 __jbd2_journal_file_buffer(jh, transaction, BJ_Forget); in __dispose_buffer()
2201 JBUFFER_TRACE(jh, "on running transaction"); in __dispose_buffer()
2202 __jbd2_journal_unfile_buffer(jh); in __dispose_buffer()
2203 jbd2_journal_put_journal_head(jh); in __dispose_buffer()
2259 struct journal_head *jh; in journal_unmap_buffer() local
2270 jh = jbd2_journal_grab_journal_head(bh); in journal_unmap_buffer()
2271 if (!jh) in journal_unmap_buffer()
2276 spin_lock(&jh->b_state_lock); in journal_unmap_buffer()
2302 transaction = jh->b_transaction; in journal_unmap_buffer()
2308 if (!jh->b_cp_transaction) { in journal_unmap_buffer()
2309 JBUFFER_TRACE(jh, "not on any transaction: zap"); in journal_unmap_buffer()
2315 __jbd2_journal_remove_checkpoint(jh); in journal_unmap_buffer()
2327 JBUFFER_TRACE(jh, "checkpointed: add to BJ_Forget"); in journal_unmap_buffer()
2328 may_free = __dispose_buffer(jh, in journal_unmap_buffer()
2337 JBUFFER_TRACE(jh, "give to committing trans"); in journal_unmap_buffer()
2338 may_free = __dispose_buffer(jh, in journal_unmap_buffer()
2345 __jbd2_journal_remove_checkpoint(jh); in journal_unmap_buffer()
2350 JBUFFER_TRACE(jh, "on committing transaction"); in journal_unmap_buffer()
2358 spin_unlock(&jh->b_state_lock); in journal_unmap_buffer()
2360 jbd2_journal_put_journal_head(jh); in journal_unmap_buffer()
2375 jh->b_next_transaction = journal->j_running_transaction; in journal_unmap_buffer()
2376 jh->b_modified = 0; in journal_unmap_buffer()
2378 spin_unlock(&jh->b_state_lock); in journal_unmap_buffer()
2380 jbd2_journal_put_journal_head(jh); in journal_unmap_buffer()
2389 J_ASSERT_JH(jh, transaction == journal->j_running_transaction); in journal_unmap_buffer()
2390 JBUFFER_TRACE(jh, "on running transaction"); in journal_unmap_buffer()
2391 may_free = __dispose_buffer(jh, transaction); in journal_unmap_buffer()
2403 jh->b_modified = 0; in journal_unmap_buffer()
2405 spin_unlock(&jh->b_state_lock); in journal_unmap_buffer()
2407 jbd2_journal_put_journal_head(jh); in journal_unmap_buffer()
2486 void __jbd2_journal_file_buffer(struct journal_head *jh, in __jbd2_journal_file_buffer() argument
2491 struct buffer_head *bh = jh2bh(jh); in __jbd2_journal_file_buffer()
2493 lockdep_assert_held(&jh->b_state_lock); in __jbd2_journal_file_buffer()
2496 J_ASSERT_JH(jh, jh->b_jlist < BJ_Types); in __jbd2_journal_file_buffer()
2497 J_ASSERT_JH(jh, jh->b_transaction == transaction || in __jbd2_journal_file_buffer()
2498 jh->b_transaction == NULL); in __jbd2_journal_file_buffer()
2500 if (jh->b_transaction && jh->b_jlist == jlist) in __jbd2_journal_file_buffer()
2519 if (jh->b_transaction) in __jbd2_journal_file_buffer()
2520 __jbd2_journal_temp_unlink_buffer(jh); in __jbd2_journal_file_buffer()
2523 jh->b_transaction = transaction; in __jbd2_journal_file_buffer()
2527 J_ASSERT_JH(jh, !jh->b_committed_data); in __jbd2_journal_file_buffer()
2528 J_ASSERT_JH(jh, !jh->b_frozen_data); in __jbd2_journal_file_buffer()
2545 __blist_add_buffer(list, jh); in __jbd2_journal_file_buffer()
2546 jh->b_jlist = jlist; in __jbd2_journal_file_buffer()
2552 void jbd2_journal_file_buffer(struct journal_head *jh, in jbd2_journal_file_buffer() argument
2555 spin_lock(&jh->b_state_lock); in jbd2_journal_file_buffer()
2557 __jbd2_journal_file_buffer(jh, transaction, jlist); in jbd2_journal_file_buffer()
2559 spin_unlock(&jh->b_state_lock); in jbd2_journal_file_buffer()
2575 bool __jbd2_journal_refile_buffer(struct journal_head *jh) in __jbd2_journal_refile_buffer() argument
2578 struct buffer_head *bh = jh2bh(jh); in __jbd2_journal_refile_buffer()
2580 lockdep_assert_held(&jh->b_state_lock); in __jbd2_journal_refile_buffer()
2581 if (jh->b_transaction) in __jbd2_journal_refile_buffer()
2582 assert_spin_locked(&jh->b_transaction->t_journal->j_list_lock); in __jbd2_journal_refile_buffer()
2585 if (jh->b_next_transaction == NULL) { in __jbd2_journal_refile_buffer()
2586 __jbd2_journal_unfile_buffer(jh); in __jbd2_journal_refile_buffer()
2596 __jbd2_journal_temp_unlink_buffer(jh); in __jbd2_journal_refile_buffer()
2602 J_ASSERT_JH(jh, jh->b_transaction != NULL); in __jbd2_journal_refile_buffer()
2609 WRITE_ONCE(jh->b_transaction, jh->b_next_transaction); in __jbd2_journal_refile_buffer()
2610 WRITE_ONCE(jh->b_next_transaction, NULL); in __jbd2_journal_refile_buffer()
2613 else if (jh->b_modified) in __jbd2_journal_refile_buffer()
2617 __jbd2_journal_file_buffer(jh, jh->b_transaction, jlist); in __jbd2_journal_refile_buffer()
2618 J_ASSERT_JH(jh, jh->b_transaction->t_state == T_RUNNING); in __jbd2_journal_refile_buffer()
2631 void jbd2_journal_refile_buffer(journal_t *journal, struct journal_head *jh) in jbd2_journal_refile_buffer() argument
2635 spin_lock(&jh->b_state_lock); in jbd2_journal_refile_buffer()
2637 drop = __jbd2_journal_refile_buffer(jh); in jbd2_journal_refile_buffer()
2638 spin_unlock(&jh->b_state_lock); in jbd2_journal_refile_buffer()
2641 jbd2_journal_put_journal_head(jh); in jbd2_journal_refile_buffer()