def xfs_mkfs_options(tune2fs_dict, mkfs_option):
 xfs_mapping = {'meta-data: isize': '-i size', 'meta-data: agcount': '-d agcount', 'meta-data: sectsz': '-s size', 'meta-data: attr': '-i attr', 'data: bsize': '-b size', 'data: imaxpct': '-i maxpct', 'data: sunit': '-d sunit', 'data: swidth': '-d swidth', 'data: unwritten': '-d unwritten', 'naming: version': '-n version', 'naming: bsize': '-n size', 'log: version': '-l version', 'log: sectsz': '-l sectsize', 'log: sunit': '-l sunit', 'log: lazy-count': '-l lazy-count', 'realtime: extsz': '-r extsize', 'realtime: blocks': '-r size', 'realtime: rtextents': '-r rtdev'}
 mkfs_option['-l size'] = (tune2fs_dict['log: bsize'] * tune2fs_dict['log: blocks'])
 for (key, value) in xfs_mapping.iteritems():
  mkfs_option[value] = tune2fs_dict[key]

def xfs_mkfs_options ( tune2fs_dict , mkfs_option ) : xfs_mapping = { 'meta-data: isize' : '-i size' , 'meta-data: agcount' : '-d agcount' , 'meta-data: sectsz' : '-s size' , 'meta-data: attr' : '-i attr' , 'data: bsize' : '-b size' , 'data: imaxpct' : '-i maxpct' , 'data: sunit' : '-d sunit' , 'data: swidth' : '-d swidth' , 'data: unwritten' : '-d unwritten' , 'naming: version' : '-n version' , 'naming: bsize' : '-n size' , 'log: version' : '-l version' , 'log: sectsz' : '-l sectsize' , 'log: sunit' : '-l sunit' , 'log: lazy-count' : '-l lazy-count' , 'realtime: extsz' : '-r extsize' , 'realtime: blocks' : '-r size' , 'realtime: rtextents' : '-r rtdev' } mkfs_option [ '-l size' ] = ( tune2fs_dict [ 'log: bsize' ] * tune2fs_dict [ 'log: blocks' ] ) for ( key , value ) in xfs_mapping . iteritems ( ) : mkfs_option [ value ] = tune2fs_dict [ key ]
maps filesystem tunables to their corresponding mkfs options .