Re: [PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h

2016-11-11 Thread Wang Sheng-Hui
Thanks! Regards, Wang Sheng-Hui -- Original -- From: "Bjorn Helgaas";<helg...@kernel.org>; Date: Sat, Nov 12, 2016 04:51 AM To: "Wang Sheng-Hui"<shh...@foxmail.com>; Cc: "yu.zhao"<yu.z...@intel.com>; "

Re: [PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h

2016-11-11 Thread Wang Sheng-Hui
Thanks! Regards, Wang Sheng-Hui -- Original -- From: "Bjorn Helgaas";; Date: Sat, Nov 12, 2016 04:51 AM To: "Wang Sheng-Hui"; Cc: "yu.zhao"; "jbarnes"; "alex.williamson"; "bhelgaas"; "linux-p

[PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h

2016-09-21 Thread Wang Sheng-Hui
This is a cleanup that moves PCI configuration space size macros (PCI_CFG_SPACE_SIZE and PCI_CFG_SPACE_EXP_SIZE) from drivers/pci/pci.h to include/uapi/linux/pci_regs.h So that the macros can be used by more drivers and eliminate potential duplicate definition. Signed-off-by: Wang Sheng-Hui <

[PATCH] PCI: move cfg space size (256/4096) macros to pci_regs.h

2016-09-21 Thread Wang Sheng-Hui
This is a cleanup that moves PCI configuration space size macros (PCI_CFG_SPACE_SIZE and PCI_CFG_SPACE_EXP_SIZE) from drivers/pci/pci.h to include/uapi/linux/pci_regs.h So that the macros can be used by more drivers and eliminate potential duplicate definition. Signed-off-by: Wang Sheng-Hui

[PATCH] mm: update the description for madvise_remove

2014-06-23 Thread Wang Sheng-Hui
Currently, we have more filesystems supporting fallocate, e.g ext4/btrfs. Remove the outdated comment for madvise_remove. Signed-off-by: Wang Sheng-Hui --- mm/madvise.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/madvise.c b/mm/madvise.c index a402f8f..0938b30 100644 --- a/mm

[PATCH] mm: update the description for madvise_remove

2014-06-23 Thread Wang Sheng-Hui
Currently, we have more filesystems supporting fallocate, e.g ext4/btrfs. Remove the outdated comment for madvise_remove. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- mm/madvise.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/mm/madvise.c b/mm/madvise.c index a402f8f..0938b30

[PATCH] tile: add null check for kzalloc in tile/kernel/setup.c

2013-08-21 Thread Wang Sheng-Hui
Should check the return value of kzalloc first to avoid the null pointer. Then can dereference the non-null pointer to access the fields of struct resource. Signed-off-by: Wang Sheng-Hui --- arch/tile/kernel/setup.c |4 1 file changed, 4 insertions(+) diff --git a/arch/tile/kernel

[PATCH] tile: add null check for kzalloc in tile/kernel/setup.c

2013-08-21 Thread Wang Sheng-Hui
Should check the return value of kzalloc first to avoid the null pointer. Then can dereference the non-null pointer to access the fields of struct resource. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- arch/tile/kernel/setup.c |4 1 file changed, 4 insertions(+) diff --git

[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 --- fs/btrfs/free-space-cache.c |1 - 1 files changed, 0 insertions(+), 1 deleti

[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: 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 --- fs/btrfs/disk-io.c |8 +++- 1 files changed, 3 insertions(+), 5 deletions(-) d

[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: 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 >> --- >> fs/btrfs/extent_i

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

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 --- 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..9250cf5 100644

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 --- fs/btrfs/delayed-ref.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h

[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

[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 --- 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 100644 --- a/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] vfs: correct comment for fs/fs-writeback.c/move_expired_inodes

2012-09-08 Thread Wang Sheng-Hui
The function scans @delaying_queue and stops at the first inode whose dirtied_when is after *work->older_than_this. So the expired ones being moved are those before *work->older_than_this. Correct the comment here. Signed-off-by: Wang Sheng-Hui --- fs/fs-writeback.c |2 +- 1 files c

[PATCH] vfs: correct comment for fs/fs-writeback.c/move_expired_inodes

2012-09-08 Thread Wang Sheng-Hui
The function scans @delaying_queue and stops at the first inode whose dirtied_when is after *work-older_than_this. So the expired ones being moved are those before *work-older_than_this. Correct the comment here. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/fs-writeback.c |2 +- 1

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

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 --- fs/btrfs/extent-tree.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index

[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 --- fs/btrfs/extent-tree.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs

[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 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] ext4: change the debug description in ext4_mb_cleanup_pa

2012-08-20 Thread Wang Sheng-Hui
The count records the PAs freed, not left. Change the debug description. Signed-off-by: Wang Sheng-Hui --- fs/ext4/mballoc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 8eae947..f83b145 100644 --- a/fs/ext4/mballoc.c

[PATCH] ext4: change the debug description in ext4_mb_cleanup_pa

2012-08-20 Thread Wang Sheng-Hui
The count records the PAs freed, not left. Change the debug description. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/ext4/mballoc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 8eae947..f83b145 100644 --- a/fs

[PATCH] ext4: remove redundant offset check in move_extents.c/mext_check_arguments

2012-07-23 Thread Wang Sheng-Hui
In the check code above, if orig_start != donor_start, we would return -EINVAL. So here, orig_start should be equal with donor_start. Remove the redundant check here. Signed-off-by: Wang Sheng-Hui --- fs/ext4/move_extent.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git

[PATCH] ext4: remove redundant offset check in move_extents.c/mext_check_arguments

2012-07-23 Thread Wang Sheng-Hui
In the check code above, if orig_start != donor_start, we would return -EINVAL. So here, orig_start should be equal with donor_start. Remove the redundant check here. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/ext4/move_extent.c |1 - 1 files changed, 0 insertions(+), 1 deletions

[PATCH] ext4: fix trivial typo in the comment for extents.c/ext4_split_unwritten_extents

2012-07-14 Thread Wang Sheng-Hui
Put the sign '/' to the right position. Signed-off-by: Wang Sheng-Hui --- fs/ext4/extents.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 7f6fb48..f394e0f 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -3241,7

[PATCH] ext4: fix trivial typo in the comment for extents.c/ext4_split_unwritten_extents

2012-07-14 Thread Wang Sheng-Hui
Put the sign '/' to the right position. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/ext4/extents.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 7f6fb48..f394e0f 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4

[PATCH] fs/ioctl.c: set local var past_eof to true instead of integer 1 in __generic_block_fiemap

2012-07-11 Thread Wang Sheng-Hui
In function __generic_block_fiemap, local var past_eof is declared as bool, so use 'true' instead of number 1 here. Signed-off-by: Wang Sheng-Hui --- fs/ioctl.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ioctl.c b/fs/ioctl.c index 29167be..e42abb0 100644

[PATCH] fs/ioctl.c: set local var past_eof to true instead of integer 1 in __generic_block_fiemap

2012-07-11 Thread Wang Sheng-Hui
In function __generic_block_fiemap, local var past_eof is declared as bool, so use 'true' instead of number 1 here. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/ioctl.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ioctl.c b/fs/ioctl.c index 29167be

Re: [PATCH 1/2] ext4: fix the comment in ext4_ext_insert_extent for ext4_ext_try_to_merge in extents.c

2012-07-08 Thread Wang Sheng-Hui
Fri, Jul 6, 2012 at 2:26 PM, Wang Sheng-Hui wrote: >> The left and right extents merge is done by >> ext4_ext_try_to_merge. No specific left/right >> fun calls any more. >> >> Signed-off-by: Wang Sheng-Hui >> --- >> fs/ext4/extents.c |4 +--- >>

Re: [PATCH 1/2] ext4: fix the comment in ext4_ext_insert_extent for ext4_ext_try_to_merge in extents.c

2012-07-08 Thread Wang Sheng-Hui
-Hui shh...@gmail.com wrote: The left and right extents merge is done by ext4_ext_try_to_merge. No specific left/right fun calls any more. Signed-off-by: Wang Sheng-Hui shh...@gmail.com --- fs/ext4/extents.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/fs