Re: [PATCH v5 16/23] sg: rework sg_vma_fault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/8/19 9:50 AM, Douglas Gilbert wrote:
> Simple refactoring of the sg_vma_fault() function.
> 
> Signed-off-by: Douglas Gilbert <dgilbert@xxxxxxxxxxxx>
> ---
>  drivers/scsi/sg.c | 33 +++++++++++++++++++++++----------
>  1 file changed, 23 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index 903faafaeff9..befcbfbcece1 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -1389,14 +1389,16 @@ sg_fasync(int fd, struct file *filp, int mode)
>  	return fasync_helper(fd, filp, mode, &sfp->async_qp);
>  }
>  
> +/* Note: the error return: VM_FAULT_SIGBUS causes a "bus error" */
>  static vm_fault_t
>  sg_vma_fault(struct vm_fault *vmf)
>  {
> -	struct vm_area_struct *vma = vmf->vma;
> -	struct sg_fd *sfp;
> +	int k, length;
>  	unsigned long offset, len, sa;
> +	struct vm_area_struct *vma = vmf->vma;
>  	struct sg_scatter_hold *rsv_schp;
> -	int k, length;
> +	struct sg_device *sdp;
> +	struct sg_fd *sfp;
>  	const char *nbp = "==NULL, bad";
>  
>  	if (!vma) {
Of course, one would prefer normal kernel-doc style for the comment ...

Otherwise:
Reviewed-by: Hannes Reinecke <hare@xxxxxxxx>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      Teamlead Storage & Networking
hare@xxxxxxx			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 247165 (AG München), GF: Felix Imendörffer



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux