Patchwork ext4:an improvement in ext4 feature inline_data

login
register
mail settings
Submitter boxi liu
Date May 26, 2013, 1:19 p.m.
Message ID <CAAFszuV7QJc2-5xFerStUrjNhD4+MR3R7kBVAxsg+Otx18RvGg@mail.gmail.com>
Download mbox | patch
Permalink /patch/246394/
State Accepted
Headers show

Comments

boxi liu - May 26, 2013, 1:19 p.m.
In ext4 feature inline_data,it use the xattr's space to store the
inline data in inode.When we calculate the inline data as the xattr,we
add the pad.But in get_max_inline_xattr_value_size() function we count
the free space without pad.It cause some contents are moved to a block
even if it can be
stored in the inode.

Signed-off-by:liulei <lewis.liulei@huawei.com>
---
 fs/ext4/inline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


--
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tao Ma - May 26, 2013, 1:40 p.m.
On 05/26/2013 09:19 PM, boxi liu wrote:
> In ext4 feature inline_data,it use the xattr's space to store the
> inline data in inode.When we calculate the inline data as the xattr,we
> add the pad.But in get_max_inline_xattr_value_size() function we count
> the free space without pad.It cause some contents are moved to a block
> even if it can be
> stored in the inode.
> 
> Signed-off-by:liulei <lewis.liulei@huawei.com>
Reviewed-by: Tao Ma <boyu.mt@taobao.com>

Thanks,
Tao
> ---
>  fs/ext4/inline.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
> index c0fd1a1..87758ca 100644
> --- a/fs/ext4/inline.c
> +++ b/fs/ext4/inline.c
> @@ -71,7 +71,7 @@ static int get_max_inline_xattr_value_size(struct
> inode *inode,
>                 entry = (struct ext4_xattr_entry *)
>                         ((void *)raw_inode + EXT4_I(inode)->i_inline_off);
> 
> -               free += le32_to_cpu(entry->e_value_size);
> +               free += EXT4_XATTR_SIZE(le32_to_cpu(entry->e_value_size));
>                 goto out;
>         }
> 
> --
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o - June 18, 2013, 3:21 p.m.
On Sun, May 26, 2013 at 09:40:41PM +0800, Tao Ma wrote:
> On 05/26/2013 09:19 PM, boxi liu wrote:
> > In ext4 feature inline_data,it use the xattr's space to store the
> > inline data in inode.When we calculate the inline data as the xattr,we
> > add the pad.But in get_max_inline_xattr_value_size() function we count
> > the free space without pad.It cause some contents are moved to a block
> > even if it can be
> > stored in the inode.
> > 
> > Signed-off-by:liulei <lewis.liulei@huawei.com>
> Reviewed-by: Tao Ma <boyu.mt@taobao.com>

Applied, thanks.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
index c0fd1a1..87758ca 100644
--- a/fs/ext4/inline.c
+++ b/fs/ext4/inline.c
@@ -71,7 +71,7 @@  static int get_max_inline_xattr_value_size(struct
inode *inode,
                entry = (struct ext4_xattr_entry *)
                        ((void *)raw_inode + EXT4_I(inode)->i_inline_off);

-               free += le32_to_cpu(entry->e_value_size);
+               free += EXT4_XATTR_SIZE(le32_to_cpu(entry->e_value_size));
                goto out;
        }