[RESEND] [PATCH] btrfs-progs: avoid memory leak in btrfs_close_devices

2013-06-25 Thread Wang Sheng-Hui
Three kind of structures need to be freed on close: * All struct btrfs_device managed by fs_devices * The name field for each struct btrfs_device * fs_devices structure itself The same ones for seed_devices. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- volumes.c | 16

[PATCH] btrfs-progs: remove unused var *prev in extent-cache.c/find_cache_extent

2013-06-24 Thread Wang Sheng-Hui
var *prev is not used in function find_cache_extent. Remove it. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- extent-cache.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extent-cache.c b/extent-cache.c index 3dd6434..6d86c33 100644 --- a/extent-cache.c +++ b

[PATCH] btrfs-progs: fix the comment for extent_io.c/clear_extent_bits

2013-06-24 Thread Wang Sheng-Hui
It should be 'clear', not 'set'. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- extent_io.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extent_io.c b/extent_io.c index 5093aeb..8f51250 100644 --- a/extent_io.c +++ b/extent_io.c @@ -197,7 +197,7 @@ static int

[PATCH] xfstests: add 'check -btrfs' support

2013-06-19 Thread Wang Sheng-Hui
Currently we can specify the testing filesytems like 'check -xfs', but btrfs is not support in this kind of command option. Add the option 'check -btrfs' support. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- check |2 ++ 1 file changed, 2 insertions(+) diff --git a/check b/check

[PATCH] Btrfs: fix the comment typo for btrfs_attach_transaction_barrier

2013-06-14 Thread Wang Sheng-Hui
The comment is for btrfs_attach_transaction_barrier, not for btrfs_attach_transaction. Fix the typo. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index

Re: [PATCH] xfstests 276: use _require_no_large_scratch_dev instead of the removed _require_nobigloopfs

2013-03-24 Thread Wang Sheng-Hui
On 2013年03月21日 14:13, Wang Sheng-Hui wrote: _require_nobigloopfs has been removed. We should use _require_no_large_scratch_dev in the test script. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- 276 |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/276 b/276 index

[PATCH] xfstests 276: use _require_no_large_scratch_dev instead of the removed _require_nobigloopfs

2013-03-21 Thread Wang Sheng-Hui
_require_nobigloopfs has been removed. We should use _require_no_large_scratch_dev in the test script. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- 276 |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/276 b/276 index 40b30cf..87363ca 100755 --- a/276 +++ b/276

Re: [PATCH] xfstests 276: fix error 'FIBMAP: Invalid argument'

2013-02-27 Thread Wang Sheng-Hui
On 2013年02月28日 07:04, Dave Chinner wrote: On Wed, Feb 27, 2013 at 03:15:16PM +0800, Wang Sheng-Hui wrote: Btrfs doesn't support FIEMAP_FLAG_XATTR, which is enabled by -x option of filefrag, and will fail with 'FIBMAP: Invalid argument' for 'filefrag -vx'. 'filefrag -vx' fails on btrfs

Re: [PATCH] xfstests 276: fix error 'FIBMAP: Invalid argument'

2013-02-27 Thread Wang Sheng-Hui
On 2013年02月28日 08:25, Dave Chinner wrote: On Thu, Feb 28, 2013 at 08:02:52AM +0800, Wang Sheng-Hui wrote: On 2013年02月28日 07:04, Dave Chinner wrote: On Wed, Feb 27, 2013 at 03:15:16PM +0800, Wang Sheng-Hui wrote: Btrfs doesn't support FIEMAP_FLAG_XATTR, which is enabled by -x option

[PATCH] xfstests 276: fix error 'FIBMAP: Invalid argument'

2013-02-26 Thread Wang Sheng-Hui
Btrfs doesn't support FIEMAP_FLAG_XATTR, which is enabled by -x option of filefrag, and will fail with 'FIBMAP: Invalid argument' for 'filefrag -vx'. 'filefrag -vx' fails on btrfs with 'FIEMAP failed with unsupported flags 2' Remove the '-x' option. Signed-off-by: Wang Sheng-Hui shh

