• F
    scsi: Optimize scsi_req_alloc · 61e68b3f
    Fam Zheng 提交于
    Zeroing sense buffer for each scsi request is not efficient, we can just
    leave it uninitialized because sense_len is set to 0.
    
    Move the implicitly zeroed fields to the end of the structure and use a
    partial memset.
    
    The explicitly initialized fields (by scsi_req_alloc or scsi_req_new)
    are moved to the beginning of the structure, before sense buffer, to
    skip the memset.
    
    Also change g_malloc0 to g_slice_alloc.
    Signed-off-by: NFam Zheng <famz@redhat.com>
    Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
    61e68b3f
scsi-bus.c 56.9 KB