summaryrefslogtreecommitdiffstats
path: root/Create.c
Commit message (Collapse)AuthorAgeFilesLines
* Create arrays via metadata-updateNeil Brown2008-07-121-7/+10
| | | | | Support creating arrays inside an active ddf container by sending a metadata update over a pipe to mdmon.
* Remove silly convention that major='-1' means 'zero superblock'.Neil Brown2008-07-121-1/+0
| | | | Use 'info pointer is NULL' instead.
* Remove getinfo_super_n and do some other cleaning up.Neil Brown2008-07-121-36/+48
| | | | | Getting close to a sensible description of what some of the superswitch methods are supposed to do!
* Add subarray field to supertype.Neil Brown2008-07-121-3/+3
| | | | | | | | | When loading the metadata for a subarray (super_by_fd), we set ->subarray to be the name read from md/metadata_version so that getinfo_super can return info about the correct array. With this we can differentiate between a container and an array within the container by looking at ->subarray[0].
* Remove 'major' from superswitch.Neil Brown2008-07-121-10/+15
| | | | It isn't generally meaningful.
* Always assume_clean for raid0, linear, multipath, faultyNeil Brown2008-07-111-0/+2
| | | | | | For arrays that don't have redundancy (raid0, linear etc), the clean/dirty distinction doesn't mean anything. So always 'assume clean' for these arrays.
* Discard st->container_memberNeil Brown2008-05-271-8/+4
| | | | | | 'container_member' isn't really a well defined concept. Each metadata might enumerate members differently, so just let each format /mdX/YYYY as appropriate.
* Remove st->text_version in favour of info->text_versionNeil Brown2008-05-271-1/+4
| | | | | | | I want the metadata handler to have more control over the 'version', particularly for arrays which are members of containers. So discard st->text_version and instead use info->text_version which getinfo_super can initialise.
* auto-start mdmon on --createNeil Brown2008-05-271-0/+53
| | | | | | FIXME uses sill hardcoded path. Need --assemble too.
* Remove 'fd' arg from sysfs_add_diskNeil Brown2008-05-271-3/+2
| | | | | It it never used, and removing means there are several 'open's that can go.
* imsm: create supportDan Williams2008-05-151-2/+2
| | | | | | | | | From: Dan Williams <dan.j.williams@intel.com> This should probably be made into a generic 'external' capability rather than hardcoding 'ddf' and 'imsm'. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Create a container memberNeil Brown2008-05-151-1/+9
| | | | From: Neil Brown <neilb@suse.de>
* Can now mostly assemble DDF arraysNeil Brown2008-05-151-6/+22
|
* More ddf stuffNeil Brown2008-05-151-11/+12
|
* more ddf stuffNeil Brown2008-05-151-5/+48
| | | | | | Create a BVD in a DDF Do not actually assemble it yet...
* Initial DDF support code.Dan Williams2008-05-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | Create a ddf array by naming the device /dev/ddf* or specifying metadata 'ddf'. If ddf is specified with no level, assume a container (indeed, anything else would be wrong). **Need to use text_Version to set external metadata... More ddf support Load a ddf container. Now --examine /dev/ddf works. super-ddf: fix compile warning From: Dan Williams <dan.j.williams@intel.com> super-ddf.c:723: format %lu expects type long unsigned int, but argument 3 has type unsigned int Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Some support for external metadata.Neil Brown2008-05-151-5/+28
| | | | Allow specifying metadata type when creating arrays etc.
* Change write_init_super to be called only once.Neil Brown2008-05-151-22/+19
| | | | | | | | | | | | | | | | | | | | | The current model for creating arrays involves writing a superblock to each device in the array. With containers (as with DDF), that model doesn't work. Every device in the container may need to be updated for an array made from just some the devices in a container. So instead of calling write_init_super for each device, we call it once for the array and have it iterate over all the devices in the array. To help with this, ->add_to_super now passes in an 'fd' and name for the device. These get saved for use by write_init_super. So add_to_super takes ownership of the fd, and write_init_super will close it. This information is stored in the new 'info' field of supertype. As part of this, write_init_super now removes any old traces of raid metadata rather than doing this in common code.
* Reduce openning of dev in create.Neil Brown2008-05-151-10/+8
| | | | | | | Now that validate_geometry opens and checks the device, we don't need to do it as much in top level Create. We only need it to check for old array or filesystem info. So only open the device at that place.
* Add 'container' level and ->validate_geometry method.Neil Brown2008-05-151-21/+35
| | | | These will be used for ddf.
* Allow creation of a RAID6 with a single missing device.Neil Brown2008-04-281-2/+18
| | | | | | | | This did not work before as we couldn't mark it clean as there would be some parity blocks out of sync, and raid6 will not assemble a dirty degraded array. So make such arrays doubly degraded (the last device becomes a spare) and clean.
* Use 'mdinfo' instead of special 'sysdev' structure.Neil Brown2007-12-141-38/+38
| | | | | there is needless duplicatiion between mdinfo and sysdev, so discard the latter.
* Drop the superblock arg from all metadata methods.Neil Brown2007-12-141-8/+8
| | | | It is now in the 'supertype'
* Add 'supertype' arg to almost all metadata methods.Neil Brown2007-12-141-4/+4
| | | | The 'superblock' will be moved into this structure soon.
* Allow metadata handlers to free their own superblock.Neil Brown2007-12-141-2/+2
| | | | | | As the metadata handler allocates the superblock, it should free it too. DDF will have a more complex 'superblock' which needs more complex freeing.
* Remove spaces/tabs from ends of lines.Neil Brown2007-12-141-3/+3
|
* A recent patch broke --create --level=faulty - fix it.Neil Brown2007-11-291-0/+1
| | | | Thanks to Martin Bene.
* Add some extra consistency checks based on level.Neil Brown2007-10-171-2/+17
| | | | Also use LEVEL_LINEAR, LEVEL_MULTIPATH in place of -1 or -4 in a few places.
* Create.c s/major/major_num/maximilian attems2007-09-241-4/+4
| | | | | | | don't shadow the major() function by int major. Signed-off-by: maximilian attems <max@stro.at> Signed-off-by: Neil Brown <neilb@suse.de>
* Enhance raid4 support: --assemble and --monitor wasn't quite happy with it.Doug Ledford2007-07-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | From: Doug Ledford <dledford@redhat.com> This one actually does a couple things. Mainly related to raid4, but kinda touches other raid levels some. When creating a raid4 array, treat it like a raid5 array in that we create it in degraded mode by default and add the last disk as a spare. Besides speeding things up, this has a second effect that it makes mdadm more consistent. In order to create a degraded raid5 array, you need only passing missing as one of the devices. For a degraded raid4 array, prior to this patch, you must pass assume-clean or else it refuses to create the array. Even force won't make it work without assume-clean. With the patch, raid4 behaves identical to raid5. Separate from that, the monitor functionality completely ignores raid4 arrays. That seems to stem from the code that checks to see if the array is part of a long list of types. It seems easier to check which array types *aren't* redundant instead of listing the ones that are redundant and missing some of them. This makes the monitor service actually watch raid4 arrays.
* Improve error message when trying to create an array that already exists.Doug Ledford2007-07-091-1/+11
| | | | | | | | | From: Doug Ledford <dledford@redhat.com> Simple bugfix. If an array already exists and we are asked to create this array, error out with an error message that makes sense to people instead of an error that the SET_ARRAY_INFO ioctl had an invalid argument. Plus a typo correction.
* Improve error message for adding bitmap to a level that cannot support it.Neil Brown2007-05-211-5/+5
| | | | Also give error on --build if no devices given.
* Support --uuid= with --create to choose your own UUID.Neil Brown2006-12-141-2/+2
|
* Central calls to ioctl BLKGETSIZENeil Brown2006-12-141-13/+1
| | | | Instead of opencoding the same thing everywhere.
* Improve allocation and use of space for bitmaps in version1 metadataNeil Brown2006-12-141-1/+2
| | | | | | | | | | Depending on the size of the array we reserve space for up to 128K of bitmap, and we use it where possible. When hot-adding to a version 1.0 we can still only use the 3K at the end though - need a sysfs interface to improve that. If a small chunksize is requested on Create, we don't auto-enlarge the reserved space - this still needs to be fixed.
* Fix bugs related to raid10 and the new offset layout.Neil Brown2006-10-191-1/+1
| | | | | Need to mask of bits above the bottom 16 when calculating number of copies.
* Remove partitions from components of an md arrayNeil Brown2006-10-131-0/+1
| | | | They do nothing but cause confusion.
* Minor improvement in name auto-chosen for version-1 superblocks.Neil Brown2006-08-111-1/+8
| | | | | /dev/md_d0 should have name 'd0' by default to make /dev/md/d0.
* Tidyup automatic name choice for v-1 arraysNeil Brown2006-08-071-2/+9
| | | | /dev/md_d0 now becomes '0', not '_d0'.
* More consistent honoring of --configfileNeil Brown2006-06-261-1/+1
| | | | | Never use /etc/mdadm.conf if --config file is given (previously some code used one, some used the other).
* Allow default metadata to be specified in mdadm.confNeil Brown2006-06-021-0/+5
| | | | | | | CREATE metadata=1 in mdadm.conf will cause version-1 superblocks to be the default. Signed-off-by: Neil Brown <neilb@suse.de>
* Set default name for v1 array based on device name.Neil Brown2006-05-261-0/+11
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Make homehost information appear in superblock.Neil Brown2006-05-191-2/+2
| | | | | | | | When an array is created, if the homehost is know, the superblock gets it, either in the uuid, (via sha1) or in the name field. Signed-off-by: Neil Brown <neilb@suse.de>
* Just updaqte copyright dates and email addressNeil Brown2006-05-191-1/+1
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Limit size of bitmap to 2million chunks.Neil Brown2006-05-151-3/+0
| | | | | | | | When creating a file bitmap, choose a default size that results in fewer than 2^21 chunks. Without this kmalloc failure in the kernel becomes likely. Signed-off-by: Neil Brown <neilb@suse.de>
* Kill old superblocks on create.Neil Brown2006-03-281-0/+2
| | | | | | | Make sure old-version superblocks are not around to confuse anything when a new array is created. Signed-off-by: Neil Brown <neilb@suse.de>
* Prefer version-1 superblocks for v.large devices.Neil Brown2006-01-311-0/+21
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Enable support for v.large raid1.Neil Brown2006-01-271-10/+10
| | | | | | | clean up 'long long' usage for size of array, so that with v-1 superblocks a raid1 larger than 2TB is possible. Signed-off-by: Neil Brown <neilb@suse.de>
* Minor fixesNeil Brown2006-01-271-0/+2
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Assorted fixes...Neil Brown2006-01-271-1/+1
| | | | Signed-off-by: Neil Brown <neilb@suse.de>