[Devel] [PATCH 11/15] fs/fuse kio: remove useless pcs_cs initialization

Pavel Butsykin pbutsykin at virtuozzo.com
Fri May 17 16:20:44 MSK 2019


It's not necessary to initialize cs data with zeros if the allocation is done
by kzalloc().

Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_cs.c | 22 +---------------------
 1 file changed, 1 insertion(+), 21 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_cs.c b/fs/fuse/kio/pcs/pcs_cs.c
index 48e3b3cedc4e..28dfc10246de 100644
--- a/fs/fuse/kio/pcs/pcs_cs.c
+++ b/fs/fuse/kio/pcs/pcs_cs.c
@@ -59,44 +59,24 @@ struct pcs_cs *pcs_cs_alloc(struct pcs_cs_set *css,
 	INIT_LIST_HEAD(&cs->lru_link);
 	spin_lock_init(&cs->lock);
 	cs->css = css;
-	cs->in_flight = 0;
 	cs->cwnd = PCS_CS_INIT_CWND;
 	cs->eff_cwnd = PCS_CS_INIT_CWND;
-	cs->cwr_state = 0;
-	atomic_set(&cs->latency_avg, 0);
-	cs->net_latency_avg = 0;
-	cs->last_latency = 0;
-	cs->latency_stamp = 0;
-	cs->net_latency_stamp = 0;
-	cs->idle_stamp = 0;
-	cs->in_flight_hwm = 0;
-	cs->in_flight_hwm_stamp = 0;
+
 	pcs_cs_init_cong_queue(cs);
 	pcs_cs_init_active_list(cs);
 
 	cs->io_prio = -1;
-	cs->mds_flags = 0;
-	cs->io_prio_stamp = 0;
 
 	INIT_LIST_HEAD(&cs->flow_lru);
-	cs->nflows = 0;
-
-	cs->state = 0;
-	cs->use_count = 0;
-	cs->is_dead = 0;
 	INIT_LIST_HEAD(&cs->bl_link);
 
-	cs->addr_serno = 0;
-
 	cs->rpc = pcs_rpc_create(&cc->eng, &cn_rpc_params, &cn_rpc_ops);
 	if (cs->rpc == NULL) {
 		kfree(cs);
 		return NULL;
 	}
 	cs->rpc->private = cs;
-	cs->nmaps = 0;
 	INIT_LIST_HEAD(&cs->map_list);
-	memset(&cs->stat, 0, sizeof(cs->stat));
 	return cs;
 }
 
-- 
2.15.1



More information about the Devel mailing list