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
745dc570
Commit
745dc570
authored
Dec 11, 2017
by
Mike Snitzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dm: rename 'bio' member of dm_io structure to 'orig_bio'
Signed-off-by:
Mike Snitzer
<
snitzer@redhat.com
>
parent
2abf1fc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
drivers/md/dm.c
drivers/md/dm.c
+14
-14
No files found.
drivers/md/dm.c
View file @
745dc570
...
...
@@ -60,13 +60,13 @@ void dm_issue_global_event(void)
}
/*
* One of these is allocated per bio.
* One of these is allocated per
original
bio.
*/
struct
dm_io
{
struct
mapped_device
*
md
;
blk_status_t
status
;
atomic_t
io_count
;
struct
bio
*
bio
;
struct
bio
*
orig_
bio
;
unsigned
long
start_time
;
spinlock_t
endio_lock
;
struct
dm_stats_aux
stats_aux
;
...
...
@@ -510,7 +510,7 @@ int md_in_flight(struct mapped_device *md)
static
void
start_io_acct
(
struct
dm_io
*
io
)
{
struct
mapped_device
*
md
=
io
->
md
;
struct
bio
*
bio
=
io
->
bio
;
struct
bio
*
bio
=
io
->
orig_
bio
;
int
cpu
;
int
rw
=
bio_data_dir
(
bio
);
...
...
@@ -531,7 +531,7 @@ static void start_io_acct(struct dm_io *io)
static
void
end_io_acct
(
struct
dm_io
*
io
)
{
struct
mapped_device
*
md
=
io
->
md
;
struct
bio
*
bio
=
io
->
bio
;
struct
bio
*
bio
=
io
->
orig_
bio
;
unsigned
long
duration
=
jiffies
-
io
->
start_time
;
int
pending
;
int
rw
=
bio_data_dir
(
bio
);
...
...
@@ -771,8 +771,7 @@ static void dec_pending(struct dm_io *io, blk_status_t error)
/* Push-back supersedes any I/O errors */
if
(
unlikely
(
error
))
{
spin_lock_irqsave
(
&
io
->
endio_lock
,
flags
);
if
(
!
(
io
->
status
==
BLK_STS_DM_REQUEUE
&&
__noflush_suspending
(
md
)))
if
(
!
(
io
->
status
==
BLK_STS_DM_REQUEUE
&&
__noflush_suspending
(
md
)))
io
->
status
=
error
;
spin_unlock_irqrestore
(
&
io
->
endio_lock
,
flags
);
}
...
...
@@ -784,7 +783,8 @@ static void dec_pending(struct dm_io *io, blk_status_t error)
*/
spin_lock_irqsave
(
&
md
->
deferred_lock
,
flags
);
if
(
__noflush_suspending
(
md
))
bio_list_add_head
(
&
md
->
deferred
,
io
->
bio
);
/* NOTE early return due to BLK_STS_DM_REQUEUE below */
bio_list_add_head
(
&
md
->
deferred
,
io
->
orig_bio
);
else
/* noflush suspend was interrupted. */
io
->
status
=
BLK_STS_IOERR
;
...
...
@@ -792,7 +792,7 @@ static void dec_pending(struct dm_io *io, blk_status_t error)
}
io_error
=
io
->
status
;
bio
=
io
->
bio
;
bio
=
io
->
orig_
bio
;
end_io_acct
(
io
);
free_io
(
md
,
io
);
...
...
@@ -1038,7 +1038,7 @@ void dm_remap_zone_report(struct dm_target *ti, struct bio *bio, sector_t start)
{
#ifdef CONFIG_BLK_DEV_ZONED
struct
dm_target_io
*
tio
=
container_of
(
bio
,
struct
dm_target_io
,
clone
);
struct
bio
*
report_bio
=
tio
->
io
->
bio
;
struct
bio
*
report_bio
=
tio
->
io
->
orig_
bio
;
struct
blk_zone_report_hdr
*
hdr
=
NULL
;
struct
blk_zone
*
zone
;
unsigned
int
nr_rep
=
0
;
...
...
@@ -1129,7 +1129,7 @@ static void __map_bio(struct dm_target_io *tio)
case
DM_MAPIO_REMAPPED
:
/* the bio has been remapped so dispatch it */
trace_block_bio_remap
(
clone
->
bi_disk
->
queue
,
clone
,
bio_dev
(
tio
->
io
->
bio
),
sector
);
bio_dev
(
tio
->
io
->
orig_
bio
),
sector
);
generic_make_request
(
clone
);
break
;
case
DM_MAPIO_KILL
:
...
...
@@ -1441,7 +1441,7 @@ static void __split_and_process_bio(struct mapped_device *md,
ci
.
io
=
alloc_io
(
md
);
ci
.
io
->
status
=
0
;
atomic_set
(
&
ci
.
io
->
io_count
,
1
);
ci
.
io
->
bio
=
bio
;
ci
.
io
->
orig_
bio
=
bio
;
ci
.
io
->
md
=
md
;
spin_lock_init
(
&
ci
.
io
->
endio_lock
);
ci
.
sector
=
bio
->
bi_iter
.
bi_sector
;
...
...
@@ -1468,15 +1468,15 @@ static void __split_and_process_bio(struct mapped_device *md,
* so that it gets handled *after* bios already submitted
* have been completely processed.
* We take a clone of the original to store in
* ci.io->bio to be used by end_io_acct() and
* ci.io->
orig_
bio to be used by end_io_acct() and
* for dec_pending to use for completion handling.
* As this path is not used for REQ_OP_ZONE_REPORT,
* the usage of io->bio in dm_remap_zone_report()
* the usage of io->
orig_
bio in dm_remap_zone_report()
* won't be affected by this reassignment.
*/
struct
bio
*
b
=
bio_clone_bioset
(
bio
,
GFP_NOIO
,
md
->
queue
->
bio_split
);
ci
.
io
->
bio
=
b
;
ci
.
io
->
orig_
bio
=
b
;
bio_advance
(
bio
,
(
bio_sectors
(
bio
)
-
ci
.
sector_count
)
<<
9
);
bio_chain
(
b
,
bio
);
generic_make_request
(
bio
);
...
...
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