Re: [PATCH 1/2] ocfs2: use jbd2_inode dirty range scoping

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx>
 
> 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@xxxxxxxxxx>



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux