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
747120af
Commit
747120af
authored
Feb 07, 2002
by
Jens Axboe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scatterlist address fixup
parent
52e5dc49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
29 deletions
+8
-29
drivers/scsi/ide-scsi.c
drivers/scsi/ide-scsi.c
+8
-18
drivers/scsi/sg.c
drivers/scsi/sg.c
+0
-11
No files found.
drivers/scsi/ide-scsi.c
View file @
747120af
...
...
@@ -130,6 +130,7 @@ static void idescsi_output_zeros (ide_drive_t *drive, unsigned int bcount)
static
void
idescsi_input_buffers
(
ide_drive_t
*
drive
,
idescsi_pc_t
*
pc
,
unsigned
int
bcount
)
{
int
count
;
char
*
buf
;
while
(
bcount
)
{
if
(
pc
->
sg
-
(
struct
scatterlist
*
)
pc
->
scsi_cmd
->
request_buffer
>
pc
->
scsi_cmd
->
use_sg
)
{
...
...
@@ -138,7 +139,8 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne
return
;
}
count
=
IDE_MIN
(
pc
->
sg
->
length
-
pc
->
b_count
,
bcount
);
atapi_input_bytes
(
drive
,
pc
->
sg
->
address
+
pc
->
b_count
,
count
);
buf
=
page_address
(
pc
->
sg
->
page
)
+
pc
->
sg
->
offset
;
atapi_input_bytes
(
drive
,
buf
+
pc
->
b_count
,
count
);
bcount
-=
count
;
pc
->
b_count
+=
count
;
if
(
pc
->
b_count
==
pc
->
sg
->
length
)
{
pc
->
sg
++
;
...
...
@@ -150,6 +152,7 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne
static
void
idescsi_output_buffers
(
ide_drive_t
*
drive
,
idescsi_pc_t
*
pc
,
unsigned
int
bcount
)
{
int
count
;
char
*
buf
;
while
(
bcount
)
{
if
(
pc
->
sg
-
(
struct
scatterlist
*
)
pc
->
scsi_cmd
->
request_buffer
>
pc
->
scsi_cmd
->
use_sg
)
{
...
...
@@ -158,7 +161,8 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign
return
;
}
count
=
IDE_MIN
(
pc
->
sg
->
length
-
pc
->
b_count
,
bcount
);
atapi_output_bytes
(
drive
,
pc
->
sg
->
address
+
pc
->
b_count
,
count
);
buf
=
page_address
(
pc
->
sg
->
page
)
+
pc
->
sg
->
offset
;
atapi_output_bytes
(
drive
,
buf
+
pc
->
b_count
,
count
);
bcount
-=
count
;
pc
->
b_count
+=
count
;
if
(
pc
->
b_count
==
pc
->
sg
->
length
)
{
pc
->
sg
++
;
...
...
@@ -750,25 +754,11 @@ static inline struct bio *idescsi_dma_bio(ide_drive_t *drive, idescsi_pc_t *pc)
printk
(
"ide-scsi: %s: building DMA table, %d segments, %dkB total
\n
"
,
drive
->
name
,
segments
,
pc
->
request_transfer
>>
10
);
#endif
/* IDESCSI_DEBUG_LOG */
while
(
segments
--
)
{
struct
page
*
page
=
sg
->
page
;
int
offset
=
sg
->
offset
;
if
(
!
page
)
{
BUG_ON
(
!
sg
->
address
);
page
=
virt_to_page
(
sg
->
address
);
offset
=
(
unsigned
long
)
sg
->
address
&
~
PAGE_MASK
;
}
bh
->
bi_io_vec
[
0
].
bv_page
=
page
;
bh
->
bi_io_vec
[
0
].
bv_page
=
sg
->
page
;
bh
->
bi_io_vec
[
0
].
bv_len
=
sg
->
length
;
bh
->
bi_io_vec
[
0
].
bv_offset
=
offset
;
bh
->
bi_io_vec
[
0
].
bv_offset
=
sg
->
offset
;
bh
->
bi_size
=
sg
->
length
;
bh
=
bh
->
bi_next
;
/*
* just until scsi_merge is fixed up...
*/
BUG_ON
(
PageHighMem
(
page
));
sg
->
address
=
page_address
(
page
)
+
offset
;
sg
++
;
}
}
else
{
...
...
drivers/scsi/sg.c
View file @
747120af
...
...
@@ -76,8 +76,6 @@ static void sg_proc_cleanup(void);
#include <linux/version.h>
#endif
/* LINUX_VERSION_CODE */
#define SG_STILL_HAVE_ADDRESS_IN_SCATTERLIST
#define SG_ALLOW_DIO_DEF 0
#define SG_ALLOW_DIO_CODE
/* compile out be commenting this define */
#ifdef SG_ALLOW_DIO_CODE
...
...
@@ -1714,9 +1712,6 @@ static int sg_build_dir(Sg_request * srp, Sg_fd * sfp, int dxfer_len)
rem_sz
;
sclp
->
page
=
kp
->
maplist
[
k
];
sclp
->
offset
=
offset
;
#ifdef SG_STILL_HAVE_ADDRESS_IN_SCATTERLIST
sclp
->
address
=
page_address
(
kp
->
maplist
[
k
])
+
offset
;
#endif
sclp
->
length
=
num
;
mem_src_arr
[
k
]
=
SG_USER_MEM
;
rem_sz
-=
num
;
...
...
@@ -1804,9 +1799,6 @@ static int sg_build_indi(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size)
}
sclp
->
page
=
virt_to_page
(
p
);
sclp
->
offset
=
(
unsigned
long
)
p
&
~
PAGE_MASK
;
#ifdef SG_STILL_HAVE_ADDRESS_IN_SCATTERLIST
sclp
->
address
=
p
;
#endif
sclp
->
length
=
ret_sz
;
mem_src_arr
[
k
]
=
mem_src
;
...
...
@@ -1967,9 +1959,6 @@ static void sg_remove_scat(Sg_scatter_hold * schp)
sg_free
(
sg_scatg2virt
(
sclp
),
sclp
->
length
,
mem_src
);
sclp
->
page
=
NULL
;
sclp
->
offset
=
0
;
#ifdef SG_STILL_HAVE_ADDRESS_IN_SCATTERLIST
sclp
->
address
=
0
;
#endif
sclp
->
length
=
0
;
}
sg_free
(
schp
->
buffer
,
schp
->
sglist_len
,
schp
->
buffer_mem_src
);
...
...
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