[Devel] [PATCH RHEL7 COMMIT] fuse kio: Do not zero already zeroed fields in pcs_sockio_init

Konstantin Khorenko khorenko at virtuozzo.com
Wed Sep 26 19:30:47 MSK 2018


The commit is pushed to "branch-rh7-3.10.0-862.11.6.vz7.71.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.11.6.vz7.71.14
------>
commit 2108e03dd5242babe6f6ca888d4c303c48221ebc
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Wed Sep 26 19:30:47 2018 +0300

    fuse kio: Do not zero already zeroed fields in pcs_sockio_init
    
    kzalloc() already zeroes all the memory,
    so we don't have to do this manually.
    
    (pcs_clear_error() call is not removed, since it's
     an external function used everywhere, not only in
     this place. To keep it looks to be more generic way).
    
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    Reviewed-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
---
 fs/fuse/kio/pcs/pcs_sock_io.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/fs/fuse/kio/pcs/pcs_sock_io.c b/fs/fuse/kio/pcs/pcs_sock_io.c
index 0579939f776f..0cf392fb4703 100644
--- a/fs/fuse/kio/pcs/pcs_sock_io.c
+++ b/fs/fuse/kio/pcs/pcs_sock_io.c
@@ -540,16 +540,10 @@ struct pcs_sockio * pcs_sockio_init(struct socket *sock,
 		return NULL;
 
 	INIT_LIST_HEAD(&sio->write_queue);
-	sio->write_queue_len = 0;
-	sio->current_msg = NULL;
 	iov_iter_init_bad(&sio->read_iter);
 	iov_iter_init_bad(&sio->write_iter);
-	sio->read_offset = 0;
-	sio->write_offset = 0;
 	sio->hdr_max = hdr_max;
-	sio->hdr_ptr = 0;
 	sio->flags = sock->sk->sk_family != AF_UNIX ? PCS_SOCK_F_CORK : 0;
-	sio->retrans = 0;
 
 	//// TODO:dmonakhov init ioconn here
 	INIT_LIST_HEAD(&sio->ioconn.list);
@@ -578,9 +572,6 @@ struct pcs_sockio * pcs_sockio_init(struct socket *sock,
 	write_unlock_bh(&sock->sk->sk_callback_lock);
 
 	pcs_clear_error(&sio->error);
-	sio->get_msg = NULL;
-	sio->eof = NULL;
-	sio->write_wakeup = NULL;
 	return sio;
 }
 


More information about the Devel mailing list