linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ross Zwisler <zwisler@google.com>
To: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: akpm@linux-foundation.org, Theodore Ts'o <tytso@mit.edu>,
	Ross Zwisler <zwisler@chromium.org>,
	linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com
Subject: Re: [PATCH 1/2] ocfs2: use jbd2_inode dirty range scoping
Date: Fri, 12 Jul 2019 15:39:22 -0600	[thread overview]
Message-ID: <20190712213922.GB244046@google.com> (raw)
In-Reply-To: <1562914972-97318-1-git-send-email-joseph.qi@linux.alibaba.com>

On Fri, Jul 12, 2019 at 03:02:51PM +0800, Joseph Qi wrote:
> commit 6ba0e7dc64a5 ("jbd2: introduce jbd2_inode dirty range scoping")
> allow us scoping each of the inode dirty ranges associated with a given
> transaction, and ext4 already does this way.
> Now let's also use the newly introduced jbd2_inode dirty range scoping
> to prevent us from waiting forever when trying to complete a journal
> transaction in ocfs2.
> 
> Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
 
> diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c
> index a4c905d..bbb508a 100644
> --- a/fs/ocfs2/aops.c
> +++ b/fs/ocfs2/aops.c
> @@ -942,7 +942,7 @@ static void ocfs2_write_failure(struct inode *inode,
>  
>  		if (tmppage && page_has_buffers(tmppage)) {
>  			if (ocfs2_should_order_data(inode))
> -				ocfs2_jbd2_file_inode(wc->w_handle, inode);
> +				ocfs2_jbd2_file_inode(wc->w_handle, inode, user_pos, user_len);

Line longer than 80 characters, should be wrapped.

> @@ -2024,7 +2024,9 @@ int ocfs2_write_end_nolock(struct address_space *mapping,
>  
>  		if (page_has_buffers(tmppage)) {
>  			if (handle && ocfs2_should_order_data(inode))
> -				ocfs2_jbd2_file_inode(handle, inode);
> +				ocfs2_jbd2_file_inode(handle, inode,
> +						      ((loff_t)tmppage->index << PAGE_SHIFT) + from,

Line longer than 80 characters, should be wrapped.

> diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h
> index c0fe6ed..932e6a8 100644
> --- a/fs/ocfs2/journal.h
> +++ b/fs/ocfs2/journal.h
> @@ -603,9 +603,11 @@ static inline int ocfs2_calc_tree_trunc_credits(struct super_block *sb,
>  	return credits;
>  }
>  
> -static inline int ocfs2_jbd2_file_inode(handle_t *handle, struct inode *inode)
> +static inline int ocfs2_jbd2_file_inode(handle_t *handle, struct inode *inode,
> +					loff_t start_byte, loff_t length)
>  {
> -	return jbd2_journal_inode_add_write(handle, &OCFS2_I(inode)->ip_jinode);
> +	return jbd2_journal_inode_ranged_write(handle, &OCFS2_I(inode)->ip_jinode,
> +					       start_byte, length);
>  }

Perhaps ocfs2_jbd2_ranged_write() would be more informative if you're renaming
this function?

Aside from these nits, this all looked good to me.  You can add:
Reviewed-by: Ross Zwisler <zwisler@google.com>

  parent reply	other threads:[~2019-07-12 21:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  7:02 [PATCH 1/2] ocfs2: use jbd2_inode dirty range scoping Joseph Qi
2019-07-12  7:02 ` [PATCH 2/2] jbd2: remove jbd2_journal_inode_add_[write|wait] Joseph Qi
2019-07-12 21:14   ` Ross Zwisler
2019-07-12  9:45 ` [PATCH 1/2] ocfs2: use jbd2_inode dirty range scoping Changwei Ge
2019-07-12 13:32   ` Joseph Qi
2019-07-12 21:39 ` Ross Zwisler [this message]
2019-07-13  0:26 Joseph Qi
2019-07-15  3:42 ` Changwei Ge

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=20190712213922.GB244046@google.com \
    --to=zwisler@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=tytso@mit.edu \
    --cc=zwisler@chromium.org \
    /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).