linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Zheng Liu <gnehzuil.liu@gmail.com>
Cc: linux-ext4@vger.kernel.org, Zheng Liu <wenqing.lz@taobao.com>,
	Theodore Ts'o <tytso@mit.edu>, Jan kara <jack@suse.cz>
Subject: Re: [PATCH 03/10 v5] ext4: let ext4_ext_map_blocks return EXT4_MAP_UNWRITTEN flag
Date: Fri, 8 Feb 2013 16:41:04 +0100	[thread overview]
Message-ID: <20130208154104.GC10226@quack.suse.cz> (raw)
In-Reply-To: <1360313046-9876-4-git-send-email-wenqing.lz@taobao.com>

On Fri 08-02-13 16:43:59, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
> 
> This commit lets ext4_ext_map_blocks return EXT4_MAP_UNWRITTEN flag
> because in later commit ext4_map_blocks needs to use this flag to
> determine the extent status.
  The patch looks good. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> 
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> Cc: "Theodore Ts'o" <tytso@mit.edu>
> Cc: Jan kara <jack@suse.cz>
> ---
>  fs/ext4/extents.c |  6 +++++-
>  fs/ext4/inode.c   | 12 +++---------
>  2 files changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index f7bf616..d92947f 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -3657,6 +3657,7 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode,
>  			ext4_set_io_unwritten_flag(inode, io);
>  		else
>  			ext4_set_inode_state(inode, EXT4_STATE_DIO_UNWRITTEN);
> +		map->m_flags |= EXT4_MAP_UNWRITTEN;
>  		if (ext4_should_dioread_nolock(inode))
>  			map->m_flags |= EXT4_MAP_UNINIT;
>  		goto out;
> @@ -3678,8 +3679,10 @@ ext4_ext_handle_uninitialized_extents(handle_t *handle, struct inode *inode,
>  	 * repeat fallocate creation request
>  	 * we already have an unwritten extent
>  	 */
> -	if (flags & EXT4_GET_BLOCKS_UNINIT_EXT)
> +	if (flags & EXT4_GET_BLOCKS_UNINIT_EXT) {
> +		map->m_flags |= EXT4_MAP_UNWRITTEN;
>  		goto map_out;
> +	}
>  
>  	/* buffered READ or buffered write_begin() lookup */
>  	if ((flags & EXT4_GET_BLOCKS_CREATE) == 0) {
> @@ -4109,6 +4112,7 @@ got_allocated_blocks:
>  	/* Mark uninitialized */
>  	if (flags & EXT4_GET_BLOCKS_UNINIT_EXT){
>  		ext4_ext_mark_uninitialized(&newex);
> +		map->m_flags |= EXT4_MAP_UNWRITTEN;
>  		/*
>  		 * io_end structure was created for every IO write to an
>  		 * uninitialized extent. To avoid unnecessary conversion,
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 7fb00d8..c7e9665 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -560,16 +560,10 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
>  		return retval;
>  
>  	/*
> -	 * When we call get_blocks without the create flag, the
> -	 * BH_Unwritten flag could have gotten set if the blocks
> -	 * requested were part of a uninitialized extent.  We need to
> -	 * clear this flag now that we are committed to convert all or
> -	 * part of the uninitialized extent to be an initialized
> -	 * extent.  This is because we need to avoid the combination
> -	 * of BH_Unwritten and BH_Mapped flags being simultaneously
> -	 * set on the buffer_head.
> +	 * Here we clear m_flags because after allocating an new extent,
> +	 * it will be set again.
>  	 */
> -	map->m_flags &= ~EXT4_MAP_UNWRITTEN;
> +	map->m_flags &= ~EXT4_MAP_FLAGS;
>  
>  	/*
>  	 * New blocks allocate and/or writing to uninitialized extent
> -- 
> 1.7.12.rc2.18.g61b472e
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2013-02-08 15:41 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08  8:43 [PATCH 00/10 v5] ext4: extent status tree (step2) Zheng Liu
2013-02-08  8:43 ` [PATCH 01/10 v5] ext4: refine extent status tree Zheng Liu
2013-02-08 15:35   ` Jan Kara
2013-02-15  6:38     ` Zheng Liu
2013-02-08  8:43 ` [PATCH 02/10 v5] ext4: add physical block and status member into " Zheng Liu
2013-02-08 15:39   ` Jan Kara
2013-02-08  8:43 ` [PATCH 03/10 v5] ext4: let ext4_ext_map_blocks return EXT4_MAP_UNWRITTEN flag Zheng Liu
2013-02-08 15:41   ` Jan Kara [this message]
2013-02-08  8:44 ` [PATCH 04/10 v5] ext4: track all extent status in extent status tree Zheng Liu
2013-02-11 12:21   ` Jan Kara
2013-02-15  6:45     ` Zheng Liu
2013-02-13  3:28   ` Theodore Ts'o
2013-02-13  3:46     ` [PATCH 1/2] ext4: rename ext4_es_find_extent() to ext4_es_find_delayed_extent() Theodore Ts'o
2013-02-13  3:46       ` [PATCH 2/2] ext4: track all extent status in extent status tree Theodore Ts'o
2013-02-15  6:53     ` [PATCH 04/10 v5] " Zheng Liu
2013-02-17 16:26     ` Zheng Liu
2013-02-08  8:44 ` [PATCH 05/10 v5] ext4: lookup block mapping " Zheng Liu
2013-02-12 12:31   ` Jan Kara
2013-02-15  7:06     ` Zheng Liu
2013-02-15 16:47       ` Jan Kara
2013-02-15 17:25       ` Theodore Ts'o
2013-02-16  2:32         ` Zheng Liu
2013-02-16 16:18           ` Possible TODO projects for the map_blocks() code path (was: Re: [PATCH 05/10 v5] ext4: lookup block mapping in extent status tree) Theodore Ts'o
2013-02-17  3:15             ` Zheng Liu
2013-02-08  8:44 ` [PATCH 06/10 v5] ext4: remove single extent cache Zheng Liu
2013-02-08  8:44 ` [PATCH 07/10 v5] ext4: adjust some functions for reclaiming extents from extent status tree Zheng Liu
2013-02-08  8:44 ` [PATCH 08/10 v5] ext4: reclaim " Zheng Liu
2013-02-08  8:44 ` [PATCH 09/10 v5] ext4: convert unwritten extents from extent status tree in end_io Zheng Liu
2013-02-10  8:45   ` Zheng Liu
2013-02-11  1:52     ` Theodore Ts'o
2013-02-12 12:51   ` Jan Kara
2013-02-15  7:12     ` Zheng Liu
2013-02-08  8:44 ` [PATCH 10/10 v5] ext4: remove bogus wait for unwritten extents in ext4_ind_direct_IO Zheng Liu
2013-02-12 12:58   ` Jan Kara
2013-02-15  7:14     ` Zheng Liu
2013-02-10  1:38 ` [PATCH 00/10 v5] ext4: extent status tree (step2) Theodore Ts'o
2013-02-10  8:40   ` Zheng Liu

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=20130208154104.GC10226@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=gnehzuil.liu@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    --cc=wenqing.lz@taobao.com \
    /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).