[PATCH] Btrfs: cleanup for btrfs_extend_item

2013-01-22 Thread Wang Sheng-Hui
Two cleanups: * The data_size is the new added size, not the new size after extend. Make the description more clear. * The var data_end is not used anymore after the data shift. Remove the useless assignment. Signed-off-by: Wang Sheng-Hui shh...@gmail.com

Re: [PATCH] Btrfs: make sure fs_info is not null before its field is used in __btrfs_panic

2012-12-08 Thread Wang Sheng-Hui
On 2012年12月08日 18:10, Li Zefan wrote: On 2012/12/7 23:42, Wang Sheng-Hui wrote: We should make sure fs_info is not null before we refer to its field. Add simple check here. Why? Is there any caller passing NULL @fs_info to this function? At least for code clean now. In __btrfs_panic, we have

[PATCH] Btrfs: make sure fs_info is not null before its field is used in __btrfs_panic

2012-12-07 Thread Wang Sheng-Hui
We should make sure fs_info is not null before we refer to its field. Add simple check here. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/super.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 915ac14..c6a3633

Re: [PATCH] Btrfs: remove warning check in io_ctl_map_page

2012-11-30 Thread Wang Sheng-Hui
On 2012年11月30日 17:02, Liu Bo wrote: On Fri, Nov 30, 2012 at 02:02:26PM +0800, shh...@gmail.com wrote: From: Wang Sheng-Hui shh...@gmail.com io_ctl_map_page is called by many functions in free-space-cache. In some scenarios, the -cur is not null, e.g. io_ctl_add_entry. Remove the check here

[PATCH] Btrfs: do not warn_on io_ctl-cur in io_ctl_map_page

2012-11-22 Thread Wang Sheng-Hui
io_ctl_map_page is called by many functions in free-space-cache. In most scenarios, the -cur is not null, e.g. io_ctl_add_entry. I think we'd better remove the warn_on here. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/free-space-cache.c |1 - 1 files changed, 0 insertions

[PATCH] btrfs-progs: print the right mount checking info in restore.c

2012-11-19 Thread Wang Sheng-Hui
The mount status is checked against the arg device (argv[optind]), not the directory. Correct the info printed on device mounted. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- restore.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/restore.c b/restore.c index

[PATCH 1/2] btrfs-progs: update options in find-root.c

2012-11-17 Thread Wang Sheng-Hui
Remove the useless option -v and add the option -o in the description of usage. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- find-root.c |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/find-root.c b/find-root.c index c0f38b8..2fb40e5 100644 --- a/find-root.c

[PATCH 2/2] btrfs-progs: rename find-root.c to btrfs-find-root.c

2012-11-17 Thread Wang Sheng-Hui
Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- Makefile |4 +- btrfs-find-root.c | 454 + find-root.c | 454 - 3 files changed, 456 insertions(+), 456 deletions

[PATCH] btrfs-progs: remove unnecessary assignment in btrfs-map-logical.c

2012-11-15 Thread Wang Sheng-Hui
The info_file is set to stdout by default, and we donot need to reassign it to stdout if it's not changed to other values. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- btrfs-map-logical.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/btrfs-map-logical.c b/btrfs

[PATCH 1/2] btrfs-progs: update usage description for debug-tree.c

2012-11-13 Thread Wang Sheng-Hui
There are more options than -e only. Update the description for the usage. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- debug-tree.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/debug-tree.c b/debug-tree.c index 94ffd8e..f6bd5d8 100644 --- a/debug

btrfs-progs: rename debug-tree.c to btrfs-debug-tree.c

2012-11-13 Thread Wang Sheng-Hui
Make the name more clear in Makefile and the usage description of debug-tree.c Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- Makefile |4 +- btrfs-debug-tree.c | 381 debug-tree.c | 381

