mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
General cleanup and refactor.
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
@@ -38,8 +40,6 @@ using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.Filesystems;
|
||||
|
||||
// Information from the Linux kernel
|
||||
/// <inheritdoc />
|
||||
/// <summary>Implements detection of the Linux extended filesystem</summary>
|
||||
@@ -78,21 +78,20 @@ public sealed class extFS : IFilesystem
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return false;
|
||||
|
||||
byte[] sb = new byte[512];
|
||||
var sb = new byte[512];
|
||||
|
||||
if(sbOff + 512 > sbSector.Length)
|
||||
return false;
|
||||
|
||||
Array.Copy(sbSector, sbOff, sb, 0, 512);
|
||||
|
||||
ushort magic = BitConverter.ToUInt16(sb, 0x038);
|
||||
var magic = BitConverter.ToUInt16(sb, 0x038);
|
||||
|
||||
return magic == EXT_MAGIC;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information,
|
||||
Encoding encoding)
|
||||
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
||||
{
|
||||
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
||||
information = "";
|
||||
@@ -113,7 +112,7 @@ public sealed class extFS : IFilesystem
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return;
|
||||
|
||||
byte[] sbSector = new byte[512];
|
||||
var sbSector = new byte[512];
|
||||
Array.Copy(sblock, sbOff, sbSector, 0, 512);
|
||||
|
||||
var extSb = new SuperBlock
|
||||
|
||||
Reference in New Issue
Block a user