summaryrefslogtreecommitdiff
path: root/libparted/fs/amiga
diff options
context:
space:
mode:
authorPhillip Susi <psusi@ubuntu.com>2014-03-17 22:07:55 -0400
committerPhillip Susi <psusi@ubuntu.com>2014-04-18 12:55:21 -0400
commit80678bdd957cf49a9ccfc8b88ba3fb8b4c63fc12 (patch)
tree5e5396f7d88cbc096f5049f4687ce7a5b17507ef /libparted/fs/amiga
parentd0a4cc1b57750a92afb48b229e4791154afa322b (diff)
downloadparted-80678bdd957cf49a9ccfc8b88ba3fb8b4c63fc12.tar.gz
Fix filesystem detection on non 512 byte sectors
Enable probing for filesystems with non 512 byte sectors, and fix up each filesystem to correctly handle that. Remove unused field from the fs type structure listing acceptable sector sizes.
Diffstat (limited to 'libparted/fs/amiga')
-rw-r--r--libparted/fs/amiga/affs.c22
-rw-r--r--libparted/fs/amiga/apfs.c6
-rw-r--r--libparted/fs/amiga/asfs.c3
3 files changed, 6 insertions, 25 deletions
diff --git a/libparted/fs/amiga/affs.c b/libparted/fs/amiga/affs.c
index 6b7624d..a97cc54 100644
--- a/libparted/fs/amiga/affs.c
+++ b/libparted/fs/amiga/affs.c
@@ -55,7 +55,8 @@ _generic_affs_probe (PedGeometry* geom, uint32_t kind)
PED_ASSERT (geom != NULL);
PED_ASSERT (geom->dev != NULL);
-
+ if (geom->dev->sector_size != 512)
+ return NULL;
/* Finds the blocksize, prealloc and reserved values of the partition block */
if (!(part = ped_malloc (PED_SECTOR_SIZE_DEFAULT*blocksize))) {
ped_exception_throw(PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
@@ -216,97 +217,78 @@ static PedFileSystemOps _amufs5_ops = {
probe: _amufs5_probe,
};
-#define AFFS_BLOCK_SIZES ((int[5]){512, 1024, 2048, 4096, 0})
-#define AMUFS_BLOCK_SIZES ((int[2]){512, 0})
-
-
PedFileSystemType _affs0_type = {
next: NULL,
ops: &_affs0_ops,
name: "affs0",
- block_sizes: AFFS_BLOCK_SIZES
};
PedFileSystemType _affs1_type = {
next: NULL,
ops: &_affs1_ops,
name: "affs1",
- block_sizes: AFFS_BLOCK_SIZES
};
PedFileSystemType _affs2_type = {
next: NULL,
ops: &_affs2_ops,
name: "affs2",
- block_sizes: AFFS_BLOCK_SIZES
};
PedFileSystemType _affs3_type = {
next: NULL,
ops: &_affs3_ops,
name: "affs3",
- block_sizes: AFFS_BLOCK_SIZES
};
PedFileSystemType _affs4_type = {
next: NULL,
ops: &_affs4_ops,
name: "affs4",
- block_sizes: AFFS_BLOCK_SIZES
};
PedFileSystemType _affs5_type = {
next: NULL,
ops: &_affs5_ops,
name: "affs5",
- block_sizes: AFFS_BLOCK_SIZES
};
PedFileSystemType _affs6_type = {
next: NULL,
ops: &_affs6_ops,
name: "affs6",
- block_sizes: AFFS_BLOCK_SIZES
};
PedFileSystemType _affs7_type = {
next: NULL,
ops: &_affs7_ops,
name: "affs7",
- block_sizes: AFFS_BLOCK_SIZES
};
PedFileSystemType _amufs_type = {
next: NULL,
ops: &_amufs_ops,
name: "amufs",
- block_sizes: AMUFS_BLOCK_SIZES
};
PedFileSystemType _amufs0_type = {
next: NULL,
ops: &_amufs0_ops,
name: "amufs0",
- block_sizes: AMUFS_BLOCK_SIZES
};
PedFileSystemType _amufs1_type = {
next: NULL,
ops: &_amufs1_ops,
name: "amufs1",
- block_sizes: AMUFS_BLOCK_SIZES
};
PedFileSystemType _amufs2_type = {
next: NULL,
ops: &_amufs2_ops,
name: "amufs2",
- block_sizes: AMUFS_BLOCK_SIZES
};
PedFileSystemType _amufs3_type = {
next: NULL,
ops: &_amufs3_ops,
name: "amufs3",
- block_sizes: AMUFS_BLOCK_SIZES
};
PedFileSystemType _amufs4_type = {
next: NULL,
ops: &_amufs4_ops,
name: "amufs4",
- block_sizes: AMUFS_BLOCK_SIZES
};
PedFileSystemType _amufs5_type = {
next: NULL,
ops: &_amufs5_ops,
name: "amufs5",
- block_sizes: AMUFS_BLOCK_SIZES
};
diff --git a/libparted/fs/amiga/apfs.c b/libparted/fs/amiga/apfs.c
index 9f9e6e0..2d2cbe1 100644
--- a/libparted/fs/amiga/apfs.c
+++ b/libparted/fs/amiga/apfs.c
@@ -48,6 +48,8 @@ _generic_apfs_probe (PedGeometry* geom, uint32_t kind)
PED_ASSERT (geom != NULL);
PED_ASSERT (geom->dev != NULL);
+ if (geom->dev->sector_size != 512)
+ return NULL;
/* Finds the blocksize and reserved values of the partition block */
if (!(part = ped_malloc (PED_SECTOR_SIZE_DEFAULT*blocksize))) {
@@ -113,17 +115,13 @@ static PedFileSystemOps _apfs2_ops = {
probe: _apfs2_probe,
};
-#define APFS_BLOCK_SIZES ((int[2]){512, 0})
-
PedFileSystemType _apfs1_type = {
next: NULL,
ops: &_apfs1_ops,
name: "apfs1",
- block_sizes: APFS_BLOCK_SIZES
};
PedFileSystemType _apfs2_type = {
next: NULL,
ops: &_apfs2_ops,
name: "apfs2",
- block_sizes: APFS_BLOCK_SIZES
};
diff --git a/libparted/fs/amiga/asfs.c b/libparted/fs/amiga/asfs.c
index f7b4ed0..5824881 100644
--- a/libparted/fs/amiga/asfs.c
+++ b/libparted/fs/amiga/asfs.c
@@ -62,6 +62,8 @@ _asfs_probe (PedGeometry* geom)
PED_ASSERT (geom != NULL);
PED_ASSERT (geom->dev != NULL);
+ if (geom->dev->sector_size != 512)
+ return NULL;
/* Finds the blocksize of the partition block */
if (!(part = ped_malloc (PED_SECTOR_SIZE_DEFAULT*blocksize))) {
@@ -124,5 +126,4 @@ PedFileSystemType _asfs_type = {
next: NULL,
ops: &_asfs_ops,
name: "asfs",
- block_sizes: ((int[2]){512, 0})
};