[PATCH 2/2] btrfs-progs: rename debug-tree.c to btrfs-debug-tree.c

2012-11-13 Thread Wang Sheng-Hui
Make the name more clear in Makefile and the usage description of debug-tree.c Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- Makefile |4 +- btrfs-debug-tree.c | 381 debug-tree.c | 381

[PATCH] btrfs-progs: avoid memory leak in find_and_setup_log_root

2012-10-24 Thread Wang Sheng-Hui
In find_and_setup_log_root, the malloced log_root would be leaked if we have bytenr = 0, which would happen at our mkfs stage. Move the memory allocation after the bytenr check, and add allocation failure check. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- disk-io.c |6 +- 1 files

Re: Questions about mkfs -A option

2012-10-24 Thread Wang Sheng-Hui
. Thanks, Alex. On Wed, Oct 24, 2012 at 2:48 AM, Wang Sheng-Hui shh...@gmail.com wrote: On 2012年10月23日 01:49, Alex Lyakas wrote: Wang, I would say that zeroing is done to prevent from seeing some other superblock (besides btrfs) there. That make sense. Alex. But I still confused

Re: Questions about mkfs -A option

2012-10-23 Thread Wang Sheng-Hui
On 2012年10月23日 01:49, Alex Lyakas wrote: Wang, I would say that zeroing is done to prevent from seeing some other superblock (besides btrfs) there. That make sense. Alex. But I still confused by the -A option? In mkfs, we always write the sb info into BTRFS_SUPER_INFO_OFFSET.

Questions about mkfs -A option

2012-10-17 Thread Wang Sheng-Hui
Hi, I'm reading the mkfs code, and confused by its -A option. From its comments, the value specified by -A should be regarded as the start of the filesystem. But mkfs will always zero some area at the beginning of the first dev, regardless -r specified or not. My question is: Why mkfs zeros the

[PATCH] btrfs-progs: add -V description in print_usage

2012-10-16 Thread Wang Sheng-Hui
mkfs supports the option -V/--version. Add its description to print_usage(). Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- mkfs.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/mkfs.c b/mkfs.c index 47f0c9c..2cc6051 100644 --- a/mkfs.c +++ b/mkfs.c @@ -349,6 +349,7

[PATCH] btrfs-progs: check non-digit character in the size value for mkfs options

2012-10-16 Thread Wang Sheng-Hui
is 40960b. Add check in parse_size to deal with the non-tailing non-digit characters. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- mkfs.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/mkfs.c b/mkfs.c index 2cc6051..11e64d2 100644 --- a/mkfs.c +++ b

[PATCH] Btrfs: remove repeated eb-pages check in, disk-io.c/csum_dirty_buffer

2012-10-08 Thread Wang Sheng-Hui
In csum_dirty_buffer, we first get eb from page-private. Then we check if the page is the first page of eb. Later we check it again. Remove the repeated check here. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/disk-io.c |8 +++- 1 files changed, 3 insertions(+), 5

Re: [PATCH 4/4] Btrfs: tivial cleanup: add space between = and the rest code

2012-09-24 Thread Wang Sheng-Hui
On 2012年09月24日 21:15, David Sterba wrote: On Mon, Sep 24, 2012 at 08:47:33AM +0800, Wang Sheng-Hui wrote: trivial code cleanup. -ret =btrfs_drop_snapshot(root, NULL, 1, 0); +ret = btrfs_drop_snapshot(root, NULL, 1, 0); Sorry but this is too trivial

Re: Btrfs: check range early in map_private_extent_buffer

2012-09-24 Thread Wang Sheng-Hui
On 2012年09月25日 00:17, David Sterba wrote: On Mon, Sep 24, 2012 at 12:38:07PM +0800, Wang Sheng-Hui wrote: Check range early to avoid further check/compute in case of range error. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/extent_io.c | 16 1 files

