| 141 | |
| 142 | |
| 143 | Try<string> typeName(uint32_t fsType) |
| 144 | { |
| 145 | // `typeNames` maps a filesystem id to its filesystem type name. |
| 146 | hashmap<uint32_t, string> typeNames = { |
| 147 | {FS_TYPE_AUFS , "aufs"}, |
| 148 | {FS_TYPE_BTRFS , "btrfs"}, |
| 149 | {FS_TYPE_CRAMFS , "cramfs"}, |
| 150 | {FS_TYPE_ECRYPTFS , "ecryptfs"}, |
| 151 | {FS_TYPE_EXTFS , "extfs"}, |
| 152 | {FS_TYPE_F2FS , "f2fs"}, |
| 153 | {FS_TYPE_GPFS , "gpfs"}, |
| 154 | {FS_TYPE_JFFS2FS , "jffs2fs"}, |
| 155 | {FS_TYPE_JFS , "jfs"}, |
| 156 | {FS_TYPE_NFSFS , "nfsfs"}, |
| 157 | {FS_TYPE_RAMFS , "ramfs"}, |
| 158 | {FS_TYPE_REISERFS , "reiserfs"}, |
| 159 | {FS_TYPE_SMBFS , "smbfs"}, |
| 160 | {FS_TYPE_SQUASHFS , "squashfs"}, |
| 161 | {FS_TYPE_TMPFS , "tmpfs"}, |
| 162 | {FS_TYPE_VXFS , "vxfs"}, |
| 163 | {FS_TYPE_XFS , "xfs"}, |
| 164 | {FS_TYPE_ZFS , "zfs"}, |
| 165 | {FS_TYPE_OVERLAY , "overlay"} |
| 166 | }; |
| 167 | |
| 168 | if (!typeNames.contains(fsType)) { |
| 169 | return Error("Unexpected filesystem type '" + stringify(fsType) + "'"); |
| 170 | } |
| 171 | |
| 172 | return typeNames[fsType]; |
| 173 | } |
| 174 | |
| 175 | |
| 176 | Try<MountInfoTable> MountInfoTable::read( |
no test coverage detected