Lines Matching full:transaction

3  * linux/fs/jbd2/transaction.c
9 * Generic filesystem transaction handling code; part of the ext2fs
46 pr_emerg("JBD2: failed to create transaction cache\n"); in jbd2_journal_init_transaction_cache()
58 void jbd2_journal_free_transaction(transaction_t *transaction) in jbd2_journal_free_transaction() argument
60 if (unlikely(ZERO_OR_NULL_PTR(transaction))) in jbd2_journal_free_transaction()
62 kmem_cache_free(transaction_cache, transaction); in jbd2_journal_free_transaction()
66 * Base amount of descriptor blocks we reserve for each transaction.
81 * space for commit block and normal transaction descriptor blocks. in jbd2_descriptor_blocks_per_trans()
90 * Simply initialise a new transaction. Initialize it in
92 * have an existing running transaction: we only make a new transaction
97 * new transaction and we can't block without protecting against other
103 transaction_t *transaction) in jbd2_get_transaction() argument
105 transaction->t_journal = journal; in jbd2_get_transaction()
106 transaction->t_state = T_RUNNING; in jbd2_get_transaction()
107 transaction->t_start_time = ktime_get(); in jbd2_get_transaction()
108 transaction->t_tid = journal->j_transaction_sequence++; in jbd2_get_transaction()
109 transaction->t_expires = jiffies + journal->j_commit_interval; in jbd2_get_transaction()
110 atomic_set(&transaction->t_updates, 0); in jbd2_get_transaction()
111 atomic_set(&transaction->t_outstanding_credits, in jbd2_get_transaction()
114 atomic_set(&transaction->t_outstanding_revokes, 0); in jbd2_get_transaction()
115 atomic_set(&transaction->t_handle_count, 0); in jbd2_get_transaction()
116 INIT_LIST_HEAD(&transaction->t_inode_list); in jbd2_get_transaction()
117 INIT_LIST_HEAD(&transaction->t_private_list); in jbd2_get_transaction()
119 /* Set up the commit timer for the new transaction. */ in jbd2_get_transaction()
120 journal->j_commit_timer.expires = round_jiffies_up(transaction->t_expires); in jbd2_get_transaction()
124 journal->j_running_transaction = transaction; in jbd2_get_transaction()
125 transaction->t_max_wait = 0; in jbd2_get_transaction()
126 transaction->t_start = jiffies; in jbd2_get_transaction()
127 transaction->t_requested = 0; in jbd2_get_transaction()
139 * Update transaction's maximum wait time, if debugging is enabled.
146 static inline void update_t_max_wait(transaction_t *transaction, in update_t_max_wait() argument
151 if (time_after(transaction->t_start, ts)) { in update_t_max_wait()
152 newts = jbd2_time_diff(ts, transaction->t_start); in update_t_max_wait()
153 oldts = READ_ONCE(transaction->t_max_wait); in update_t_max_wait()
155 oldts = cmpxchg(&transaction->t_max_wait, oldts, newts); in update_t_max_wait()
160 * Wait until running transaction passes to T_FLUSH state and new transaction
162 * running transaction to exist and releases j_state_lock.
183 * Wait until running transaction transitions from T_SWITCH to T_FLUSH
184 * state and new transaction can thus be started. The function releases
217 * Wait until we can add credits for handle to the running transaction. Called
219 * transaction. Returns 1 if we had to wait, j_state_lock is dropped, and
236 * If the current transaction is locked down for commit, wait in add_transaction_credits()
254 * If the current transaction is already too large, in add_transaction_credits()
256 * attach this handle to a new transaction. in add_transaction_credits()
261 * Is the number of reserved credits in the current transaction too in add_transaction_credits()
284 * associated with a committing transaction creates a deadlock, in add_transaction_credits()
289 * in the new transaction. in add_transaction_credits()
309 /* We allow at most half of a transaction to be reserved */ in add_transaction_credits()
327 * to begin. Attach the handle to a transaction and set up the
328 * transaction's buffer credits.
334 transaction_t *transaction, *new_transaction = NULL; in start_this_handle() local
343 * Limit the number of reserved credits to 1/2 of maximum transaction in start_this_handle()
345 * transaction size per operation. in start_this_handle()
360 * transaction early if there are high chances we'll need it. If we in start_this_handle()
361 * guess wrong, we'll retry or free unused transaction. in start_this_handle()
393 * Wait on the journal's transaction barrier if necessary. Specifically in start_this_handle()
418 transaction = journal->j_running_transaction; in start_this_handle()
433 * transaction and we don't have to check for transaction size in start_this_handle()
435 * transaction is being switched to a committing one as it in start_this_handle()
438 if (transaction->t_state == T_SWITCH) { in start_this_handle()
447 * use and add the handle to the running transaction. in start_this_handle()
449 update_t_max_wait(transaction, ts); in start_this_handle()
450 handle->h_transaction = transaction; in start_this_handle()
454 atomic_inc(&transaction->t_updates); in start_this_handle()
455 atomic_inc(&transaction->t_handle_count); in start_this_handle()
458 atomic_read(&transaction->t_outstanding_credits), in start_this_handle()
466 * Ensure that no allocations done while the transaction is open are in start_this_handle()
540 * @journal: Journal to start transaction on.
543 * We make sure that the transaction can guarantee at least nblocks of
547 * stored in h_rsv_handle. It is not attached to any particular transaction
548 * and thus doesn't block transaction commit. If the caller uses this reserved
577 /* Get j_state_lock to pin running transaction if it exists */ in jbd2_journal_free_reserved()
592 * This attaches @handle to the running transaction (or creates one if there's
593 * not transaction running). Unlike jbd2_journal_start() this function cannot
658 * return code > 0 implies normal transaction-full status.
662 transaction_t *transaction = handle->h_transaction; in jbd2_journal_extend() local
669 journal = transaction->t_journal; in jbd2_journal_extend()
675 /* Don't extend a locked-down transaction! */ in jbd2_journal_extend()
676 if (transaction->t_state != T_RUNNING) { in jbd2_journal_extend()
678 "transaction not running\n", handle, nblocks); in jbd2_journal_extend()
689 &transaction->t_outstanding_credits); in jbd2_journal_extend()
693 "transaction too large\n", handle, nblocks); in jbd2_journal_extend()
694 atomic_sub(nblocks, &transaction->t_outstanding_credits); in jbd2_journal_extend()
699 transaction->t_tid, in jbd2_journal_extend()
718 transaction_t *transaction = handle->h_transaction; in stop_this_handle() local
719 journal_t *journal = transaction->t_journal; in stop_this_handle()
723 J_ASSERT(atomic_read(&transaction->t_updates) > 0); in stop_this_handle()
728 * transaction will really need as large sequences of transactions with in stop_this_handle()
739 &transaction->t_outstanding_revokes); in stop_this_handle()
746 &transaction->t_outstanding_credits); in stop_this_handle()
749 transaction); in stop_this_handle()
750 if (atomic_dec_and_test(&transaction->t_updates)) in stop_this_handle()
768 * Restart a handle for a multi-transaction filesystem
773 * handle's transaction so far and reattach the handle to a new
774 * transaction capable of guaranteeing the requested number of
781 transaction_t *transaction = handle->h_transaction; in jbd2__journal_restart() local
791 journal = transaction->t_journal; in jbd2__journal_restart()
792 tid = transaction->t_tid; in jbd2__journal_restart()
795 * First unlink the handle from its current transaction, and start the in jbd2__journal_restart()
841 * Note that the running transaction can get freed under us if in jbd2_journal_wait_updates()
842 * this transaction is getting committed in in jbd2_journal_wait_updates()
848 * lead to use-after-free of old freed transaction. in jbd2_journal_wait_updates()
850 transaction_t *transaction = journal->j_running_transaction; in jbd2_journal_wait_updates() local
852 if (!transaction) in jbd2_journal_wait_updates()
857 if (!atomic_read(&transaction->t_updates)) { in jbd2_journal_wait_updates()
869 * jbd2_journal_lock_updates () - establish a transaction barrier.
911 * Release a transaction barrier obtained with jbd2_journal_lock_updates().
956 * If the buffer is already part of the current transaction, then there
958 * transaction which we are still committing to disk, then we need to
962 * part of the transaction, that is).
970 transaction_t *transaction = handle->h_transaction; in do_get_write_access() local
976 journal = transaction->t_journal; in do_get_write_access()
1036 * The buffer is already part of this transaction if b_transaction or in do_get_write_access()
1039 if (jh->b_transaction == transaction || in do_get_write_access()
1040 jh->b_next_transaction == transaction) { in do_get_write_access()
1046 * this is the first time this transaction is touching this buffer, in do_get_write_access()
1057 JBUFFER_TRACE(jh, "no transaction"); in do_get_write_access()
1062 * visible before attaching it to the running transaction. in do_get_write_access()
1078 __jbd2_journal_file_buffer(jh, transaction, BJ_Reserved); in do_get_write_access()
1095 JBUFFER_TRACE(jh, "owned by older transaction"); in do_get_write_access()
1101 * committing transaction is currently writing this buffer out to disk in do_get_write_access()
1116 * Only do the copy if the currently-owning transaction still needs it. in do_get_write_access()
1117 * If buffer isn't on BJ_Metadata list, the committing transaction is in do_get_write_access()
1124 * committed_data record after the transaction, so we HAVE to force the in do_get_write_access()
1143 * before attaching it to the running transaction. Paired with barrier in do_get_write_access()
1147 jh->b_next_transaction = transaction; in do_get_write_access()
1166 /* Fast check whether buffer is already attached to the required transaction */
1181 * we see jh attached to the running transaction, we know it must stay in jbd2_write_access_granted()
1182 * so until the transaction is committed. Thus jh won't be freed and in jbd2_write_access_granted()
1184 * happen jh gets freed, reallocated, and attached to the transaction in jbd2_write_access_granted()
1204 * detect when jh went through free, realloc, attach to transaction in jbd2_write_access_granted()
1222 * @handle: transaction to add buffer modifications to
1272 * the bh is not already part of an existing transaction.
1280 * @handle: transaction to new buffer to
1287 transaction_t *transaction = handle->h_transaction; in jbd2_journal_get_create_access() local
1296 journal = transaction->t_journal; in jbd2_journal_get_create_access()
1301 * The buffer may already belong to this transaction due to pre-zeroing in jbd2_journal_get_create_access()
1303 * committing transaction's lists, but it HAS to be in Forget state in in jbd2_journal_get_create_access()
1304 * that case: the transaction must have deleted the buffer for it to be in jbd2_journal_get_create_access()
1308 J_ASSERT_JH(jh, (jh->b_transaction == transaction || in jbd2_journal_get_create_access()
1322 * the buffer so the transaction freeing it must have in jbd2_journal_get_create_access()
1326 /* first access by this transaction */ in jbd2_journal_get_create_access()
1331 __jbd2_journal_file_buffer(jh, transaction, BJ_Reserved); in jbd2_journal_get_create_access()
1334 /* first access by this transaction */ in jbd2_journal_get_create_access()
1337 JBUFFER_TRACE(jh, "set next transaction"); in jbd2_journal_get_create_access()
1339 jh->b_next_transaction = transaction; in jbd2_journal_get_create_access()
1361 * @handle: transaction
1377 * We never need to know which transaction the committed data is part
1379 * will be committed to a new transaction in due course, at which point
1442 * a running transaction will match the buffer in that transaction.
1479 * @handle: transaction to add buffer to.
1483 * transaction.
1489 * The buffer is placed on the transaction's metadata list and is marked
1490 * as belonging to the transaction.
1495 * current committing transaction (in which case we should have frozen
1497 * buffer: that only gets done when the old transaction finally
1502 transaction_t *transaction = handle->h_transaction; in jbd2_journal_dirty_metadata() local
1512 * of the running transaction. in jbd2_journal_dirty_metadata()
1524 if (data_race(jh->b_transaction != transaction && in jbd2_journal_dirty_metadata()
1525 jh->b_next_transaction != transaction)) { in jbd2_journal_dirty_metadata()
1527 J_ASSERT_JH(jh, jh->b_transaction == transaction || in jbd2_journal_dirty_metadata()
1528 jh->b_next_transaction == transaction); in jbd2_journal_dirty_metadata()
1532 /* If it's in our transaction it must be in BJ_Metadata list. */ in jbd2_journal_dirty_metadata()
1533 if (data_race(jh->b_transaction == transaction && in jbd2_journal_dirty_metadata()
1536 if (jh->b_transaction == transaction && in jbd2_journal_dirty_metadata()
1543 J_ASSERT_JH(jh, jh->b_transaction != transaction || in jbd2_journal_dirty_metadata()
1550 journal = transaction->t_journal; in jbd2_journal_dirty_metadata()
1557 * 'jh->b_next_transaction' during old transaction in jbd2_journal_dirty_metadata()
1568 * of the transaction. This needs to be done in jbd2_journal_dirty_metadata()
1569 * once a transaction -bzzz in jbd2_journal_dirty_metadata()
1581 * on the running transaction's metadata list there is nothing to do. in jbd2_journal_dirty_metadata()
1586 if (jh->b_transaction == transaction && jh->b_jlist == BJ_Metadata) { in jbd2_journal_dirty_metadata()
1608 * Metadata already on the current transaction list doesn't in jbd2_journal_dirty_metadata()
1609 * need to be filed. Metadata on another transaction's list must in jbd2_journal_dirty_metadata()
1613 if (jh->b_transaction != transaction) { in jbd2_journal_dirty_metadata()
1614 JBUFFER_TRACE(jh, "already on other transaction"); in jbd2_journal_dirty_metadata()
1617 (jh->b_next_transaction != transaction))) { in jbd2_journal_dirty_metadata()
1620 "transaction (%p, %u), " in jbd2_journal_dirty_metadata()
1625 transaction, transaction->t_tid, in jbd2_journal_dirty_metadata()
1637 * transaction's data buffer, ever. */ in jbd2_journal_dirty_metadata()
1646 __jbd2_journal_file_buffer(jh, transaction, BJ_Metadata); in jbd2_journal_dirty_metadata()
1657 * @handle: transaction handle
1661 * buffer. If the buffer is dirty in the current running transaction we
1674 transaction_t *transaction = handle->h_transaction; in jbd2_journal_forget() local
1683 journal = transaction->t_journal; in jbd2_journal_forget()
1703 /* keep track of whether or not this transaction modified us */ in jbd2_journal_forget()
1707 * The buffer's going from the transaction, we must drop in jbd2_journal_forget()
1712 if (jh->b_transaction == transaction) { in jbd2_journal_forget()
1716 * of this transaction, then we can just drop it from in jbd2_journal_forget()
1717 * the transaction immediately. */ in jbd2_journal_forget()
1721 JBUFFER_TRACE(jh, "belongs to current transaction: unfile"); in jbd2_journal_forget()
1724 * we only want to drop a reference if this transaction in jbd2_journal_forget()
1732 * However, the commit of this transaction is still in jbd2_journal_forget()
1745 __jbd2_journal_file_buffer(jh, transaction, BJ_Forget); in jbd2_journal_forget()
1755 * (committing) transaction, we can't drop it yet... */ in jbd2_journal_forget()
1756 JBUFFER_TRACE(jh, "belongs to older transaction"); in jbd2_journal_forget()
1757 /* ... but we CAN drop it from the new transaction through in jbd2_journal_forget()
1759 * the new transaction, so that not only the commit code in jbd2_journal_forget()
1762 * after the new transaction commits. */ in jbd2_journal_forget()
1768 jh->b_next_transaction = transaction; in jbd2_journal_forget()
1771 J_ASSERT(jh->b_next_transaction == transaction); in jbd2_journal_forget()
1774 * only drop a reference if this transaction modified in jbd2_journal_forget()
1783 * transaction, we can just drop it now if it has no in jbd2_journal_forget()
1788 JBUFFER_TRACE(jh, "belongs to none transaction"); in jbd2_journal_forget()
1804 * attach this buffer to current transaction so that the in jbd2_journal_forget()
1806 * transaction commits. in jbd2_journal_forget()
1809 __jbd2_journal_file_buffer(jh, transaction, BJ_Forget); in jbd2_journal_forget()
1824 * jbd2_journal_stop() - complete a transaction
1825 * @handle: transaction to complete.
1830 * buffer credits to the transaction and remove the handle. The only
1837 * transaction began.
1841 transaction_t *transaction = handle->h_transaction; in jbd2_journal_stop() local
1854 if (!transaction) { in jbd2_journal_stop()
1856 * Handle is already detached from the transaction so there is in jbd2_journal_stop()
1862 journal = transaction->t_journal; in jbd2_journal_stop()
1863 tid = transaction->t_tid; in jbd2_journal_stop()
1877 * Implement synchronous transaction batching. If the handle in jbd2_journal_stop()
1880 * transaction. Keep doing that while new threads continue to in jbd2_journal_stop()
1889 * and wait for the transaction to be committed than it is to in jbd2_journal_stop()
1891 * join the transaction. We achieve this by measuring how in jbd2_journal_stop()
1892 * long it takes to commit a transaction, and compare it with in jbd2_journal_stop()
1893 * how long this transaction has been running, and if run time in jbd2_journal_stop()
1917 transaction->t_start_time)); in jbd2_journal_stop()
1933 transaction->t_synchronous_commit = 1; in jbd2_journal_stop()
1937 * going! We also want to force a commit if the transaction is too in jbd2_journal_stop()
1941 time_after_eq(jiffies, transaction->t_expires)) { in jbd2_journal_stop()
1946 jbd2_debug(2, "transaction too old, requesting commit for " in jbd2_journal_stop()
1960 * Once stop_this_handle() drops t_updates, the transaction could start in jbd2_journal_stop()
1962 * dereference transaction pointer again after calling in jbd2_journal_stop()
1980 * transaction buffer lists.
1985 * Append a buffer to a transaction list, given the transaction's list head
2009 * Remove a buffer from a transaction list, given the transaction's list
2030 * Remove a buffer from the appropriate transaction list.
2043 transaction_t *transaction; in __jbd2_journal_temp_unlink_buffer() local
2047 transaction = jh->b_transaction; in __jbd2_journal_temp_unlink_buffer()
2048 if (transaction) in __jbd2_journal_temp_unlink_buffer()
2049 assert_spin_locked(&transaction->t_journal->j_list_lock); in __jbd2_journal_temp_unlink_buffer()
2053 J_ASSERT_JH(jh, transaction != NULL); in __jbd2_journal_temp_unlink_buffer()
2059 transaction->t_nr_buffers--; in __jbd2_journal_temp_unlink_buffer()
2060 J_ASSERT_JH(jh, transaction->t_nr_buffers >= 0); in __jbd2_journal_temp_unlink_buffer()
2061 list = &transaction->t_buffers; in __jbd2_journal_temp_unlink_buffer()
2064 list = &transaction->t_forget; in __jbd2_journal_temp_unlink_buffer()
2067 list = &transaction->t_shadow_list; in __jbd2_journal_temp_unlink_buffer()
2070 list = &transaction->t_reserved_list; in __jbd2_journal_temp_unlink_buffer()
2076 if (transaction && is_journal_aborted(transaction->t_journal)) in __jbd2_journal_temp_unlink_buffer()
2084 * the jh reference that belonged to the transaction.
2128 * running transaction's ->t_datalist via __jbd2_journal_unfile_buffer.
2142 * while the data is part of a transaction. Yes?
2188 * This buffer is no longer needed. If it is on an older transaction's
2189 * checkpoint list we need to record it on this transaction's forget list
2190 * to pin this buffer (and hence its checkpointing transaction) down until
2191 * this transaction commits. If the buffer isn't on a checkpoint list, we
2199 static int __dispose_buffer(struct journal_head *jh, transaction_t *transaction) in __dispose_buffer() argument
2205 JBUFFER_TRACE(jh, "on running+cp transaction"); in __dispose_buffer()
2213 __jbd2_journal_file_buffer(jh, transaction, BJ_Forget); in __dispose_buffer()
2216 JBUFFER_TRACE(jh, "on running transaction"); in __dispose_buffer()
2236 * attached to the current transaction: once the transaction commits,
2240 * previous, committing transaction!
2243 * transaction (and which therefore cannot be discarded immediately) are
2244 * not going to be reused in the new running transaction
2247 * allocated in one transaction and removed in the next will be marked
2249 * the next transaction to delete the block commits. This means that
2258 * transaction commit --- so it is always safe just to discard data
2265 * transaction.
2267 * We're outside-transaction here. Either or both of j_running_transaction
2273 transaction_t *transaction; in journal_unmap_buffer() local
2296 * transaction adding inode to orphan list (let's call it T) in journal_unmap_buffer()
2297 * is committed. Otherwise if the transaction changing the in journal_unmap_buffer()
2302 * transaction marking the buffer as freed in the filesystem in journal_unmap_buffer()
2307 * the buffer to BJ_Forget list of the newest transaction. in journal_unmap_buffer()
2315 * the transaction this buffer was modified in. in journal_unmap_buffer()
2317 transaction = jh->b_transaction; in journal_unmap_buffer()
2318 if (transaction == NULL) { in journal_unmap_buffer()
2319 /* First case: not on any transaction. If it in journal_unmap_buffer()
2324 JBUFFER_TRACE(jh, "not on any transaction: zap"); in journal_unmap_buffer()
2339 /* ... and once the current transaction has in journal_unmap_buffer()
2347 /* There is no currently-running transaction. So the in journal_unmap_buffer()
2350 * the committing transaction, if it exists. */ in journal_unmap_buffer()
2357 /* The orphan record's transaction has in journal_unmap_buffer()
2364 } else if (transaction == journal->j_committing_transaction) { in journal_unmap_buffer()
2365 JBUFFER_TRACE(jh, "on committing transaction"); in journal_unmap_buffer()
2383 * b_modified to not confuse transaction credit accounting, and in journal_unmap_buffer()
2384 * set j_next_transaction to the running transaction (if there in journal_unmap_buffer()
2398 /* Good, the buffer belongs to the running transaction. in journal_unmap_buffer()
2399 * We are writing our own transaction's data, not any in journal_unmap_buffer()
2404 J_ASSERT_JH(jh, transaction == journal->j_running_transaction); in journal_unmap_buffer()
2405 JBUFFER_TRACE(jh, "on running transaction"); in journal_unmap_buffer()
2406 may_free = __dispose_buffer(jh, transaction); in journal_unmap_buffer()
2414 * running transaction, journal_get_write_access() won't clear in journal_unmap_buffer()
2443 * Can return -EBUSY if buffers are part of the committing transaction and
2499 * File a buffer on the given transaction list.
2502 transaction_t *transaction, int jlist) in __jbd2_journal_file_buffer() argument
2509 assert_spin_locked(&transaction->t_journal->j_list_lock); in __jbd2_journal_file_buffer()
2512 J_ASSERT_JH(jh, jh->b_transaction == transaction || in __jbd2_journal_file_buffer()
2538 jh->b_transaction = transaction; in __jbd2_journal_file_buffer()
2546 transaction->t_nr_buffers++; in __jbd2_journal_file_buffer()
2547 list = &transaction->t_buffers; in __jbd2_journal_file_buffer()
2550 list = &transaction->t_forget; in __jbd2_journal_file_buffer()
2553 list = &transaction->t_shadow_list; in __jbd2_journal_file_buffer()
2556 list = &transaction->t_reserved_list; in __jbd2_journal_file_buffer()
2568 transaction_t *transaction, int jlist) in jbd2_journal_file_buffer() argument
2571 spin_lock(&transaction->t_journal->j_list_lock); in jbd2_journal_file_buffer()
2572 __jbd2_journal_file_buffer(jh, transaction, jlist); in jbd2_journal_file_buffer()
2573 spin_unlock(&transaction->t_journal->j_list_lock); in jbd2_journal_file_buffer()
2579 * dropping it from its current transaction entirely. If the buffer has
2580 * already started to be used by a subsequent transaction, refile the
2581 * buffer on that transaction's metadata list.
2586 * When this function returns true, there's no next transaction to refile to
2606 * It has been modified by a later transaction: add it to the new in __jbd2_journal_refile_buffer()
2607 * transaction's metadata list. in __jbd2_journal_refile_buffer()
2660 * File inode in the inode list of the handle's transaction
2665 transaction_t *transaction = handle->h_transaction; in jbd2_journal_file_inode() local
2670 journal = transaction->t_journal; in jbd2_journal_file_inode()
2673 transaction->t_tid); in jbd2_journal_file_inode()
2687 if (jinode->i_transaction == transaction || in jbd2_journal_file_inode()
2688 jinode->i_next_transaction == transaction) in jbd2_journal_file_inode()
2696 if (!transaction->t_need_data_flush) in jbd2_journal_file_inode()
2697 transaction->t_need_data_flush = 1; in jbd2_journal_file_inode()
2698 /* On some different transaction's list - should be in jbd2_journal_file_inode()
2704 jinode->i_next_transaction = transaction; in jbd2_journal_file_inode()
2707 /* Not on any transaction list... */ in jbd2_journal_file_inode()
2709 jinode->i_transaction = transaction; in jbd2_journal_file_inode()
2710 list_add(&jinode->i_list, &transaction->t_inode_list); in jbd2_journal_file_inode()
2733 * File truncate and transaction commit interact with each other in a
2734 * non-trivial way. If a transaction writing data block A is
2736 * written them. Otherwise if we crashed after the transaction with
2737 * write has committed but before the transaction with truncate has
2740 * part in case it is in the committing transaction.
2746 * committing the transaction after this function has been called but
2747 * before a transaction for truncate is started (and furthermore it
2749 * happens in the same transaction as write --- we don't have to write
2763 * enough that the transaction was not committing before we started in jbd2_journal_begin_ordered_truncate()
2764 * a transaction adding the inode to orphan list */ in jbd2_journal_begin_ordered_truncate()