give scsi_allocate_request a gfp_mask
Subsystems (3)
PATCH 1/1 give scsi_allocate_request a gfp_mask
most callers really want GFP_KERNEL, not GFP_ATOMIC.
drivers/scsi/cpqfcTSinit.c +1 -1
@@ -603,7 +603,7 @@return -ENOMEM ; }// Now build a Scsi_Request to pass down... - ScsiPassThruReq =scsi_allocate_request (ScsiDev); + ScsiPassThruReq =scsi_allocate_request (ScsiDev,GFP_KERNEL );if (ScsiPassThruReq ==NULL ) {kfree (buf);return -ENOMEM ;
drivers/scsi/gdth.c +6 -6
@@ -4990,7 +4990,7 @@ cmd.u.cache.DeviceNo = res.number;#if LINUX_VERSION_CODE >=0x020503 sdev =scsi_get_host_dev (gdth_ctr_tab[hanum]); - srp =scsi_allocate_request (sdev); + srp =scsi_allocate_request (sdev,GFP_KERNEL );if (!srp)return -ENOMEM ; srp->sr_cmd_len =12 ;
@@ -5091,7 +5091,7 @@#if LINUX_VERSION_CODE >=0x020503 sdev =scsi_get_host_dev (gdth_ctr_tab[hanum]); - srp =scsi_allocate_request (sdev); + srp =scsi_allocate_request (sdev,GFP_KERNEL );if (!srp)return -ENOMEM ; srp->sr_cmd_len =12 ;
@@ -5164,7 +5164,7 @@#if LINUX_VERSION_CODE >=0x020503 sdev =scsi_get_host_dev (gdth_ctr_tab[hanum]); - srp =scsi_allocate_request (sdev); + srp =scsi_allocate_request (sdev,GFP_KERNEL );if (!srp)return -ENOMEM ; srp->sr_cmd_len =12 ;
@@ -5253,7 +5253,7 @@#if LINUX_VERSION_CODE >=0x020503 sdev =scsi_get_host_dev (gdth_ctr_tab[hanum]); - srp =scsi_allocate_request (sdev); + srp =scsi_allocate_request (sdev,GFP_KERNEL );if (!srp)return -ENOMEM ; srp->sr_cmd_len =12 ;
@@ -5631,7 +5631,7 @@#if LINUX_VERSION_CODE >=0x020503 sdev =scsi_get_host_dev (gdth_ctr_tab[hanum]); - srp =scsi_allocate_request (sdev); + srp =scsi_allocate_request (sdev,GFP_KERNEL );if (!srp)return ; srp->sr_cmd_len =12 ;
@@ -5727,7 +5727,7 @@TRACE2 (("gdth_halt(): reset controller %d\n" , hanum));#if LINUX_VERSION_CODE >=0x020503 sdev =scsi_get_host_dev (gdth_ctr_tab[hanum]); - srp =scsi_allocate_request (sdev); + srp =scsi_allocate_request (sdev,GFP_KERNEL );if (!srp) {#if LINUX_VERSION_CODE >=0x020100 unregister_reboot_notifier (&gdth_notifier);
drivers/scsi/gdth_proc.c +2 -2
@@ -44,7 +44,7 @@#if LINUX_VERSION_CODE >=0x020503 sdev =scsi_get_host_dev (gdth_ctr_tab[hanum]); - scp =scsi_allocate_request (sdev); + scp =scsi_allocate_request (sdev,GFP_KERNEL );if (!scp)return -ENOMEM ; scp->sr_cmd_len =12 ;
@@ -797,7 +797,7 @@#if LINUX_VERSION_CODE >=0x020503 sdev =scsi_get_host_dev (gdth_ctr_tab[hanum]); - scp =scsi_allocate_request (sdev); + scp =scsi_allocate_request (sdev,GFP_KERNEL );if (!scp)return -ENOMEM ; scp->sr_cmd_len =12 ;
drivers/scsi/osst.c +1 -1
@@ -316,7 +316,7 @@static int repeat =0 ;#endif if (SRpnt ==NULL ) { -if ((SRpnt =scsi_allocate_request (STp->device)) ==NULL ) { +if ((SRpnt =scsi_allocate_request (STp->device,GFP_ATOMIC )) ==NULL ) {printk (KERN_ERR "%s:E: Can't get SCSI request.\n" ,tape_name (STp));if (signal_pending (current)) (STp->buffer)->syscall_result = (-EINTR );
drivers/scsi/scsi.c +5 -10
@@ -113,26 +113,21 @@* * Purpose: Allocate a request descriptor. * -* Arguments: device - device for which we want a request +* Arguments: device - device for which we want a request +* gfp_mask - allocation flags passed to kmalloc * * Lock status: No locks assumed to be held. This function is SMP-safe. * * Returns: Pointer to request block. -* -* Notes: With the new queueing code, it becomes important -* to track the difference between a command and a -* request. A request is a pending item in the queue that -* has not yet reached the top of the queue. -* -* XXX(hch): Need to add a gfp_mask argument. */ -struct scsi_request *scsi_allocate_request (struct scsi_device *sdev) +struct scsi_request *scsi_allocate_request (struct scsi_device *sdev, +int gfp_mask) {const int offset =ALIGN (sizeof (struct scsi_request ),4 );const int size = offset +sizeof (struct request );struct scsi_request *sreq; - sreq =kmalloc (size,GFP_ATOMIC ); + sreq =kmalloc (size, gfp_mask);if (likely (sreq !=NULL )) {memset (sreq,0 , size); sreq->sr_request = (struct request *)(((char *)sreq) + offset);
drivers/scsi/scsi_error.c +1 -1
@@ -1339,7 +1339,7 @@**/ static void scsi_eh_lock_door (struct scsi_device *sdev) { -struct scsi_request *sreq =scsi_allocate_request (sdev); +struct scsi_request *sreq =scsi_allocate_request (sdev,GFP_KERNEL );if (unlikely (!sreq)) { printk(KERN_ERR "%s: request allocate failed,"
drivers/scsi/scsi_ioctl.c +2 -2
@@ -98,7 +98,7 @@SCSI_LOG_IOCTL (1 ,printk ("Trying ioctl with scsi command %d\n" , *cmd)); - sreq =scsi_allocate_request (sdev); + sreq =scsi_allocate_request (sdev,GFP_KERNEL );if (!sreq) {printk ("SCSI internal ioctl failed, no memory\n" );return -ENOMEM ;
@@ -321,7 +321,7 @@break ; } - sreq =scsi_allocate_request (sdev); + sreq =scsi_allocate_request (sdev,GFP_KERNEL );if (!sreq) { result = -EINTR ; goto error;
drivers/scsi/scsi_lib.c +1 -1
@@ -1454,7 +1454,7 @@ unsigned char *buffer, int len, int timeout, int retries, struct scsi_mode_data *data) { - struct scsi_request *sreq = scsi_allocate_request(sdev); + struct scsi_request *sreq = scsi_allocate_request(sdev, GFP_KERNEL);int ret;if (!sreq)
drivers/scsi/scsi_scan.c +2 -2
@@ -693,7 +693,7 @@ sdev =scsi_alloc_sdev (host, channel, id, lun);if (!sdev) goto out; - sreq =scsi_allocate_request (sdev); + sreq =scsi_allocate_request (sdev,GFP_ATOMIC );if (!sreq) goto out_free_sdev; result = kmalloc(256, GFP_ATOMIC |
@@ -906,7 +906,7 @@if (bflags &BLIST_NOLUN )return 0 ; - sreq =scsi_allocate_request (sdev); + sreq =scsi_allocate_request (sdev,GFP_ATOMIC );if (!sreq) goto out;
drivers/scsi/sd.c +5 -5
@@ -1174,7 +1174,7 @@if (!sdp->online) goto out; - sreq =scsi_allocate_request (sdp); + sreq =scsi_allocate_request (sdp,GFP_KERNEL );if (!sreq) {printk (KERN_WARNING "(sd_revalidate_disk:) Request allocation " "failure.\n" );
@@ -1355,12 +1355,12 @@static void sd_shutdown (struct device *dev) {struct scsi_device *sdp =to_scsi_device (dev); -struct scsi_disk *sdkp; +struct scsi_disk *sdkp;struct scsi_request *sreq;int retries, res; - sdkp =dev_get_drvdata (dev); -if (!sdkp) + sdkp =dev_get_drvdata (dev); +if (!sdkp)return ;/* this can happen */ if (!sdp->online || !sdkp->WCE)
@@ -1369,7 +1369,7 @@printk (KERN_NOTICE "Synchronizing SCSI cache for disk %s: " , sdkp->disk->disk_name); - sreq =scsi_allocate_request (sdp); + sreq =scsi_allocate_request (sdp,GFP_KERNEL );if (!sreq) {printk ("FAILED\n No memory for request\n" );return ;
drivers/scsi/sg.c +1 -1
@@ -680,7 +680,7 @@sg_finish_rem_req (srp);return -ENODEV ; } - SRpnt =scsi_allocate_request (sdp->device); + SRpnt =scsi_allocate_request (sdp->device,GFP_ATOMIC );if (SRpnt ==NULL ) {SCSI_LOG_TIMEOUT (1 ,printk ("sg_write: no mem\n" ));sg_finish_rem_req (srp);
drivers/scsi/sr.c +1 -1
@@ -599,7 +599,7 @@ buffer =kmalloc (512 ,GFP_KERNEL |GFP_DMA );if (!buffer) goto Enomem; - SRpnt =scsi_allocate_request (cd->device); + SRpnt =scsi_allocate_request (cd->device,GFP_KERNEL );if (!SRpnt) goto Enomem;
drivers/scsi/sr_ioctl.c +1 -1
@@ -82,7 +82,7 @@int result, err =0 , retries =0 ; SDev = cd->device; - SRpnt =scsi_allocate_request (SDev); + SRpnt =scsi_allocate_request (SDev,GFP_KERNEL );if (!SRpnt) {printk (KERN_ERR "Unable to allocate SCSI request in sr_do_ioctl" ); err = -ENOMEM ;
drivers/scsi/st.c +1 -1
@@ -374,7 +374,7 @@unsigned char *bp;if (SRpnt ==NULL ) { - SRpnt =scsi_allocate_request (STp->device); + SRpnt =scsi_allocate_request (STp->device,GFP_ATOMIC );if (SRpnt ==NULL ) {DEBC (printk (KERN_ERR "%s: Can't get SCSI request.\n" , tape_name(STp)); );
include/scsi/scsi_request.h +1 -1
@@ -45,7 +45,7 @@level driver) of this request */ }; -extern struct scsi_request *scsi_allocate_request (struct scsi_device *); +extern struct scsi_request *scsi_allocate_request (struct scsi_device *,int );extern void scsi_release_request (struct scsi_request *); extern void scsi_wait_req(struct scsi_request *, const void *cmnd, void *buffer, unsigned bufflen,