[parted-devel] [PATCH 6/6] libparted: no longer check for BLKPG ioctls

Petr Uzel petr.uzel at suse.cz
Mon Oct 15 08:31:55 UTC 2012


It should be safe to assume that BLKPG ioctls are available on all
systems used nowadays.

libparted/arch/linux.c (_have_blkpg): Remove function.
(linux_disk_commit): Don't call it.

Signed-off-by: Petr Uzel <petr.uzel at suse.cz>
---
 libparted/arch/linux.c |   23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 96a6b37..3da5573 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -2881,19 +2881,6 @@ _dm_reread_part_table (PedDisk* disk)
 }
 #endif
 
-static int
-_have_blkpg ()
-{
-        static int have_blkpg = -1;
-        int kver;
-
-        if (have_blkpg != -1)
-                return have_blkpg;
-
-        kver = _get_linux_version();
-        return have_blkpg = kver >= KERNEL_VERSION (2,4,0) ? 1 : 0;
-}
-
 /* Return nonzero upon success, 0 if something fails.  */
 static int
 linux_disk_commit (PedDisk* disk)
@@ -2902,17 +2889,9 @@ linux_disk_commit (PedDisk* disk)
         if (disk->dev->type == PED_DEVICE_DM)
                 return _dm_reread_part_table (disk);
 #endif
-        if (disk->dev->type != PED_DEVICE_FILE) {
-
-		/* We now require BLKPG support.  If this assertion fails,
-		   please write to the mailing list describing your system.
-		   Assuming it's never triggered, ...
-		   FIXME: remove this assertion in 2012.  */
-		assert (_have_blkpg ());
-
+        if (disk->dev->type != PED_DEVICE_FILE)
 		if (!_disk_sync_part_table (disk))
 			return 0;
-        }
 
         return 1;
 }
-- 
1.7.10.4




More information about the parted-devel mailing list