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
7465d7ac
Commit
7465d7ac
authored
Sep 17, 2020
by
Mike Snitzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dm: eliminate need for start_io_acct() forward declaration
Signed-off-by:
Mike Snitzer
<
snitzer@redhat.com
>
parent
9679b5a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
40 deletions
+38
-40
drivers/md/dm.c
drivers/md/dm.c
+38
-40
No files found.
drivers/md/dm.c
View file @
7465d7ac
...
...
@@ -591,7 +591,44 @@ static int dm_blk_ioctl(struct block_device *bdev, fmode_t mode,
return
r
;
}
static
void
start_io_acct
(
struct
dm_io
*
io
);
u64
dm_start_time_ns_from_clone
(
struct
bio
*
bio
)
{
struct
dm_target_io
*
tio
=
container_of
(
bio
,
struct
dm_target_io
,
clone
);
struct
dm_io
*
io
=
tio
->
io
;
return
jiffies_to_nsecs
(
io
->
start_time
);
}
EXPORT_SYMBOL_GPL
(
dm_start_time_ns_from_clone
);
static
void
start_io_acct
(
struct
dm_io
*
io
)
{
struct
mapped_device
*
md
=
io
->
md
;
struct
bio
*
bio
=
io
->
orig_bio
;
io
->
start_time
=
bio_start_io_acct
(
bio
);
if
(
unlikely
(
dm_stats_used
(
&
md
->
stats
)))
dm_stats_account_io
(
&
md
->
stats
,
bio_data_dir
(
bio
),
bio
->
bi_iter
.
bi_sector
,
bio_sectors
(
bio
),
false
,
0
,
&
io
->
stats_aux
);
}
static
void
end_io_acct
(
struct
dm_io
*
io
)
{
struct
mapped_device
*
md
=
io
->
md
;
struct
bio
*
bio
=
io
->
orig_bio
;
unsigned
long
duration
=
jiffies
-
io
->
start_time
;
bio_end_io_acct
(
bio
,
io
->
start_time
);
if
(
unlikely
(
dm_stats_used
(
&
md
->
stats
)))
dm_stats_account_io
(
&
md
->
stats
,
bio_data_dir
(
bio
),
bio
->
bi_iter
.
bi_sector
,
bio_sectors
(
bio
),
true
,
duration
,
&
io
->
stats_aux
);
/* nudge anyone waiting on suspend queue */
if
(
unlikely
(
wq_has_sleeper
(
&
md
->
wait
)))
wake_up
(
&
md
->
wait
);
}
static
struct
dm_io
*
alloc_io
(
struct
mapped_device
*
md
,
struct
bio
*
bio
)
{
...
...
@@ -657,45 +694,6 @@ static void free_tio(struct dm_target_io *tio)
bio_put
(
&
tio
->
clone
);
}
u64
dm_start_time_ns_from_clone
(
struct
bio
*
bio
)
{
struct
dm_target_io
*
tio
=
container_of
(
bio
,
struct
dm_target_io
,
clone
);
struct
dm_io
*
io
=
tio
->
io
;
return
jiffies_to_nsecs
(
io
->
start_time
);
}
EXPORT_SYMBOL_GPL
(
dm_start_time_ns_from_clone
);
static
void
start_io_acct
(
struct
dm_io
*
io
)
{
struct
mapped_device
*
md
=
io
->
md
;
struct
bio
*
bio
=
io
->
orig_bio
;
io
->
start_time
=
bio_start_io_acct
(
bio
);
if
(
unlikely
(
dm_stats_used
(
&
md
->
stats
)))
dm_stats_account_io
(
&
md
->
stats
,
bio_data_dir
(
bio
),
bio
->
bi_iter
.
bi_sector
,
bio_sectors
(
bio
),
false
,
0
,
&
io
->
stats_aux
);
}
static
void
end_io_acct
(
struct
dm_io
*
io
)
{
struct
mapped_device
*
md
=
io
->
md
;
struct
bio
*
bio
=
io
->
orig_bio
;
unsigned
long
duration
=
jiffies
-
io
->
start_time
;
bio_end_io_acct
(
bio
,
io
->
start_time
);
if
(
unlikely
(
dm_stats_used
(
&
md
->
stats
)))
dm_stats_account_io
(
&
md
->
stats
,
bio_data_dir
(
bio
),
bio
->
bi_iter
.
bi_sector
,
bio_sectors
(
bio
),
true
,
duration
,
&
io
->
stats_aux
);
/* nudge anyone waiting on suspend queue */
if
(
unlikely
(
wq_has_sleeper
(
&
md
->
wait
)))
wake_up
(
&
md
->
wait
);
}
/*
* Add the bio to the list of deferred io.
*/
...
...
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