|
Revision tags: v6.4.0, v6.4.0rc1, v6.5.0, v6.2.2, v6.2.1, v6.3.0, v6.0.1, v6.0.0, v6.0.0rc1, v6.1.0, v5.8.3, v5.8.2, v5.8.1, v5.8.0, v5.9.0, v5.8.0rc1, v5.6.3 |
|
| #
8477f730 |
| 25-Oct-2019 |
zrj <rimvydas.jasinskas@gmail.com> |
kernel/dm: Include <sys/param.h> first.
Allow the <dev/disk/dm/dm.h> to include common headers first.
|
|
Revision tags: v5.6.2, v5.6.1, v5.6.0, v5.6.0rc1, v5.7.0, v5.4.3, v5.4.2, v5.4.1, v5.4.0, v5.5.0, v5.4.0rc1, v5.2.2, v5.2.1, v5.2.0, v5.3.0, v5.2.0rc, v5.0.2, v5.0.1, v5.0.0, v5.0.0rc2, v5.1.0, v5.0.0rc1, v4.8.1, v4.8.0, v4.6.2, v4.9.0, v4.8.0rc |
|
| #
19bd59e4 |
| 27-Nov-2016 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Make init/destroy handlers optional
Some targets don't need to do anything in init/destroy handler, as there is no private data to init/cleanup, so make them optional.
table_en->ta
sys/dev/disk/dm: Make init/destroy handlers optional
Some targets don't need to do anything in init/destroy handler, as there is no private data to init/cleanup, so make them optional.
table_en->target_config can be set to NULL regardless of destroy handler or its result.
show more ...
|
|
Revision tags: v4.6.1 |
|
| #
28d082dd |
| 09-Oct-2016 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Make dmdebug() print __func__
and fix/remove dmdebug calls that could be cleaned up or simplified.
|
|
Revision tags: v4.6.0, v4.6.0rc2, v4.6.0rc, v4.7.0, v4.4.3, v4.4.2, v4.4.1, v4.4.0, v4.5.0, v4.4.0rc |
|
| #
c8e73ea2 |
| 19-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Cleanup header includes
dm.h depends on <sys/vnode.h>, so dm.h should include it instead of having c files that depend on dm.h include it.
|
| #
30ef4508 |
| 17-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Cleanup header includes
|
| #
b7c11cda |
| 13-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Cleanups
* Fix comments. * Add a blank line between functions. * Some minor fixes on dm core.
|
| #
12f3b163 |
| 10-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Fix/refactor alloc/free functions [2/6]
Rename dm_dev_rem() to dm_dev_lookup_evict(). There is dm_dev_remove(), and having remove()/rem() is confusing.
Refactor dm_dev_lookup()/dm_
sys/dev/disk/dm: Fix/refactor alloc/free functions [2/6]
Rename dm_dev_rem() to dm_dev_lookup_evict(). There is dm_dev_remove(), and having remove()/rem() is confusing.
Refactor dm_dev_lookup()/dm_dev_lookup_evict() using a common lookup function.
Disable dm_dev_lookup_evict() by #if0. This function is only used for renaming, but renaming is not implemented.
show more ...
|
| #
733c17c3 |
| 10-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Fix/refactor alloc/free functions [1/6]
There are way too many functions with similar names that do something related to removing and/or freeing dm device.
dm_dev_rem_dev() doesn't
sys/dev/disk/dm: Fix/refactor alloc/free functions [1/6]
There are way too many functions with similar names that do something related to removing and/or freeing dm device.
dm_dev_rem_dev() doesn't need to be a function so get rid of it. dm_dev_destroy() can be a static function.
show more ...
|
| #
26798264 |
| 09-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Rename aprint_debug() to dmdebug()
Not sure what aprint is, but dmdebug() is better considering this macro does if (dm_debug_level) kprintf(...);
|
| #
f3c99fce |
| 07-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Fix table/info priority
Fix conditional in dm_table_status() added in e243a4fb to avoid a potential bug, where DM_STATUS_TABLE_FLAG is set, but table() handler is NULL, and results
sys/dev/disk/dm: Fix table/info priority
Fix conditional in dm_table_status() added in e243a4fb to avoid a potential bug, where DM_STATUS_TABLE_FLAG is set, but table() handler is NULL, and results calling info().
Currently there are no target that implements info() but does not implement table() (see f134a703 and 54b60c60). Therefore this isn't likely to happen, but should be fixed to avoid a potential bug.
show more ...
|
| #
895c8e52 |
| 07-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Use uint32_t for flags
since libprop uses uint32 APIs for this.
|
| #
157bcf9e |
| 07-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Change DM_XXX_FLAG() to inline functions
These shouldn't be macros IMO.
|
| #
5f3bf2b2 |
| 07-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Cleanup dm_dbg_print_flags()
Some minor fixes.
|
| #
e243a4fb |
| 07-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Refactor dm_table_status_ioctl()
dm_table_status_ioctl() is getting messy, so separate table/info handler related part into a different function.
prop_dictionary_set_cstring(target
sys/dev/disk/dm: Refactor dm_table_status_ioctl()
dm_table_status_ioctl() is getting messy, so separate table/info handler related part into a different function.
prop_dictionary_set_cstring(target_dict, DM_TABLE_PARAMS, ""); is necessary when table/info handlers aren't supported or handlers return NULL. See a6cf5418.
show more ...
|
| #
eca20b99 |
| 07-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Don't force targets to implement table handler
All targets implementing table handler is redundant as some of them don't need to do anything. Avoid it by a simple NULL check, just l
sys/dev/disk/dm: Don't force targets to implement table handler
All targets implementing table handler is redundant as some of them don't need to do anything. Avoid it by a simple NULL check, just like what's been done to other handlers.
show more ...
|
| #
333a8a0c |
| 07-Nov-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Remove upcall handler
dm target's upcall() handler int (*upcall)(dm_table_entry_t *, struct buf *); implemented by dm targets acutally do nothing other than returning 0. Also note
sys/dev/disk/dm: Remove upcall handler
dm target's upcall() handler int (*upcall)(dm_table_entry_t *, struct buf *); implemented by dm targets acutally do nothing other than returning 0. Also note that upcall() is not used by dm core.
The targets that are supposed to be relying on this api are obviously not working at the moment, however things aren't as simple as just implementing missing upcall() handler.
upcall() is supposed to be something to do with targets like snapshot, but it lacks documentation and purpose of this api is not clear at all. Whoever tries to implement snapshot/etc will have to re-design dm core and appropriate handlers from scratch anyway without using the existing one.
show more ...
|
| #
f28e17b7 |
| 28-Oct-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Make target's init() take argc and argv
dm core shouldn't be passing char *params to targets' init() because all targets are basically going to copy-paste a code snippet (that strse
sys/dev/disk/dm: Make target's init() take argc and argv
dm core shouldn't be passing char *params to targets' init() because all targets are basically going to copy-paste a code snippet (that strseps params) from the existing targets code which is inefficient and should be avoided.
This commit adds dm_table_init() which converts char *params to int argc and char **argv, and passes them to init().
show more ...
|
| #
4f398b7b |
| 26-Oct-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Add udev_t field to dm_pdev_t
|
| #
a6cf5418 |
| 25-Oct-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Always initialize target's status string
Ioctl by dmsetup(8)'s "status" subcommand doesn't necessary have a handler function from the way it's implemented.
In such a case, it seems
sys/dev/disk/dm: Always initialize target's status string
Ioctl by dmsetup(8)'s "status" subcommand doesn't necessary have a handler function from the way it's implemented.
In such a case, it seems prop_dictionary_t object of libprop (in-kernel library) isn't properly initialized. This results in dmsetup(8)'s "status" subcommand showing a binary junk. This commit explicitly initializes it with C string "" to fix this in above case where char *params remains == NULL.
This issue existed before f134a703 (touched related code).
Below can reproduce this issue. Using a kernel prior to this commit will show some junk after each line of dmsetup status output except for the last line. Target type and definition of table can be anything, but the target needs to have more than 1 entries for the table to reproduce this.
=====(A) using the existing code # kldload dm # echo "0 117218241 linear /dev/daX 0" > ./table.txt # echo "117218241 117218241 linear /dev/daY 0" >> ./table.txt # dmsetup create linear1 ./table.txt # dmsetup status /dev/mapper/linear1 0 117218241 linear ü 117218241 117218241 linear
=====(B) using this commit # kldload dm # echo "0 117218241 linear /dev/daX 0" > ./table.txt # echo "117218241 117218241 linear /dev/daY 0" >> ./table.txt # dmsetup create linear1 ./table.txt # dmsetup status /dev/mapper/linear1 0 117218241 linear 117218241 117218241 linear
show more ...
|
| #
3cd1dc08 |
| 24-Oct-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Change table SLIST to TAILQ
TAILQ is more flexible and better for what it's trying to do.
|
| #
d471f1f9 |
| 24-Oct-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Don't let targets implement deps [2/2]
This commit gets rid of target's deps handler by introducing a new structure struct dm_mapping which embeds struct dm_pdev* and a tailq struct
sys/dev/disk/dm: Don't let targets implement deps [2/2]
This commit gets rid of target's deps handler by introducing a new structure struct dm_mapping which embeds struct dm_pdev* and a tailq structure for the next entry whose tailq head is embedded within struct dm_table_entry.
=====(A) before this commit table | [dm core] ------------------------------------------------------- | pdev pdev pdev [dm targets] v ^ ^ ^ target----/---------/---------/ (void*)
=====(B) this commit table---->mapping-->mapping-->mapping-->... | | | | | v v v [dm core] ------------------------------------------------------- | pdev pdev pdev [dm targets] v ^ ^ ^ target----/---------/---------/ (void*)
Each target's init() now calls dm_table_add_deps(table, pdev) to add a new dm_mapping (that points to pdev) to table. This allows dm table structure to refer to underlying devices that the target is dependent on (by following this tailq) without using target specific deps handler.
dmsetup(8)'s deps subcommand is now handled by a newly added dm core function dm_table_deps() that is common among targets. This greatly reduces complexity and size of targets plus make code less error prone. Targets only need to call dm_table_add _deps() as mentioned above whenever they allocate underlying device(s) via dm_pdev_insert().
show more ...
|
| #
49784e7d |
| 24-Oct-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Don't let targets implement deps [1/2]
As mentioned in 66fee7cc, each dm target implementing its deps ioctl handler is inefficient and error prone since each handler is going to be
sys/dev/disk/dm: Don't let targets implement deps [1/2]
As mentioned in 66fee7cc, each dm target implementing its deps ioctl handler is inefficient and error prone since each handler is going to be just a copy pasted code from other target for its underlying device(s).
The way dm computes device dependencies (i.e. deps handler) shouldn't be targets specific in the first place. The problem here is that dm table (struct dm_table_entry) is unable to see its underlying device(s), but only each target specific data structure can see them. This commit and next one fix it and enables dm core to handle dependencies without using targets specific code.
This commit only changes API format of init handler. It needs to pass dm table instead of device and void**, for the next commit.
show more ...
|
| #
2d59555f |
| 24-Oct-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Rename variable
struct dm_dev *dm_dev; is just confusing.
From the way other struct dm_dev type variables are named, it should be either dev or dmv, and those two should probably b
sys/dev/disk/dm: Rename variable
struct dm_dev *dm_dev; is just confusing.
From the way other struct dm_dev type variables are named, it should be either dev or dmv, and those two should probably be either but not both. Same for struct dm_pdev.
show more ...
|
| #
0338193e |
| 24-Oct-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Remove unnecessary ()
|
| #
323b0fc1 |
| 20-Oct-2015 |
Tomohiro Kusumi <kusumi.tomohiro@gmail.com> |
sys/dev/disk/dm: Change printf() to kprintf()
Change disabled (i.e. either within a comment or not compiled) printf() to kprintf().
|