summaryrefslogtreecommitdiffstats
path: root/sbin/mdconfig/mdconfig.c
Commit message (Collapse)AuthorAgeFilesLines
* Resolve fflag with realpath().delphij2013-07-311-1/+3
| | | | MFC after: 2 weeks
* When listing with -f, skip all memory disks that are not vnode-backed.delphij2013-07-021-1/+2
| | | | | Noticed by: kevlo MFC after: 3 days
* - Use length of _PATH_DEV instead of a hardcoded value[*].hrs2013-06-211-6/+6
| | | | | | | - Use MD_NAME for "md". Pointed out by: trasz [*] MFC after: 1 week
* eturn -1 when the specified backing store file is not found in the mdhrs2013-06-201-5/+9
| | | | | | device list. MFC after: 1 week
* - Add "-f file" support to listing mode (-l). When a -f option ishrs2013-06-201-24/+30
| | | | | | | | | specified, only md(4) devices which have the specified file as backing store are displayed. - Use MD_NAME instead of "md". - Use _PATH_DEV instead of "/dev/". MFC after: 1 week
* Disallow attaching preloaded memory disks via ioctl.jh2012-11-211-3/+1
| | | | | | | | | | | | - The feature is dangerous because the kernel code didn't check validity of the memory address provided from user space. - It seems that mdconfig(8) never really supported attaching preloaded memory disks. - Preloaded memory disks are automatically attached during md(4) initialization. Thus there shouldn't be much use for the feature. PR: kern/169683 Discussed on: freebsd-hackers
* Make it possible to resize md(4) devices.trasz2012-07-071-16/+39
| | | | | Reviewed by: kib Sponsored by: FreeBSD Foundation
* Add missing "static".trasz2012-03-141-1/+1
|
* Rewrite option parsing in mdconfig(8). This makes it more user-friendlytrasz2012-01-271-118/+131
| | | | | | | by removing the ordering requirements and adding more descriptive error messages; it also makes it more readable and maintainable. Sponsored by: The FreeBSD Foundation
* Replace the beerware license on mdconfig(8) with standard 2-clause BSD.trasz2012-01-211-8/+25
| | | | Approved by: phk@
* Somewhere around the 473rd time I mistyped "mdconfig file" instead ofdes2011-04-291-20/+38
| | | | | | | "mdconfig -f file", I decided that it would be easier to make mdconfig DWIM than to teach my fingers to type the correct command line. MFC after: 3 weeks
* whitespace nit - sorry for the churndes2011-04-271-2/+2
|
* whitespace nitdes2011-04-271-1/+1
|
* Add a check to make sure the provider name is "mdN" before printing thebrucec2011-02-141-1/+5
| | | | | | | unit number. Suggested by: jh MFC after: 3 days
* Only print the unit number when invoked with the -n flag.brucec2011-02-131-1/+1
| | | | | | PR: bin/144300 Submitted by: arundel MFC after: 3 days
* Use "cylinder" instead of "cyl" for consistency.joel2010-11-131-1/+1
| | | | Reviewed by: phk
* Make mdconfig(8) WARNS=6 clean:jh2010-01-221-7/+6
| | | | | | | | | - Constify geom_config_get() name argument. - Add void keyword for usage(). - Initialize mdunit to NULL. - Don't call md_prthumanval() at all if length is NULL. Approved by: trasz (mentor)
* Print sizes up to INT64_MAX in md_prthumanval().jh2010-01-181-5/+6
| | | | | | PR: bin/125365 Approved by: trasz (mentor) MFC after: 2 weeks
* Add the possibility to specify "-o force" with "mdconfig -du".trasz2009-01-101-1/+11
| | | | | | Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
* Add -v (verbose) option to -l command, to show size and backing storemarck2008-06-211-6/+12
| | | | | | | of all md devices at one time. Approved by: phk MFC after: 2 weeks
* Fix exit code when using -l on a non-existent md(4) device.flz2007-11-161-3/+9
| | | | | | PR: conf/116177 Submitted by: Remi Guyomarch <rguyom@pobox.com> MFC after: 3 days
* Kris suggested that swap is a better choice as a default than malloc.n_hibma2007-02-201-3/+3
| | | | MFC: 1 week
* [Found the original diff I made, see previous commit for other part]n_hibma2007-02-201-2/+13
| | | | | | | | Assume '-a' and '-t malloc' flags for '-s <size>' (malloc ramdisk) if not specified. Reviewed by: phk (some time ago) MFC: 1 week
* Make attach the default for -f. That wayn_hibma2007-02-201-1/+5
| | | | | | | | | mdconfig -f image works like a charm. Reviewed by: phk (some time ago) MFC: 1 week
* Unbreak the build.jasone2006-03-271-6/+1
|
* For now, bring back some of the old bits as a fix for specifying md(4)wkoszek2006-03-271-0/+7
| | | | | | | | | device number at creation time with -u option. Together with XMLizing mdconfig(8), I broke this functionality. This change is temporary. Complete fix will be commited soon. Approved by: cognet (mentor)
* Teach md(4) and mdconfig(8) how to understand XML. Right now there won't bewkoszek2006-03-261-63/+156
| | | | | | | | | | | | a problem with listing large number of md(4) devices. Either 'list' or 'query' mode uses XML. Additionally, new functionality was introduced. It's possible to pass multiple devices to -u: # ./mdconfig -l -u md0,md1 Approved by: cognet (mentor)
* Keep proper order of includes. Additionally, sort them. Make functions usedwkoszek2006-03-261-23/+20
| | | | | | in that file static. Approved by: cognet (mentor)
* Use kld(3) for loading geom_md.ko.pjd2006-02-181-20/+3
|
* Sort the list results by the unit number. The list returned by thedd2005-12-221-3/+13
| | | | | | | | kernel is in the order the devices were made, which is not useful to the user. Also, remove the "%d more" test since the kernel does not return the complete count in md_pad[0] (maybe it should?). Submitted by: Wojciech A. Koszek
* Rename GEOM class kernel module g_md.ko to geom_md.ko for consistencypjd2005-11-111-27/+12
| | | | | | | | | | with the rest. mdconfig.c: Simplify mdmaybeload() function. mdioctl.h: Removed (now unused) #define. loader.conf: Sort GEOM classes properly. OK'ed by: phk
* When using files as backing stores for devices, and the user has requested thecsjp2005-08-301-0/+11
| | | | | | | | | | | | | device be created read+write, check to see if the backing store is read only through the use of the access(2) system call. If this check fails returning EACCES, EPERM or EROFS then gracefully downgrade the access to read only. Also print a warning message to stderr, informing the user that the access mode they requested is not available. This behavior used to be handled by md(4) but was changed in revision 1.154 Discussed with: pjd, phk, Dario Freni <saturnero at freesbie dot org> Reviewed by: phk
* We can specify device size in bytes. Document this in usage.pjd2005-03-011-2/+3
|
* Document the terabyte "-s" parameter in the usage string.mr2005-02-211-1/+2
| | | | Split the usage line to not exceed 80 chars.
* Sync program's usage() with manpage's SYNOPSIS.ru2005-02-101-1/+1
|
* Allow to specify device size in bytes.pjd2005-01-221-0/+2
| | | | MFC after: 1 week
* Rewrite piece of code which I committed some time ago that allows topjd2004-12-271-1/+5
| | | | | | | | | show file name for 'mdconfig -l -u <x>' command. This allows to preserve API/ABI compatibility with version 0 (that's why I changed version number back to 0) and will allow to merge this change to RELENG_5. MFC after: 5 days
* Sync usage() with manpage SYNOPSIS and code.ru2004-11-131-4/+6
|
* For file backed md(4) devices output their source file viapjd2004-11-061-2/+7
| | | | | 'mdconfig -l -u <unit>'. Bump version number, as this change breaks ABI/API.
* If there aren't any devices to list, output nothing instead of andd2004-11-061-10/+2
| | | | | | empty line. This is consistent with other utilities. While I'm here, remove artifacts of the previous list implementation.
* - Make md(4) 64-bit clean.pjd2004-09-161-16/+41
| | | | | | | | | After this change it should be possible to use very big md(4) devices. - Clean up and simplify the code a bit. - Use humanize_number(3) to print size of md(4) devices. - Add 't' suffix which stands for terabyte. - Make '-S' to really work with all types of devices. - Other minor changes.
* add support for documented readonly option...jmg2004-09-081-1/+5
| | | | | | | also print out the option that is unknow so that the user knows what (s)he did wrong.. MFC after: 3 days
* change the name of the md module, to g_md, introduce a define with thejmg2004-08-091-1/+1
| | | | name MD_MODNAME, and make mdconfig use this new define...
* Give better diagnostic for problems with backing files.phk2004-07-251-0/+4
|
* Fix a long-standing deadlock issue with vnode backed md(4) devices:phk2004-03-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | On vnode backed md(4) devices over a certain, currently undetermined size relative to the buffer cache our "lemming-syncer" can provoke a buffer starvation which puts the md thread to sleep on wdrain. This generally tends to grind the entire system to a stop because the event that is supposed to wake up the thread will not happen until a fair bit of the piled up I/O requests in the system finish, and since a lot of those are on a md(4) vnode backed device which is currently waiting on wdrain until a fair amount of the piled up ... you get the picture. The cure is to issue all VOP_WRITES on the vnode backing the device with IO_SYNC. In addition to more closely emulating a real disk device with a non-lying write-cache, this makes the writes exempt from rate-limited (there to avoid starving the buffer cache) and consequently prevents the deadlock. Unfortunately performance takes a hit. Add "async" option to give people who know what they are doing the old behaviour.
* Do not compare unsigned int values with ULONG_MAX. The comparison iskan2003-07-111-1/+1
| | | | always false on 64bit platforms and GCC 3.3.1 issues warning there.
* Add "-n" argument, which causes mdconfig to simply print the unitrwatson2003-06-111-5/+11
| | | | | | number X, rather than mdX, making it easier to script tests that use md devices but don't want to make assumptions about any existing md use (such as in diskless environments).
* Add a couple of undocumented test options to MD(4) to aid in regressionphk2003-04-091-1/+11
| | | | testting of GEOM.
* Give clearer diagnostics on some cases of invalidyar2003-04-011-0/+6
| | | | | | | combinations of mdconfig(8) command-line arguments. Make mdconfig(8) accept "-a -f file -o options" equally with "-a -f file" (assuming "-t vnode".)
* Add a "-S sectorsize" option to enable Kirk to find a bug :-)phk2003-03-031-2/+7
|
OpenPOWER on IntegriCloud