[Aaru.Filesystems] Reformat and cleanup.

This commit is contained in:
2023-10-03 23:22:08 +01:00
parent 51f35c80d9
commit 7a608e0061
296 changed files with 21000 additions and 18286 deletions

View File

@@ -34,8 +34,14 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the New Implementation of a Log-structured File System v2</summary>
public sealed partial class NILFS2
{
#region Nested type: State
enum State : ushort
{
Valid = 0x0001, Error = 0x0002, Resize = 0x0004
Valid = 0x0001,
Error = 0x0002,
Resize = 0x0004
}
#endregion
}

View File

@@ -41,6 +41,8 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the New Implementation of a Log-structured File System v2</summary>
public sealed partial class NILFS2
{
#region IFilesystem Members
/// <inheritdoc />
public bool Identify(IMediaImage imagePlugin, Partition partition)
{
@@ -52,7 +54,7 @@ public sealed partial class NILFS2
if(sbAddr == 0)
sbAddr = 1;
uint sbSize = (uint)(Marshal.SizeOf<Superblock>() / imagePlugin.Info.SectorSize);
var sbSize = (uint)(Marshal.SizeOf<Superblock>() / imagePlugin.Info.SectorSize);
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0)
sbSize++;
@@ -89,7 +91,7 @@ public sealed partial class NILFS2
if(sbAddr == 0)
sbAddr = 1;
uint sbSize = (uint)(Marshal.SizeOf<Superblock>() / imagePlugin.Info.SectorSize);
var sbSize = (uint)(Marshal.SizeOf<Superblock>() / imagePlugin.Info.SectorSize);
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0)
sbSize++;
@@ -110,11 +112,11 @@ public sealed partial class NILFS2
var sb = new StringBuilder();
sb.AppendLine(Localization.NILFS2_filesystem);
sb.AppendFormat(Localization.Version_0_1, nilfsSb.rev_level, nilfsSb.minor_rev_level).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, 1 << (int)(nilfsSb.log_block_size + 10)).AppendLine();
sb.AppendFormat(Localization._0_bytes_in_volume, nilfsSb.dev_size).AppendLine();
sb.AppendFormat(Localization.Version_0_1, nilfsSb.rev_level, nilfsSb.minor_rev_level).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_block, 1 << (int)(nilfsSb.log_block_size + 10)).AppendLine();
sb.AppendFormat(Localization._0_bytes_in_volume, nilfsSb.dev_size).AppendLine();
sb.AppendFormat(Localization._0_blocks_per_segment, nilfsSb.blocks_per_segment).AppendLine();
sb.AppendFormat(Localization._0_segments, nilfsSb.nsegments).AppendLine();
sb.AppendFormat(Localization._0_segments, nilfsSb.nsegments).AppendLine();
if(nilfsSb.creator_os == 0)
sb.AppendLine(Localization.Filesystem_created_on_Linux);
@@ -122,7 +124,7 @@ public sealed partial class NILFS2
sb.AppendFormat(Localization.Creator_OS_code_0, nilfsSb.creator_os).AppendLine();
sb.AppendFormat(Localization._0_bytes_per_inode, nilfsSb.inode_size).AppendLine();
sb.AppendFormat(Localization.Volume_UUID_0, nilfsSb.uuid).AppendLine();
sb.AppendFormat(Localization.Volume_UUID_0, nilfsSb.uuid).AppendLine();
sb.AppendFormat(Localization.Volume_name_0, StringHandlers.CToString(nilfsSb.volume_name, encoding)).
AppendLine();
@@ -153,4 +155,6 @@ public sealed partial class NILFS2
metadata.Clusters = nilfsSb.dev_size / metadata.ClusterSize;
}
#endregion
}

View File

@@ -37,10 +37,16 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the New Implementation of a Log-structured File System v2</summary>
public sealed partial class NILFS2 : IFilesystem
{
#region IFilesystem Members
/// <inheritdoc />
public string Name => Localization.NILFS2_Name;
/// <inheritdoc />
public Guid Id => new("35224226-C5CC-48B5-8FFD-3781E91E86B6");
/// <inheritdoc />
public string Author => Authors.NataliaPortillo;
#endregion
}

View File

@@ -37,6 +37,8 @@ namespace Aaru.Filesystems;
/// <summary>Implements detection of the New Implementation of a Log-structured File System v2</summary>
public sealed partial class NILFS2
{
#region Nested type: Superblock
[StructLayout(LayoutKind.Sequential, Pack = 1)]
readonly struct Superblock
{
@@ -83,4 +85,6 @@ public sealed partial class NILFS2
public readonly ulong feature_compat_ro;
public readonly ulong feature_incompat;
}
#endregion
}