[PATCH 1/4] Btrfs: cleanup: return the ret value of __btrfs_end_transaction directly in btrfs_end_transaction_

2012-09-23 Thread Wang Sheng-Hui
No need to use specific var to record the return value of __btrfs_end_transaction and check if it is not zero. Just return the result directly as btrfs_end_transaction_dmeta. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/transaction.c | 21 +++-- 1 files changed

[PATCH 2/4] Btrfs: trivial cleanup: setup ret with 0 directly in btrfs_wait_for_commit

2012-09-23 Thread Wang Sheng-Hui
trivial code cleanup. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/transaction.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 8fcc501..469a8b6 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs

[PATCH 3/4] Btrfs: remove unnecessary cur_trans set before goto loop in join_transaction

2012-09-23 Thread Wang Sheng-Hui
In the big loop, cur_trans will be set fs_info-running_transaction before it's used. And after kmem_cache_free it and goto loop, it will be setup again. No need to setup it immediately after freed. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/transaction.c |1 - 1 files

[PATCH 4/4] Btrfs: tivial cleanup: add space between = and the rest code

2012-09-23 Thread Wang Sheng-Hui
trivial code cleanup. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/transaction.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 675d813..3279df2 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs

Btrfs: check range early in map_private_extent_buffer

2012-09-23 Thread Wang Sheng-Hui
Check range early to avoid further check/compute in case of range error. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/extent_io.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 4c87847

[PATCH] Btrfs: small fix the commment for the action flags in delayed-ref.h

2012-09-20 Thread Wang Sheng-Hui
The action has been merged into struct btrfs_delayed_ref_node, and no struct btrfs_delayed_ref is available now. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/delayed-ref.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs

[RESEND][PATCH] Btrfs: small fix the commment for the action flags in delayed-ref.h

2012-09-20 Thread Wang Sheng-Hui
The action field has been merged into struct btrfs_delayed_ref_node, and no struct btrfs_delayed_ref is available now. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/delayed-ref.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/delayed-ref.h b/fs

[PATCH] btrfs: fix disk-io.c/btrfs_read_dev_super with BTRFS_SUPER_MIRROR_MAX to control the loops

2012-09-10 Thread Wang Sheng-Hui
To check the duplicated super blocks, use BTRFS_SUPER_MIRROR_MAX as the loops limit. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/disk-io.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 22e98e0..a431144

[PATCH 1/3] btrfs: remove unnecessary -ENOMEM BUG_ON check in extent-tree.c/exclude_super_stripes

2012-09-06 Thread Wang Sheng-Hui
The memory allocation failure is BUG_ON in add_excluded_extent (following the code path) and btrfs_rmap_block. No need to BUG_ON -ENOMEM inside exclude_super_stripes itself. Its return value is always 0, and useless for its callers. Set it as void instead 0-returned. Signed-off-by: Wang Sheng

[PATCH 2/3] btrfs: remove unnecessary -ENOMEM BUG_ON check in extent-tree.c/btrfs_alloc_logged_file_extent

2012-09-06 Thread Wang Sheng-Hui
The memory allocation failure is BUG_ON in add_excluded_extent (following the code path). No need to BUG_ON -ENOMEM inside btrfs_alloc_logged_file_extent. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/extent-tree.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions

PATCH 3/3] btrfs: set extent-tree.c/add_excluded_extent as void

2012-09-06 Thread Wang Sheng-Hui
The memory allocation failure will be catched in set_extent_bits. Always return 0 is useless for its callers. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/extent-tree.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs

Re: [PATCH 1/3] btrfs: remove unnecessary -ENOMEM BUG_ON check in extent-tree.c/exclude_super_stripes

