[PATCH] md: Allow md to select between superblock formats
The code to understand a specific superblock format is
already highly localised in md. This patch defines a
user-space interface for selecting which superblock format
to use, and obeys that selection.
Md currently has a concept of 3 version numbers:
A major version number
A minor version number
A patch version number
There historically seems to be some confusion about whether
these refer to a version of the superblock layout,
or a version of the software.
We will now define that:
the "major_version" defines the superblock handler.
'0' is the current superblock format. All new formats
will need new numbers.
the "minor_version" can specify minor variations in the
superblock, such as different location on the device
the "patch_version" will be used to indicate new extenstions
to the software.. patch_version=1 will mean multiple superblock
support.
A superblock version number is selected by specifing major_version
in SET_ARRAY_INFO ioctl.
This patch:
Updates Documentation/md.txt with details of new interface.
Generalises desc_nr handling and makes sure that an array never
has two devices with the same desc_nr.
makes sure mddev->major_version is always valid and is 0 by default.
uses mddev->major_version to select superblock handlers.
Modifies set_array_info to just record version number if raid_disks==0
Makes sure max_disks is always set correctly.
Determines device size when reading superblock, or a hot-add/add-new.