summaryrefslogtreecommitdiffstats
path: root/mdadm.h
Commit message (Collapse)AuthorAgeFilesLines
* Create arrays via metadata-updateNeil Brown2008-07-121-0/+14
| | | | | Support creating arrays inside an active ddf container by sending a metadata update over a pipe to mdmon.
* Remove mgr_pipe for communicating from manage to monitor.Neil Brown2008-07-121-1/+0
| | | | | Data is being passed in shared memory, so the pipe is only being use as a wakeup. This can more easily be done with a thread-signal.
* Remove mon_pipe for communicating from monitor to managerNeil Brown2008-07-121-1/+0
| | | | | | The returned value was never used, and we don't really want this return path anyway as writing to a pipe could conceivably block, and the monitor must not block.
* Handle device removal from containerNeil Brown2008-07-121-0/+1
| | | | | | | This really should be done in mdadm, not mdmon. We ensure the device won't be suddenly commited as a hot-spare using O_EXCL, then check the 'holders' sysfs directory to make sure it is only in use once.
* Remove the multiple super_switchs for ddf.Neil Brown2008-07-121-0/+9
| | | | | It is simpler if there is just one, and the methods make decisions as appropriate.
* Remove getinfo_super_n and do some other cleaning up.Neil Brown2008-07-121-2/+4
| | | | | 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-1/+1
| | | | | | | | | 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].
* Add some comments to explain some of the bits of superswitch.Neil Brown2008-07-121-0/+104
|
* Hide subordinate superswitch structures.Neil Brown2008-07-121-2/+2
| | | | | | Only one superswitch should be externally visible for each general type. Others which handle different flavours (e.g. container/data-array) should be internal only.
* Remove 'major' from superswitch.Neil Brown2008-07-121-1/+0
| | | | It isn't generally meaningful.
* Use text_version in map_file rather than major.minor.Neil Brown2008-07-121-3/+3
|
* imsm: 'volume' is the proper name for imsm container membersDan Williams2008-06-131-1/+1
| | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* sysfs: helper routine to retrieve the scsi idDan Williams2008-06-131-1/+1
| | | | | | imsm records this information in its metadata Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* sysfs: provide a helper function for locating scsi_generic interfacesDan Williams2008-06-131-1/+1
| | | | | | imsm records and validates this data in its metadata Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Support adding a spare to a degraded array.Neil Brown2008-06-121-0/+9
| | | | | When signalled by the monitor, the manager will find spares and add them to the array and initiate a recovery.
* Allow passing metadata update to the monitor.Neil Brown2008-06-121-1/+4
| | | | | | Code in manager can now just call queue_metadata_update with a (freeable) buf holding the update, and it will get passed to the monitor and written out.
* Parse the 'instance' part of external:/mdXX/INST in metadata handler.Neil Brown2008-05-271-1/+2
| | | | This give more flexability.
* Discard st->container_memberNeil Brown2008-05-271-2/+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/+0
| | | | | | | 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.
* Change mark_clean to set_array_state.Neil Brown2008-05-271-9/+8
| | | | DDF needs more fine grained understanding of the array state.
* auto-start mdmon on --createNeil Brown2008-05-271-0/+19
| | | | | | FIXME uses sill hardcoded path. Need --assemble too.
* Exit when there are no more arrays to manage.Neil Brown2008-05-271-0/+1
|
* Remove supertype->devfdNeil Brown2008-05-271-1/+0
| | | | It is never used.
* Remove stopped arrays.Neil Brown2008-05-271-1/+1
| | | | | | When an array becomes inactive, clean up and forget it. This involves signalling the manager.
* Set status of devices in ddf.Neil Brown2008-05-271-0/+8
| | | | Might work a little bit....
* Implement mark_clean for ddf and remove mark_dirty and mark_syncNeil Brown2008-05-271-2/+9
| | | | | | | mark_dirty is just a special case of mark_clean - with sync_pos == 0. mark_sync is not required. We don't modify the metadata when sync finishes. Only when the array becomes non-writeable at which point we use mark_clean to record how far the resync progressed.
* Remove 'fd' arg from sysfs_add_diskNeil Brown2008-05-271-1/+1
| | | | | It it never used, and removing means there are several 'open's that can go.
* add infrastructure to receive higher order commands, like remove_deviceDan Williams2008-05-151-1/+2
| | | | | | | | | | | From: Dan Williams <dan.j.williams@intel.com> Each md_message encapsulates a single command. A command includes an 'action' member which describes what if any data comes after the action. Communication with the monitor involves updating the active_cmd pointer and then writing to mgr_pipe. Pass/fail status is returned via mon_pipe. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* handle disk failuresDan Williams2008-05-151-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From: Dan Williams <dan.j.williams@intel.com> Added curr_state as a parameter to set_disk. Handlers look at this to record components failures, and set global 'degraded' or 'failed' status. When reading the state as faulty: 1/ mark the disk failed in the metadata 2/ write '-blocked' to the rdev state to allow the kernel's failure mechanism to advance 3/ the kernel will take away the drive's role in remove_and_add_spares() 4/ once the disk no longer has a role writing 'remove' to the rdev state will get the disk out of array. There is a window after writing '-blocked' where the kernel will return -EBUSY to remove requests. We rely on the fact that the disk will continue to show faulty so we lazily wait until the kernel is ready to remove the disk. If the manager thread needs to get the disk out of the way it can ping the monitor and wait, just like the replace_array() case. [buglet fix: swap the parameters of attr_match in read_dev_state] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* handle resync completionDan Williams2008-05-151-0/+1
| | | | | | From: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Merge mdmonNeil Brown2008-05-151-0/+35
|
* handle Manage_subdevs() for 'external' arraysDan Williams2008-05-151-0/+2
| | | | | | | | | From: Dan Williams <dan.j.williams@intel.com> 1/ Block attempts to add/remove devices from container members 2/ Forward add/remove requests to containers Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* set resync_start in Incremental_containerDan Williams2008-05-151-0/+1
| | | | | | | | | | From: Dan Williams <dan.j.williams@intel.com> Metadata handlers set mdinfo.resync_start depending on the state of the array. By default mdadm assumes the array is dirty and needs a full resync. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Set 'metadata_version' for container_member in Incremental_containerDan Williams2008-05-151-0/+1
| | | | | | From: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: initial Intel(R) Matrix Storage Manager supportDan Williams2008-05-151-0/+2
| | | | | | | | | | From: Dan Williams <dan.j.williams@intel.com> The following now work: --examine --examine --brief Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Create a container memberNeil Brown2008-05-151-0/+4
| | | | From: Neil Brown <neilb@suse.de>
* Can now mostly assemble DDF arraysNeil Brown2008-05-151-2/+10
|
* More ddf stuffNeil Brown2008-05-151-0/+5
|
* more ddf stuffNeil Brown2008-05-151-0/+2
| | | | | | Create a BVD in a DDF Do not actually assemble it yet...
* Initial DDF support code.Dan Williams2008-05-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | 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-0/+2
| | | | Allow specifying metadata type when creating arrays etc.
* Change write_init_super to be called only once.Neil Brown2008-05-151-4/+5
| | | | | | | | | | | | | | | | | | | | | 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.
* Add cpu_to_be convertions functions.Neil Brown2008-05-151-0/+14
| | | | DDF will uses these.
* Add 'container' level and ->validate_geometry method.Neil Brown2008-05-151-0/+7
| | | | These will be used for ddf.
* add --export option to --examineKay Sievers2008-05-061-3/+4
| | | | | | | From: Kay Sievers <kay.sievers@vrfy.org> Cc: David Zeuthen <david@fubar.dk> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
* Make device-special files for partitions when using --incrementalNeil Brown2008-05-051-1/+1
|
* Unify code into find_free_devnum.Neil Brown2008-05-051-0/+3
| | | | | Two places have code to find a free md device number. Make this a subroutine.
* diff -ru mdadm-2.6.4-orig/Query.c mdadm-2.6.4/Query.cNeil Brown2008-04-291-0/+1
|
* Replace sysarray with mdinfoNeil Brown2007-12-141-17/+9
| | | | | Sure, mdinfo is bigger, but having a uniform structure for lots of things will make life easier.
* Use 'mdinfo' instead of special 'sysdev' structure.Neil Brown2007-12-141-14/+8
| | | | | there is needless duplicatiion between mdinfo and sysdev, so discard the latter.