summaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4_jbd2.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2019-11-05 17:44:17 +0100
committerTheodore Ts'o <tytso@mit.edu>2019-11-05 22:00:48 +0100
commita9a8344ee1714f835ba394077e8c13d751e2f148 (patch)
treee1c8c2ca02986fb433198e68a89137339be74e99 /fs/ext4/ext4_jbd2.c
parentext4: Provide function to handle transaction restarts (diff)
downloadlinux-a9a8344ee1714f835ba394077e8c13d751e2f148.tar.xz
linux-a9a8344ee1714f835ba394077e8c13d751e2f148.zip
ext4, jbd2: Provide accessor function for handle credits
Provide accessor function to get number of credits available in a handle and use it from ext4. Later, computation of available credits won't be so straightforward. Reviewed-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20191105164437.32602-11-jack@suse.cz Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4_jbd2.c')
-rw-r--r--fs/ext4/ext4_jbd2.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index 2b98d893cda9..731bbfdbce5b 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -119,8 +119,8 @@ handle_t *__ext4_journal_start_reserved(handle_t *handle, unsigned int line,
return ext4_get_nojournal();
sb = handle->h_journal->j_private;
- trace_ext4_journal_start_reserved(sb, handle->h_buffer_credits,
- _RET_IP_);
+ trace_ext4_journal_start_reserved(sb,
+ jbd2_handle_buffer_credits(handle), _RET_IP_);
err = ext4_journal_check_start(sb);
if (err < 0) {
jbd2_journal_free_reserved(handle);
@@ -138,10 +138,10 @@ int __ext4_journal_ensure_credits(handle_t *handle, int check_cred,
{
if (!ext4_handle_valid(handle))
return 0;
- if (handle->h_buffer_credits >= check_cred)
+ if (jbd2_handle_buffer_credits(handle) >= check_cred)
return 0;
return ext4_journal_extend(handle,
- extend_cred - handle->h_buffer_credits);
+ extend_cred - jbd2_handle_buffer_credits(handle));
}
static void ext4_journal_abort_handle(const char *caller, unsigned int line,
@@ -289,7 +289,7 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line,
handle->h_type,
handle->h_line_no,
handle->h_requested_credits,
- handle->h_buffer_credits, err);
+ jbd2_handle_buffer_credits(handle), err);
return err;
}
ext4_error_inode(inode, where, line,
@@ -300,7 +300,8 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line,
handle->h_type,
handle->h_line_no,
handle->h_requested_credits,
- handle->h_buffer_credits, err);
+ jbd2_handle_buffer_credits(handle),
+ err);
}
} else {
if (inode)