2012-09-06 Thread Wang Sheng-Hui
On 2012年09月06日 18:09, David Sterba wrote: On Thu, Sep 06, 2012 at 02:40:41PM +0800, Wang Sheng-Hui wrote: The memory allocation failure is BUG_ON in add_excluded_extent (following the code path) and btrfs_rmap_block. No need to BUG_ON -ENOMEM inside exclude_super_stripes itself. No please

[PATCH] btrfs-progs: add malloc check in transaction.h/btrfs_start_transaction

2012-08-16 Thread Wang Sheng-Hui
For malloc may fail, we should check it before assign values to the fields of struct btrfs_trans_handle *h. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- transaction.h |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/transaction.h b/transaction.h index a1070e0

Re: [PATCH] btrfs-progs: add malloc check in transaction.h/btrfs_start_transaction

2012-08-16 Thread Wang Sheng-Hui
On 2012年08月16日 16:55, Jie Liu wrote: On 08/16/12 16:03, Arne Jansen wrote: On 16.08.2012 09:57, Wang Sheng-Hui wrote: For malloc may fail, we should check it before assign values to the fields of struct btrfs_trans_handle *h. Signed-off-by: Wang Sheng-Hui shh...@gmail.com

[PATCH] btrfs-progs: trivial code style fix in root-tree.c

2012-08-16 Thread Wang Sheng-Hui
Add code indent to the bad styled statements. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- root-tree.c | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/root-tree.c b/root-tree.c index 782472c..39cfef6 100644 --- a/root-tree.c +++ b/root-tree.c @@ -182,12

Re: [PATCH] btrfs-progs: trivial code style fix in root-tree.c

2012-08-16 Thread Wang Sheng-Hui
On 2012年08月16日 21:23, Arne Jansen wrote: On 16.08.2012 15:17, Wang Sheng-Hui wrote: Add code indent to the bad styled statements. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- root-tree.c | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/root-tree.c b

Re: [PATCH] btrfs-progs: trivial code style fix in root-tree.c

2012-08-16 Thread Wang Sheng-Hui
On 2012年08月16日 21:30, Arne Jansen wrote: On 16.08.2012 15:26, Wang Sheng-Hui wrote: On 2012年08月16日 21:23, Arne Jansen wrote: On 16.08.2012 15:17, Wang Sheng-Hui wrote: Add code indent to the bad styled statements. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- root-tree.c | 10

[PATCH] btrfs: fix trivial typo for the comment of BTRFS_FREE_INO_OBJECTID

2012-08-16 Thread Wang Sheng-Hui
It should be storing. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/ctree.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 4bab807..f9289db 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -116,7 +116,7

[PATCH] btrfs-progs: fix trivial typo for the comment of BTRFS_FREE_INO_OBJECTID

2012-08-16 Thread Wang Sheng-Hui
It should be storing. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- ctree.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ctree.h b/ctree.h index d218b88..8f3cd7e 100644 --- a/ctree.h +++ b/ctree.h @@ -86,7 +86,7 @@ struct btrfs_trans_handle; #define

Re: [PATCH] btrfs: fix trivial typo for the comment of BTRFS_FREE_INO_OBJECTID

2012-08-16 Thread Wang Sheng-Hui
On 2012年08月16日 23:18, Liu Bo wrote: On 08/16/2012 10:53 PM, Wang Sheng-Hui wrote: It should be storing. Please cc these typo fixes to triv...@kernel.org. thanks, liubo OK. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/ctree.h |2 +- 1 files changed, 1

[PATCH] btrfs-progs: correct the comment for extent_io.c/clear_extent_bits

2012-08-14 Thread Wang Sheng-Hui
It should be clear instead of set for clear_extent_bits. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- extent_io.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/extent_io.c b/extent_io.c index ebb35b2..638ee0e 100644 --- a/extent_io.c +++ b/extent_io.c @@ -195,7

[PATCH] btrfs-progs: remove redundant value set to path-reada in ctree.c/btrfs_alloc_path

