mirror of
https://gitlab.gnome.org/GNOME/gparted
synced 2024-07-02 15:58:47 +00:00
Compare commits
14 Commits
ac4f391080
...
f45f560368
Author | SHA1 | Date | |
---|---|---|---|
|
f45f560368 | ||
|
3d36d7ed2b | ||
|
3ebeadf050 | ||
|
61ac1a416f | ||
|
cc65eef59a | ||
|
a621623326 | ||
|
3b5da02943 | ||
|
31df2f2b75 | ||
|
f027809e73 | ||
|
76b27b9f7a | ||
|
b8304a141a | ||
|
aabba99594 | ||
|
ccdf14ddb4 | ||
|
7ca99a1577 |
86
src/Utils.cc
86
src/Utils.cc
|
@ -256,53 +256,54 @@ int Utils::get_max_partition_name_length( Glib::ustring & tabletype )
|
|||
|
||||
int Utils::get_filesystem_label_maxlength(FSType fstype)
|
||||
{
|
||||
// Only file systems which can have labels, either set when created or changed
|
||||
// afterwards, need a maximum length defining.
|
||||
switch (fstype)
|
||||
{
|
||||
//All file systems commented out are not supported for labelling
|
||||
// by either the new partition or label partition operations.
|
||||
case FS_BTRFS : return 255 ;
|
||||
case FS_EXFAT : return 11;
|
||||
case FS_EXT2 : return 16 ;
|
||||
case FS_EXT3 : return 16 ;
|
||||
case FS_EXT4 : return 16 ;
|
||||
case FS_BCACHEFS: return 32;
|
||||
case FS_BTRFS: return 255;
|
||||
case FS_EXFAT: return 11;
|
||||
case FS_EXT2: return 16;
|
||||
case FS_EXT3: return 16;
|
||||
case FS_EXT4: return 16;
|
||||
|
||||
// mkfs.f2fs supports labels up to 512 characters, however only blkid is
|
||||
// used to read the label and that only displays the first 127 characters.
|
||||
case FS_F2FS : return 127;
|
||||
case FS_FAT16 : return 11 ;
|
||||
case FS_FAT32 : return 11 ;
|
||||
//mkfs.hfsplus can create hfs and hfs+ file systems with labels up to 255
|
||||
// characters. However there is no specific tool to read the labels and
|
||||
// blkid, the only tool currently available, only display the first 27
|
||||
// and 63 character respectively.
|
||||
// Reference:
|
||||
// util-linux-2.20.1/libblkid/src/superblocks/hfs.c:struct hfs_mdb
|
||||
case FS_HFS : return 27 ;
|
||||
case FS_HFSPLUS : return 63 ;
|
||||
//mkfs.jfs and jfs_tune can create and update labels to 16 characters but
|
||||
// only displays the first 11 characters. This is because version 1 jfs
|
||||
// file systems only have an 11 character field for the label but version
|
||||
// 2 jfs has extra fields containing a 16 character label. mkfs.jfs
|
||||
// writes the extra fields containing the 16 character label, but then
|
||||
// sets it to version 1 jfs. It does this to be backwardly compatible
|
||||
// with jfs before 1.0.18, released May 2002. Blkid does display the
|
||||
// full 16 character label by just ignoring the file system version.
|
||||
// As using jfs_tune to get the label stick with an 11 character limit.
|
||||
// References:
|
||||
// jfsutils-1.1.15/tune/tune.c:main()
|
||||
// jfsutils-1.1.15/mkfs/mkfs.c:create_aggregate()
|
||||
// http://jfs.cvs.sourceforge.net/viewvc/jfs/jfsutils/NEWS?revision=HEAD
|
||||
case FS_JFS : return 11 ;
|
||||
case FS_LINUX_SWAP : return 15 ;
|
||||
//case FS_LVM2_PV : return ;
|
||||
case FS_MINIX : return 0; // MINIX doesn't support labelling.
|
||||
case FS_NILFS2 : return 80 ;
|
||||
case FS_NTFS : return 128 ;
|
||||
case FS_REISER4 : return 16 ;
|
||||
case FS_REISERFS : return 16 ;
|
||||
case FS_UDF : return 126; // and only 63 if label contains character above U+FF
|
||||
case FS_XFS : return 12 ;
|
||||
case FS_F2FS: return 127;
|
||||
case FS_FAT16: return 11;
|
||||
case FS_FAT32: return 11;
|
||||
|
||||
default : return 30 ;
|
||||
// mkfs.hfsplus can create hfs and hfs+ file systems with labels up to 255
|
||||
// characters. However there is no specific tool to read the labels and
|
||||
// blkid, the only tool currently available, only display the first 27 and
|
||||
// 63 character respectively.
|
||||
// Reference:
|
||||
// util-linux-2.20.1/libblkid/src/superblocks/hfs.c:struct hfs_mdb
|
||||
case FS_HFS: return 27;
|
||||
case FS_HFSPLUS: return 63;
|
||||
|
||||
// mkfs.jfs and jfs_tune can create and update labels to 16 characters but
|
||||
// only displays the first 11 characters. This is because version 1 jfs
|
||||
// file systems only have an 11 character field for the label but version
|
||||
// 2 jfs has extra fields containing a 16 character label. mkfs.jfs
|
||||
// writes the extra fields containing the 16 character label, but then
|
||||
// sets it to version 1 jfs. It does this to be backwardly compatible
|
||||
// with jfs before 1.0.18, released May 2002. Blkid does display the full
|
||||
// 16 character label by just ignoring the file system version. As using
|
||||
// jfs_tune to read the label stick with an 11 character limit.
|
||||
// References:
|
||||
// jfsutils-1.1.15/tune/tune.c:main()
|
||||
// jfsutils-1.1.15/mkfs/mkfs.c:create_aggregate()
|
||||
// http://jfs.cvs.sourceforge.net/viewvc/jfs/jfsutils/NEWS?revision=HEAD
|
||||
case FS_JFS: return 11;
|
||||
case FS_LINUX_SWAP: return 15;
|
||||
case FS_NILFS2: return 80;
|
||||
case FS_NTFS: return 128;
|
||||
case FS_REISER4: return 16;
|
||||
case FS_REISERFS: return 16;
|
||||
case FS_UDF: return 126; // and only 63 if label contains character above U+FF
|
||||
case FS_XFS: return 12;
|
||||
default: return 30;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -408,6 +409,7 @@ const Glib::ustring Utils::get_filesystem_kernel_name( FSType fstype )
|
|||
{
|
||||
switch ( fstype )
|
||||
{
|
||||
case FS_BCACHEFS : return "bcachefs";
|
||||
case FS_BTRFS : return "btrfs";
|
||||
case FS_EXFAT : return "exfat";
|
||||
case FS_EXT2 : return "ext2";
|
||||
|
|
Loading…
Reference in New Issue
Block a user