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
bf661be1
Commit
bf661be1
authored
May 24, 2016
by
Mike Snitzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dm mpath: remove bio-based bloat from struct dm_mpath_io
Signed-off-by:
Mike Snitzer
<
snitzer@redhat.com
>
parent
76e33fe4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
12 deletions
+31
-12
drivers/md/dm-mpath.c
drivers/md/dm-mpath.c
+31
-12
No files found.
drivers/md/dm-mpath.c
View file @
bf661be1
...
...
@@ -109,11 +109,6 @@ struct multipath {
struct
dm_mpath_io
{
struct
pgpath
*
pgpath
;
size_t
nr_bytes
;
/*
* FIXME: make request-based code _not_ include this member.
*/
struct
dm_bio_details
bio_details
;
};
typedef
int
(
*
action_fn
)
(
struct
pgpath
*
pgpath
);
...
...
@@ -294,19 +289,39 @@ static void clear_request_fn_mpio(struct multipath *m, union map_info *info)
}
}
static
size_t
multipath_per_bio_data_size
(
void
)
{
return
sizeof
(
struct
dm_mpath_io
)
+
sizeof
(
struct
dm_bio_details
);
}
static
struct
dm_mpath_io
*
get_mpio_from_bio
(
struct
bio
*
bio
)
{
return
dm_per_bio_data
(
bio
,
sizeof
(
struct
dm_mpath_io
));
return
dm_per_bio_data
(
bio
,
multipath_per_bio_data_size
(
));
}
static
struct
dm_
mpath_io
*
set_mpio_bio
(
struct
multipath
*
m
,
struct
bio
*
bio
)
static
struct
dm_
bio_details
*
get_bio_details_from_bio
(
struct
bio
*
bio
)
{
/* dm_bio_details is immediately after the dm_mpath_io in bio's per-bio-data */
struct
dm_mpath_io
*
mpio
=
get_mpio_from_bio
(
bio
);
void
*
bio_details
=
mpio
+
1
;
return
bio_details
;
}
static
void
multipath_init_per_bio_data
(
struct
bio
*
bio
,
struct
dm_mpath_io
**
mpio_p
,
struct
dm_bio_details
**
bio_details_p
)
{
struct
dm_mpath_io
*
mpio
=
get_mpio_from_bio
(
bio
);
struct
dm_bio_details
*
bio_details
=
get_bio_details_from_bio
(
bio
);
memset
(
mpio
,
0
,
sizeof
(
*
mpio
));
dm_bio_record
(
&
mpio
->
bio_details
,
bio
);
memset
(
bio_details
,
0
,
sizeof
(
*
bio_details
));
dm_bio_record
(
bio_details
,
bio
);
return
mpio
;
if
(
mpio_p
)
*
mpio_p
=
mpio
;
if
(
bio_details_p
)
*
bio_details_p
=
bio_details
;
}
/*-----------------------------------------------
...
...
@@ -629,7 +644,9 @@ static int __multipath_map_bio(struct multipath *m, struct bio *bio, struct dm_m
static
int
multipath_map_bio
(
struct
dm_target
*
ti
,
struct
bio
*
bio
)
{
struct
multipath
*
m
=
ti
->
private
;
struct
dm_mpath_io
*
mpio
=
set_mpio_bio
(
m
,
bio
);
struct
dm_mpath_io
*
mpio
=
NULL
;
multipath_init_per_bio_data
(
bio
,
&
mpio
,
NULL
);
return
__multipath_map_bio
(
m
,
bio
,
mpio
);
}
...
...
@@ -1113,7 +1130,9 @@ static int __multipath_ctr(struct dm_target *ti, unsigned int argc,
ti
->
num_flush_bios
=
1
;
ti
->
num_discard_bios
=
1
;
ti
->
num_write_same_bios
=
1
;
if
(
use_blk_mq
||
bio_based
)
if
(
bio_based
)
ti
->
per_io_data_size
=
multipath_per_bio_data_size
();
else
if
(
use_blk_mq
)
ti
->
per_io_data_size
=
sizeof
(
struct
dm_mpath_io
);
return
0
;
...
...
@@ -1576,7 +1595,7 @@ static int do_end_io_bio(struct multipath *m, struct bio *clone,
}
/* Queue for the daemon to resubmit */
dm_bio_restore
(
&
mpio
->
bio_details
,
clone
);
dm_bio_restore
(
get_bio_details_from_bio
(
clone
)
,
clone
);
spin_lock_irqsave
(
&
m
->
lock
,
flags
);
bio_list_add
(
&
m
->
queued_bios
,
clone
);
...
...
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