2012-08-13 Thread Wang Sheng-Hui
btrfs_init_path has init the path to 0s. No need to set -reada 0 after path init. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- ctree.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ctree.c b/ctree.c index 2d86b1e..a04e0da 100644 --- a/ctree.c +++ b/ctree.c

[PATCH] btrfs-progs: remove redundant value set to path-reada in ctree.c/btrfs_alloc_path

2012-08-13 Thread Wang Sheng-Hui
btrfs_init_path has init the path to 0s. No need to set -reada 0 after path init. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- ctree.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ctree.c b/ctree.c index 2d86b1e..a04e0da 100644 --- a/ctree.c +++ b/ctree.c

[PATCH 1/4 RESEND] Btrfs: remove the useless assignment to *entry in function tree_insert of file extent_io.c

2012-04-06 Thread Wang Sheng-Hui
In tree_insert, var *entry is used in the loop only, and is useless out of the loop. Remove the useless assignment after the loop. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/extent_io.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/extent_io.c

[PATCH 2/4 RESEND] Btrfs: cleanup the comment for clear_state_bit in extent_io.c

2012-04-06 Thread Wang Sheng-Hui
No 'delete' arg is used for clear_state_bit. Cleanup the comment. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/extent_io.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 7b679e2..5505356 100644 --- a/fs

[PATCH 3/4 RESEND] Btrfs: fix btrfs_release_extent_buffer_page with the right usage of num_extent_pages

2012-04-06 Thread Wang Sheng-Hui
num_extent_pages returns the number of pages in the specific range, not the index of the last page in the eb range. btrfs_release_extent_buffer_page is called with start_idx set 0 in current codes, so it's not a problem yet. But the logic is indeed wrong. Fix it here. Signed-off-by: Wang Sheng

[PATCH 4/4] Btrfs: fix the comment for find_first_extent_bit

2012-04-06 Thread Wang Sheng-Hui
The return value of find_first_extent_bit is 1 or 0, no 0. And if found something, return 0; if nothing was found, return 1. Fix the comment. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/extent_io.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs

Re: [PATCH] btrfs/extent_io.c: return -ENOMEM instead of BUG_ON on allocation failure in set_extent_bit if __GFP_WAIT is set in the mask

2012-04-04 Thread Wang Sheng-Hui
On 2012年04月04日 21:29, Jeff Mahoney wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/31/2012 03:25 AM, Wang Sheng-Hui wrote: If __GFP_WAIT is set in the mask, set_extent_bit should return -ENOMEM to its caller to decide what to do on allocation failure, instead of BUG_ON

[PATCH] btrfs/extent_io.c: fix btrfs_release_extent_buffer_page with the right usage of num_extent_pages

2012-04-01 Thread Wang Sheng-Hui
-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/extent_io.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 6099261..941f0ea 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3976,11 +3976,13 @@ static void

[PATCH] btrfs/extent_io.c: cleanup the comment for clear_state_bit

2012-03-31 Thread Wang Sheng-Hui
No 'delete' arg is used for clear_state_bit anymore. Cleanup the comment. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/extent_io.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 2862454..b67814c 100644

[PATCH] btrfs/extent_io.c: return -ENOMEM instead of BUG_ON on allocation failure in set_extent_bit if __GFP_WAIT is set in the mask

2012-03-31 Thread Wang Sheng-Hui
If __GFP_WAIT is set in the mask, set_extent_bit should return -ENOMEM to its caller to decide what to do on allocation failure, instead of BUG_ON. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/extent_io.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git

[PATCH] btrfs/extent_io.c: remove the useless assignment to entry in tree_insert

2012-03-31 Thread Wang Sheng-Hui
In tree_insert, entry is used in the loop only, and is useless out of the loop. Remove the useless assignment after the loop. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/extent_io.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs

[PATCH] btrfs/ctree.c: remove the unnecessary 'return -1;' at the end of bin_search

