Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
8f05b672
Commit
8f05b672
authored
Aug 25, 2003
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] give scsi_allocate_request a gfp_mask
most callers really want GFP_KERNEL, not GFP_ATOMIC.
parent
5c8dc888
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
31 additions
and
36 deletions
+31
-36
drivers/scsi/cpqfcTSinit.c
drivers/scsi/cpqfcTSinit.c
+1
-1
drivers/scsi/gdth.c
drivers/scsi/gdth.c
+6
-6
drivers/scsi/gdth_proc.c
drivers/scsi/gdth_proc.c
+2
-2
drivers/scsi/osst.c
drivers/scsi/osst.c
+1
-1
drivers/scsi/scsi.c
drivers/scsi/scsi.c
+5
-10
drivers/scsi/scsi_error.c
drivers/scsi/scsi_error.c
+1
-1
drivers/scsi/scsi_ioctl.c
drivers/scsi/scsi_ioctl.c
+2
-2
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_lib.c
+1
-1
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_scan.c
+2
-2
drivers/scsi/sd.c
drivers/scsi/sd.c
+5
-5
drivers/scsi/sg.c
drivers/scsi/sg.c
+1
-1
drivers/scsi/sr.c
drivers/scsi/sr.c
+1
-1
drivers/scsi/sr_ioctl.c
drivers/scsi/sr_ioctl.c
+1
-1
drivers/scsi/st.c
drivers/scsi/st.c
+1
-1
include/scsi/scsi_request.h
include/scsi/scsi_request.h
+1
-1
No files found.
drivers/scsi/cpqfcTSinit.c
View file @
8f05b672
...
...
@@ -603,7 +603,7 @@ int cpqfcTS_ioctl( struct scsi_device *ScsiDev, int Cmnd, void *arg)
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
View file @
8f05b672
...
...
@@ -4990,7 +4990,7 @@ static int ioc_resetdrv(unsigned long arg, char *cmnd)
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 @@ static int ioc_general(unsigned long arg, char *cmnd)
#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 @@ static int ioc_hdrlist(unsigned long arg, char *cmnd)
#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 @@ static int ioc_rescan(unsigned long arg, char *cmnd)
#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 @@ static void gdth_flush(int 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
)
return
;
srp
->
sr_cmd_len
=
12
;
...
...
@@ -5727,7 +5727,7 @@ void gdth_halt(void)
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
View file @
8f05b672
...
...
@@ -44,7 +44,7 @@ static int gdth_set_info(char *buffer,int length,int hanum,int busnum)
#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 @@ static int gdth_get_info(char *buffer,char **start,off_t offset,
#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
View file @
8f05b672
...
...
@@ -316,7 +316,7 @@ static Scsi_Request * osst_do_scsi(Scsi_Request *SRpnt, OS_Scsi_Tape *STp,
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
View file @
8f05b672
...
...
@@ -113,26 +113,21 @@ const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE] = {
*
* 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
View file @
8f05b672
...
...
@@ -1339,7 +1339,7 @@ static void scsi_eh_lock_done(struct scsi_cmnd *scmd)
**/
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
View file @
8f05b672
...
...
@@ -98,7 +98,7 @@ static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
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 @@ int scsi_ioctl_send_command(struct scsi_device *sdev,
break
;
}
sreq
=
scsi_allocate_request
(
sdev
);
sreq
=
scsi_allocate_request
(
sdev
,
GFP_KERNEL
);
if
(
!
sreq
)
{
result
=
-
EINTR
;
goto
error
;
...
...
drivers/scsi/scsi_lib.c
View file @
8f05b672
...
...
@@ -1454,7 +1454,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,
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
View file @
8f05b672
...
...
@@ -693,7 +693,7 @@ static int scsi_probe_and_add_lun(struct Scsi_Host *host,
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 @@ static int scsi_report_lun_scan(struct scsi_device *sdev, int bflags,
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
View file @
8f05b672
...
...
@@ -1174,7 +1174,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
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 int sd_remove(struct device *dev)
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 @@ static void sd_shutdown(struct device *dev)
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
View file @
8f05b672
...
...
@@ -680,7 +680,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
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
View file @
8f05b672
...
...
@@ -599,7 +599,7 @@ static void get_sectorsize(struct scsi_cd *cd)
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
View file @
8f05b672
...
...
@@ -82,7 +82,7 @@ int sr_do_ioctl(Scsi_CD *cd, struct cdrom_generic_command *cgc)
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
View file @
8f05b672
...
...
@@ -374,7 +374,7 @@ static Scsi_Request *
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
View file @
8f05b672
...
...
@@ -45,7 +45,7 @@ struct scsi_request {
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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment