[1/3] btrfs: remove unnecessary hash_init()
diff mbox series

Message ID 20191005051736.29857-1-cgxu519@mykernel.net
State New
Headers show
Series
  • [1/3] btrfs: remove unnecessary hash_init()
Related show

Commit Message

Chengguang Xu Oct. 5, 2019, 5:17 a.m. UTC
hash_init() is not necessary in btrfs_props_init(),
so remove it.

Signed-off-by: Chengguang Xu <cgxu519@mykernel.net>
---
 fs/btrfs/props.c | 2 --
 1 file changed, 2 deletions(-)

Comments

David Sterba Oct. 7, 2019, 3:44 p.m. UTC | #1
On Sat, Oct 05, 2019 at 01:17:34PM +0800, Chengguang Xu wrote:
> hash_init() is not necessary in btrfs_props_init(),
> so remove it.

The part that explains why it's not necessary is missing in the
changelo. And looking what hash_init and plain DEFINE_HASHTABLE does I
don't think that removing hash_init is safe or making the code more
clear.
Chengguang Xu Oct. 8, 2019, 2:56 a.m. UTC | #2
---- 在 星期一, 2019-10-07 23:44:45 David Sterba <dsterba@suse.cz> 撰写 ----
 > On Sat, Oct 05, 2019 at 01:17:34PM +0800, Chengguang Xu wrote:
 > > hash_init() is not necessary in btrfs_props_init(),
 > > so remove it.
 > 
 > The part that explains why it's not necessary is missing in the
 > changelo. And looking what hash_init and plain DEFINE_HASHTABLE does I
 > don't think that removing hash_init is safe or making the code more
 > clear.
 
Sorry for pool explanation in change log.

Look into the code,  DEFINE_HASHTABLE has already included initialization code in it and
I think this is the main difference compare to DECLARE_HASHTABLE which still needs hash_init.


Thanks,
Chengguang

Patch
diff mbox series

diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c
index 1e664e0b59b8..68508db3dc65 100644
--- a/fs/btrfs/props.c
+++ b/fs/btrfs/props.c
@@ -437,8 +437,6 @@  void __init btrfs_props_init(void)
 {
 	int i;
 
-	hash_init(prop_handlers_ht);
-
 	for (i = 0; i < ARRAY_SIZE(prop_handlers); i++) {
 		struct prop_handler *p = &prop_handlers[i];
 		u64 h = btrfs_name_hash(p->xattr_name, strlen(p->xattr_name));