2012-03-30 Thread Wang Sheng-Hui
The code path should not reach there. Remove it. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/ctree.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 0639a55..c1be2da 100644 --- a/fs/btrfs/ctree.c +++ b/fs

[PATCH] btrfs/async-thread: introduce macro BTRFS_WORKERS_IDLE_THRESH to replace the magic number 32 used for btrfs_workers-idle_thresh

2012-03-19 Thread Wang Sheng-Hui
Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/async-thread.c |2 +- fs/btrfs/async-thread.h |8 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c index 5a7d756..2491096 100644 --- a/fs/btrfs/async

[PATCH] btrfs/async-thread.c: decrease workers-num_workers only on worker can be freed in btrfs_stop_workers

2012-03-15 Thread Wang Sheng-Hui
If the worker cannot be freed, decrease workers-num_workers can corrupt the statistics. The workers-num_workers should be decreased only when the worker can be stopped and freed in btrfs_stop_workers. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/async-thread.c |2 +- 1 files

[PATCH] btrfs/ctree.h: trivial fixup the comment for struct btrfs_dev_extent with the right fields' names

2012-03-13 Thread Wang Sheng-Hui
Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/ctree.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 80b6486..a515e4e 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -597,9 +597,9 @@ struct

[PATCH] btrfs/locking.c: minor fix on the comment for btrfs_try_tree_write_lock

2012-03-07 Thread Wang Sheng-Hui
btrfs_try_tree_write_lock is used for write lock, not for read lock. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/btrfs/locking.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c index 5e178d8..4e4705c 100644 --- a/fs

[PATCH] btrfs-progs: cleanup: remove the redundant BTRFS_CSUM_TYPE_CRC32 macro definition in ctree.h

2012-03-04 Thread Wang Sheng-Hui
Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- ctree.h |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/ctree.h b/ctree.h index 54748c8..1b17577 100644 --- a/ctree.h +++ b/ctree.h @@ -118,10 +118,6 @@ struct btrfs_trans_handle; /* csum types */ #define

Re: [PATCH 3.0-rc7] btrfs: Update git repository links for btrfs utilities in Documentation/filesystems/btrfs.txt

2011-07-18 Thread Wang Sheng-Hui
On 2011年07月18日 14:06, Wanlong Gao wrote: On 07/18/2011 12:53 PM, Wang Sheng-Hui wrote: The patch is against 3.0-rc7 kernel. From d22497ac8c5dd55a2ef9a47de5f2ddee55f8ec50 Mon Sep 17 00:00:00 2001 From: Wang Sheng-Huishh...@gmail.com Date: Sun, 17 Jul 2011 21:45:01 -0500 Subject: [PATCH 3.0

[PATCH] btrfs-progs-unstable: replace debug-tree to btrfs-debug-tree in INSTALL

2011-07-18 Thread Wang Sheng-Hui
From c04da1655df6d75db834ddbd3a3b4a58a0d9a0c9 Mon Sep 17 00:00:00 2001 From: Wang Sheng-Hui shh...@gmail.com Date: Mon, 18 Jul 2011 02:17:31 -0500 Subject: [PATCH] btrfs-progs-unstable: replace debug-tree to btrfs-debug-tree in INSTALL debug-tree doesn't exist after btrfs-progs installed. Use

[PATCH 3.0-rc7] btrfs: Update git repository links for btrfs utilities in Documentation/filesystems/btrfs.txt

2011-07-17 Thread Wang Sheng-Hui
The patch is against 3.0-rc7 kernel. From d22497ac8c5dd55a2ef9a47de5f2ddee55f8ec50 Mon Sep 17 00:00:00 2001 From: Wang Sheng-Hui shh...@gmail.com Date: Sun, 17 Jul 2011 21:45:01 -0500 Subject: [PATCH 3.0-rc7] btrfs: Update git repository links for btrfs utilities in Documentation/filesystems