summaryrefslogtreecommitdiff
path: root/sys/dev/dm/dm_ioctl.c
AgeCommit message (Collapse)Author
2022-10-13s/exaple/example/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-07Make sure the unit number of device-mapper devices matches their minor number.hannken
2020-07-08Adapt to proplib API chanages.thorpej
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-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-19dm: Minor dm_ioctl.c fixes (indentation/typo/type/etc)tkusumi
2019-12-15dm: Style cleanups (no functional changes)tkusumi
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-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-08dm: Refactor target's ->init() i/ftkusumi
Take dm_table_entry_t* instead of void**. Remove dm_dev_t* unneeded by target code. No functional change, but for future changes. taken-from: DragonFlyBSD
2019-12-06dm: Fix typos in comments/messagestkusumi
taken-from: DragonFlyBSD
2019-12-05dm: Remove unneeded dm_get_version_ioctl()tkusumi
"version" is implemented and handled in userspace, hence dm ioctl doesn't need to support it. taken-from: DragonFlyBSD
2019-12-04dm: style + whitespace + indentation fixestkusumi
No functional changes.
2019-12-03dm: Include <sys/vnode.h> in dm.htkusumi
dm.h already depends on vnode, so have dm.h include <sys/vnode.h> instead of other .c files. taken-from: DragonFlyBSD
2019-12-01dm: Remove unused dm_dev::dev_typetkusumi
Given OOP-like architecture of dm target device structure, dm_dev doesn't need to have self contained target type field, and in fact this is unused.
2019-11-30dm: Always initialize target's status stringtkusumi
Explicitly clear status string to prevent dmsetup(8) from printing binary junk to stdout. Similar change has been applied to DragonFlyBSD since 2015. https://github.com/DragonFlyBSD/DragonFlyBSD/commit/a6cf54187fd7c3e994c573215806ec03572c038e taken-from: DragonFlyBSD
2018-11-11Only _if_ an inactive table has been loaded, make it active when resuming.mlelstv
Fixes lvrename operation.
2018-01-05PR/52900: Tomohiro Kusumi: Fix kernel panic when target's ->init() failedchristos
Reliably unbusy the target in the *all* the destroy routines, so ioctl does not need to do it.
2017-06-01remove checks for failure after memory allocation calls that cannot fail:chs
kmem_alloc() with KM_SLEEP kmem_zalloc() with KM_SLEEP percpu_alloc() pserialize_create() psref_class_create() all of these paths include an assertion that the allocation has not failed, so callers should not assert that again.
2015-05-10CID 976256: Help coverity understand that when the list is empty the headchristos
is NULL.
2014-10-02Call prop_dictionary_get_uint32 with uint32_tjustin
2013-12-24release proplib iterator in failure paths.mlelstv
2013-10-18remove unused variableschristos
2011-08-27- add a function to get the inactive table's sizeahoka
- some whitespace fix from emacs...
2011-05-24Fix logic errorjoerg
2010-12-06We don't need 64 bit variable for dm_device coutner, too.haad
2010-12-06Add comment about dm_dev minor, and change it to 32bit value we realy nothaad
going to use so much device minor numbers.
2010-05-18Fix typo in comment.haad
2010-02-25Be sure to config_cfattach_attach() in dmattach().jakllsch
Loosely based on patch from Brian Brombacher, with other inspriation from vnd(4). This should fix PR kern/42799. While here, a few prototype, style and namespace pollution-related changes.
2010-01-04Indent files remove unnecessary blank lines, white spaces and KNFize code.haad
2010-01-03Hook device-mapper to autoconf framework. Add dm_attach, dm_match and dm_detachhaad
routines used by autoconf users. Change dm_dev_remove_ioctl to call dm_detach. This should be primary used by kernel to disable devices during shutdown of system with nested disk devices. Requested by dyoung@.
2009-12-29Add private lock to dm_dev_t used for mutual exclusion for diks(9) apihaad
routines. This change fixes PR kern/42532.
2009-12-06Add support for DM_QUERY_INACTIVE_TABLE_FLAG to dm_table_status and ↵haad
dm_table_deps this flag was introduced to dm->lvm protocol in 4.16.0 version of it. Restore vrsion check functionality and sent back actual kernel driver version.
2009-12-05Fix bug in dm_table_resume_ioctl where dmv->flags was sent back to libdevmapperhaad
except flags variable. This fixes weird behaviour, when worng links to devices in /dev/mapper were created after lvrename/lvresize.
2009-12-01Revert my commit which have added knowledge about dm targets to libdevmapper,haad
this breaks abstraction. Because only lvmtools/lvmlib and device-mapper can have knowledge about target mapping and libdevmapper only passes requests from lvmtools to kernel and back. Bump major library and driver version. Requested by: yamt@
2009-09-09Fix bug in kmem_alloc/kmem_free of params string. Params string washaad
allocated with length DM_MAX_PARAMS_SIZE and released with strlen + 1 size. Disable KM_NOSLEEP allocation because we do not need them here there is nothing critical in ioctl part of dm driver. Bug reported by jak@.
2009-06-05Add support for DIOCGDISKINFO to disk like device drivers. Changehaad
partutil.c::getdiskinfo to use it to get disk geometry info. Use DIOCGWEDGEINFO ioctl to get information about partition size, if disk driver doesn't support it use old DIOCGDINFO. This patch adds support for wedge like devices(lvm logical volumes, ZFS zvol partitions) to newfs and other tools. No objections on tech-userlevel@.
2009-06-05Parse dm param string in libdevmapper and not in a dm target init function.haad
Create proplib param dictionary entry in libdevmapper and pass it to dm in dm_ioctl dict. Param target is then passed to target init function, where is parse. I like this aproach much better than passing char **argv and trusting to user input. I have bumped minor lib/driver version. XXX. Add more sanity checks in kernel.
2009-04-13Destroy locks in dm_dev_free, do not allocate struct disk twice.haad
2009-04-06Use functions from disk(9) framework. Initialize disk/disklabel duringhaad
dm_device_create_ioctl, before calling dmgetdisklabel. Use disk_busy/disk_unbusy in dmstrategy to display LVM LV's in iostat output.
2009-03-08Fix tyop in previous.agc
2009-02-20Release tables before we drop reference on device, now creating device withhaad
nonexistent target fails and not ends with deadlock.
2009-02-19Add support for autoloading of device-mapper targets modules. Addhaad
dm_target_autoload function which tries to load target module. Fix two deadlocks in dm_table_load_ioctl error path(I forgot to call dm_dev_unbusy).