MKFS UPDATE FOR SPARSE FILES
Owner: TaoMa
OVERVIEW
The disk layout for ocfs2 volume will be changed for sparse files in 1.4, so mkfs.ocfs2 have to be modified to fit this new feature. And since we may have many new features in the ocfs 1.4 and we may also need to keep the compatibility with the boxed runned in 1.2.x, it is necessary to make mkfs.ocfs2 more flexible with the new added feature. So this modification of mkfs.ocfs will not only benefit sparse files, but also many new features which will be added in ocfs2 in the future, such as unwritten extents etc.
INTERFACE OVERVIEW
mkfs.ocfs2 [--fs-feature-level=[default|max-compat|max-features]] [--fs-features=[[no]sparse,[no]unwritten,[no]backup-super,[no]local]]
fs-feature-level
- This option is used to combined a series of flags so that the users don't need to remember the specific features. Currently, there are 3 types:
- default: It includes all the features which will be shipped in the standard 1.4.x.
- max-compat: It is used for compatiblity with ocfs2-1.2.x. So If we mkfs by this flag, the volume can be used by both ocfs2-1.2.x and ocfs2-1.4.x.
- max-features: It includes all the features we put into the ocfs2. So the volume formatted by this flag will have all the newest features included. The fetures we can select now are local, sparse, backup_sb and unwritten.
fs-features
This option is used as an auxiliary option for "--fs-feature-level". So if a user want to set/disable a feature explicitly, he will use this option. Currently, there are only 4 different features and they are sparse files,unwritten extents, backup super block and local mount.
FEATURE LEVEL DETAIL
Three static feature sets will be recorded to indicate the 3 levels: default, max-compat and max-feature. Currently the flags for these 3 levels are:
- default:
- compat: OCFS2_FEATURE_COMPAT_BACKUP_SB(if the volume is large enough for one backup super block)
- incompat: OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC
- ro_compat:0
- max-compat:
- compat: OCFS2_FEATURE_COMPAT_BACKUP_SB(if the volume is large enough for one backup super block)
- incompat:0
- ro_compat:0
- max-feature:
Since we still don't ship 1.4.x, this flag is the same as default. Once we shipped out the 1.4, any new features's flag will not included in default, but in max-feature only.