From: Linus Torvalds <torvalds@linux-foundation.org>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [GIT PULL] ext4 update for 2.6.36
Date: Sat, 7 Aug 2010 13:17:46 -0700 [thread overview]
Message-ID: <AANLkTinJQ7DQK8_0ngHrbZugFBCgyM5ETUPhcDSmYGP6@mail.gmail.com> (raw)
In-Reply-To: <E1OhETF-0005P6-7v@tytso-glaptop>
[-- Attachment #1: Type: text/plain, Size: 812 bytes --]
On Thu, Aug 5, 2010 at 9:23 PM, Theodore Ts'o <tytso@mit.edu> wrote:
>
> Which is hopefully what you want. If you want exactly what is shown
> below, you can also pull the "next" branch, which omits the merge, and
> then you can deal with the merge conflict by hand. The results should
> be the same either way.
I did that just to see what it looked like.
One annoyance: I now get
fs/jbd2/transaction.c: In function ‘start_this_handle’:
fs/jbd2/transaction.c:98: warning: unused variable ‘ts’
due to that 'ts' thing only being used for the CONFIG_JBD2_DEBUG case.
Please fix. I'd suggest putting that CONFIG_JBD2_DEBUG code in a
helper function of its own, and declaring 'ts' there instead.
Suggested patch (but with a horrible helper function name) attached.
Linus
[-- Attachment #2: diff --]
[-- Type: application/octet-stream, Size: 1906 bytes --]
fs/jbd2/transaction.c | 29 ++++++++++++++++++-----------
1 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index d95cc9d..037d65d 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -81,6 +81,23 @@ jbd2_get_transaction(journal_t *journal, transaction_t *transaction)
* of that one update.
*/
+static inline void start_handle_debug(transaction_t *transaction)
+{
+#ifdef CONFIG_JBD2_DEBUG
+ unsigned long ts = jiffies;
+
+ if (jbd2_journal_enable_debug &&
+ time_after(transaction->t_start, ts)) {
+ ts = jbd2_time_diff(ts, transaction->t_start);
+ spin_lock(&transaction->t_handle_lock);
+ if (ts > transaction->t_max_wait)
+ transaction->t_max_wait = ts;
+ spin_unlock(&transaction->t_handle_lock);
+ }
+#endif
+}
+
+
/*
* start_this_handle: Given a handle, deal with any locking or stalling
* needed to make sure that there is enough journal space for the handle
@@ -95,7 +112,6 @@ static int start_this_handle(journal_t *journal, handle_t *handle,
int needed;
int nblocks = handle->h_buffer_credits;
transaction_t *new_transaction = NULL;
- unsigned long ts = jiffies;
if (nblocks > journal->j_max_transaction_buffers) {
printk(KERN_ERR "JBD: %s wants too many credits (%d > %d)\n",
@@ -250,16 +266,7 @@ repeat:
* separate flag, eventually, so we can enable this
* independently of debugging.
*/
-#ifdef CONFIG_JBD2_DEBUG
- if (jbd2_journal_enable_debug &&
- time_after(transaction->t_start, ts)) {
- ts = jbd2_time_diff(ts, transaction->t_start);
- spin_lock(&transaction->t_handle_lock);
- if (ts > transaction->t_max_wait)
- transaction->t_max_wait = ts;
- spin_unlock(&transaction->t_handle_lock);
- }
-#endif
+ start_handle_debug(transaction);
handle->h_transaction = transaction;
atomic_inc(&transaction->t_updates);
atomic_inc(&transaction->t_handle_count);
next prev parent reply other threads:[~2010-08-07 20:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-06 4:23 [GIT PULL] ext4 update for 2.6.36 Theodore Ts'o
2010-08-07 20:17 ` Linus Torvalds [this message]
2010-08-09 21:48 ` Ted Ts'o
-- strict thread matches above, loose matches on Subject: below --
2010-08-13 21:09 Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTinJQ7DQK8_0ngHrbZugFBCgyM5ETUPhcDSmYGP6@mail.gmail.com \
--to=torvalds@linux-foundation.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).