linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v2] f2fs-tools: fix the calculation for raw_node->footer.next_blkaddr in f2fs_write_root_inode
@ 2013-06-28  5:12 Wang Sheng-Hui
  2013-06-28  5:56 ` Jaegeuk Kim
  2013-06-28  5:56 ` Wang Sheng-Hui
  0 siblings, 2 replies; 3+ messages in thread
From: Wang Sheng-Hui @ 2013-06-28  5:12 UTC (permalink / raw)
  To: jaegeuk.kim, linux-f2fs-devel

The raw_node will take 1 blk itself, and its next blk addr should be +1.

Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
  mkfs/f2fs_format.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index 06771ff..f00ba04 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -744,7 +744,7 @@ static int f2fs_write_root_inode(void)
  	raw_node->footer.next_blkaddr = cpu_to_le32(
  			le32_to_cpu(super_block.main_blkaddr) +
  			config.cur_seg[CURSEG_HOT_NODE] *
-			config.blks_per_seg + 1);
+			config.blks_per_seg) + cpu_to_le32(1);

  	raw_node->i.i_mode = cpu_to_le16(0x41ed);
  	raw_node->i.i_links = cpu_to_le32(2);
-- 
1.7.10.4

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs-tools: fix the calculation for raw_node->footer.next_blkaddr in f2fs_write_root_inode
  2013-06-28  5:12 [f2fs-dev] [PATCH v2] f2fs-tools: fix the calculation for raw_node->footer.next_blkaddr in f2fs_write_root_inode Wang Sheng-Hui
@ 2013-06-28  5:56 ` Jaegeuk Kim
  2013-06-28  5:56 ` Wang Sheng-Hui
  1 sibling, 0 replies; 3+ messages in thread
From: Jaegeuk Kim @ 2013-06-28  5:56 UTC (permalink / raw)
  To: Wang Sheng-Hui; +Cc: linux-f2fs-devel

Hi,

Again, it doesn't make sense why we should cpu_to_le32(x) +
cpu_to_le32(1) instead of cpu_to_le32(x + 1).

What is the problem?

2013-06-28 (금), 13:12 +0800, Wang Sheng-Hui:
> The raw_node will take 1 blk itself, and its next blk addr should be +1.
> 
> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
> ---
>   mkfs/f2fs_format.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> index 06771ff..f00ba04 100644
> --- a/mkfs/f2fs_format.c
> +++ b/mkfs/f2fs_format.c
> @@ -744,7 +744,7 @@ static int f2fs_write_root_inode(void)
>   	raw_node->footer.next_blkaddr = cpu_to_le32(
>   			le32_to_cpu(super_block.main_blkaddr) +
>   			config.cur_seg[CURSEG_HOT_NODE] *
> -			config.blks_per_seg + 1);
> +			config.blks_per_seg) + cpu_to_le32(1);
> 
>   	raw_node->i.i_mode = cpu_to_le16(0x41ed);
>   	raw_node->i.i_links = cpu_to_le32(2);

-- 
Jaegeuk Kim
Samsung


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [f2fs-dev] [PATCH v2] f2fs-tools: fix the calculation for raw_node->footer.next_blkaddr in f2fs_write_root_inode
  2013-06-28  5:12 [f2fs-dev] [PATCH v2] f2fs-tools: fix the calculation for raw_node->footer.next_blkaddr in f2fs_write_root_inode Wang Sheng-Hui
  2013-06-28  5:56 ` Jaegeuk Kim
@ 2013-06-28  5:56 ` Wang Sheng-Hui
  1 sibling, 0 replies; 3+ messages in thread
From: Wang Sheng-Hui @ 2013-06-28  5:56 UTC (permalink / raw)
  To: jaegeuk.kim, linux-f2fs-devel

On 2013年06月28日 13:12, Wang Sheng-Hui wrote:
> The raw_node will take 1 blk itself, and its next blk addr should be +1.
>
> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
> ---
>   mkfs/f2fs_format.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
> index 06771ff..f00ba04 100644
> --- a/mkfs/f2fs_format.c
> +++ b/mkfs/f2fs_format.c
> @@ -744,7 +744,7 @@ static int f2fs_write_root_inode(void)
>       raw_node->footer.next_blkaddr = cpu_to_le32(
>               le32_to_cpu(super_block.main_blkaddr) +
>               config.cur_seg[CURSEG_HOT_NODE] *
> -            config.blks_per_seg + 1);
> +            config.blks_per_seg) + cpu_to_le32(1);
>
>       raw_node->i.i_mode = cpu_to_le16(0x41ed);
>       raw_node->i.i_links = cpu_to_le32(2);

Sorry, I mislooked the () position. And the origin calculation is right.
Please ignore this patch.

Thanks,
Sheng-Hui

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-06-28  5:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-28  5:12 [f2fs-dev] [PATCH v2] f2fs-tools: fix the calculation for raw_node->footer.next_blkaddr in f2fs_write_root_inode Wang Sheng-Hui
2013-06-28  5:56 ` Jaegeuk Kim
2013-06-28  5:56 ` Wang Sheng-Hui

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).