summaryrefslogtreecommitdiff
path: root/sys/dev/dm
AgeCommit message (Collapse)Author
2022-10-13s/exaple/example/andvar
2022-03-31For device modules that provide both auto-config and /dev/xxxpgoyette
interfaces, make sure that initialization and destruction follow the proper sequence. This is triggered by the recent changes to the devsw stuff; per riastradh@ the required call sequence is: devsw_attach() config_init_component() or config_cf*_attach() ... config_fini_component() or config_cf*_detach() devsw_detach() While here, add a few missing calls to some of the detach routines. Testing of these changes has been limited to: 1. compile without build break 2. no related test failures from atf 3. modload/modunload work as well as before. No functional device testing done, since I don't have any of these devices. Let me know of any damage I might cause here! XXX Some of the modules affected by this commit are already XXX broken; see kern/56772. This commit does not break any additional modules (as far as I know).
2022-03-28Media size is in bytes (off_t), not sectors.mlelstv
2021-11-07fix various typos, mainly s/prefered/preferred/andvar
2021-08-21fix typos in sys/dev/dm code comments and documentation.andvar
also remove some trailing space in documentation.
2021-08-20fix various typos in comments and log messages.andvar
2021-07-24Fix all remaining typos, mainly in comments but also in few definitions and ↵andvar
log messages, reported by me in PR kern/54889. Also fixed some additional typos in comments, found on review of same files or typos.
2021-06-21fix proplib deprecationchristos
2021-05-07Track the number of cdev and bdev opens and fail dm_detach()hannken
on open devices unless detach is forced. PR kern/54969 (Disk cache is no longer flushed on shutdown)
2021-05-07Make sure the unit number of device-mapper devices matches their minor number.hannken
2020-07-08Adapt to proplib API chanages.thorpej
2020-01-21dm: #if0 target's ->upcall() handlertkusumi
This is part of NetBSD's dm design, but unimplemented (all handlers return 0) and also unused.
2020-01-16dm(8) doesn't cause problems on suspend, don't block it.maya
Tested by Matthias Petermann, thanks!
2020-01-05dm: Add "Copyright (c) 2015 The DragonFly Project." to dm-flakeytkusumi
which I missed in my initial dm-flakey commit.
2020-01-05dm: Add dm-delay targettkusumi
Ported from DragonFlyBSD, but this target had originally existed in Linux kernel. See below for details. https://www.kernel.org/doc/Documentation/device-mapper/delay.txt Due to "tick" in hz(9) not working (which results in dmdlthread spinning forever in _submit_queue() without dp extracted from delayed list and queued into submit list), this hasn't been hooked to dm.kmod yet. taken-from: DragonFlyBSD
2020-01-02dm: Add dm-flakey targettkusumi
Ported from DragonFlyBSD, but this target had originally existed in Linux kernel. See below for details. https://www.kernel.org/doc/Documentation/device-mapper/dm-flakey.txt Due to two technical issues, this hasn't been hooked to dm.kmod yet. 1) "tick" in hz(9) not working. 2) Unable to use ->b_private in nestiobuf callback when it's already used for mbp (see HAS_BUF_PRIV2). taken-from: DragonFlyBSD
2019-12-31dm: Remove unnecessary inliningtkusumi
These two don't really need to be inlined.
2019-12-28dm: Fix typo in comment dklinear -> lineartkusumi
2019-12-27s/suport/support/msaitoh
2019-12-23dm: Make target's ->table() optionaltkusumi
Since ->info() (counter part of ->table() in the original dm design in Linux kernel in .status where both INFO and TABLE are optional) is an optional handler, make ->table() optional as well. Some targets don't have anything to do in ->table() just as in ->info(). taken-from: DragonFlyBSD
2019-12-22dm: Make numsec/secsize arguments in dm_table_disksize() optionaltkusumi
2019-12-22dm: Add missing "ioctl called" debug printstkusumi
2019-12-21dm: Fix dm-stripe's "status" output formattkusumi
As mentioned in "dm: Don't try to implement "status" as subset of "table"", dm-stripe in NetBSD doesn't have correct "status" output format. Implement ->info() to sync with Linux kernel. Note that num_error for stripe device isn't implemented yet. taken-from: DragonFlyBSD
2019-12-21dm: Remove target's ->deps() by implementing deps in dm coretkusumi
Retrieving device dependencies doesn't need to be target specific. The reason it currently needs ->deps() is because dm core doesn't have data structure that allows table to walk through target's underlying devices. Add struct dm_mapping to be able to do this, and remove ->deps()'s from targets which basically do the same thing. =====(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*) taken-from: DragonFlyBSD
2019-12-20dm: Fix "table" output format of dm-linear and dm-stripetkusumi
The existing "table" output showing device file path of pdev is not compatible with dm in Linux kernel (and also DragonFlyBSD). It should be showing "major:minor" instead. taken-from: DragonFlyBSD
2019-12-19dm: Minor dm_ioctl.c fixes (indentation/typo/type/etc)tkusumi
2019-12-19dm: Refactor dmioctl()tkusumi
More readable without dm_ioctl_switch() as a separate function.
2019-12-19dm: u_{int,long} -> unsigned {int,long}tkusumi
2019-12-18dm: Test # of args in target's ->init()tkusumi
The # of args is part of target's spec. Both Linux kernel and DragonFlyBSD test argc on ctr/init.
2019-12-17Add error and zero targets to build.mlelstv
2019-12-16dm: Cleanup dm.h (remove unneeded comments, etc)tkusumi
2019-12-16dm: Enable dm-error and dm-zero targettkusumi
Add these two targets to dm.kmod. These are generally available in Linux and DragonFlyBSD, so enable them in NetBSD as well.
2019-12-15dm: Rename dm specific atoi() to atoi64()tkusumi
This is uint64_t version, not sys/lib/libsa/atoi.c.
2019-12-15dm: Style cleanups (no functional changes)tkusumi
2019-12-15dm: Make targets' ->sync() optionaltkusumi
Apparently some targets have nothing to sync, so make it optional.
2019-12-15dm: Make targets' ->secsize() optionaltkusumi
and make a caller assume secsize 0 if ->secsize not present. This allows a dummy function to be removed which was added in "dm: Add dummy target ->sync()/->secsize() to prevent panic on modload(8)".
2019-12-15dm: "unsigned" -> "unsigned int" for consistencytkusumi
Use either one, but not both.
2019-12-15dm: Rename targets' ->status() to ->table() given ->info() existstkusumi
Since now that dm targets in NetBSD have ->info() for "status", ->status() should be renamed to ->table() for "table", given how dm target status was originally designed in Linux kernel. taken-from: DragonFlyBSD
2019-12-14dm: Don't try to implement "status" as subset of "table"tkusumi
The way dm_table_status_ioctl() implements "status" and "table" is not compatible with Linux kernel. Some targets have different outputs that "status" can't be implemented as subset of "table". Add ->info() handler to sync with "status" behavior in Linux kernel. Some targets which currently exist in NetBSD (I think striped) as well as some minor targets that I plan to port to NetBSD can/should implement ->info(), but will do that in a different commit. taken-from: DragonFlyBSD
2019-12-14dm: Make dm_dbg_print_flags() take uint32_t flagtkusumi
which comes from prop_dictionary_get_uint32() result. taken-from: DragonFlyBSD
2019-12-14dm: Move extern declaration of global variables to dm.htkusumi
2019-12-14dm: Remove void casts of function callstkusumi
Use of void casts in dm is not consistent, just get rid of them.
2019-12-14dm: Remove unconditional debug prints in targets' ->strategy()tkusumi
Having debug prints in ->strategy() by default just to tell ->strategy() is called is overkill. taken-from: DragonFlyBSD
2019-12-13dm: Don't KASSERT() target handlerstkusumi
Having assertions here causes panic if target is missing anything as shown in "dm: Add dummy target ->sync()/->secsize() to prevent panic on modload(8)". Instead just return EINVAL if a handler(s) isn't implemented. taken-from: DragonFlyBSD
2019-12-13dm: Fix memory leak in dm_pdev_rem()tkusumi
Need to free dmp regardless of dm_pdev_rem() return value. taken-from: DragonFlyBSD
2019-12-12dm: Make target's ->init() take parsed argc and argvtkusumi
This gets rid of the same parser code in each target using strsep(3). taken-from: DragonFlyBSD
2019-12-11dm: Revert "Fix error handling in dmioctl()" for nowtkusumi
This change seems to break "deps" in dm ioctl(2) for linear target. Revert the change, will revisit later. https://mail-index.netbsd.org/current-users/2019/12/11/msg037179.html
2019-12-09dm: Silence aprint_normal() in dm_target_linear_status()tkusumi
dm_target_linear_status() shouldn't print this debug message by default on dmsetup "table" ioctl/command.
2019-12-09dm: Fix error handling in dmioctl()tkusumi
Looks like cleanup_exit label is in a wrong place. Should skip prop_dictionary_copyout_ioctl() on error.
2019-12-09dm: Correct target name "stripe" -> "striped"tkusumi
Sync with Linux kernel. The file name is "stripe", but the target name is "striped". DragonFlyBSD also follows this.