summaryrefslogtreecommitdiff
path: root/libparted/arch
diff options
context:
space:
mode:
authorPhillip Susi <psusi@ubuntu.com>2013-12-23 15:28:22 -0500
committerPhillip Susi <psusi@ubuntu.com>2014-03-05 20:44:57 -0500
commit026736e9fed89ef00e6e6e84c7e422639ac2715c (patch)
treefbf50e4f80db8932c6767182ad0b53a2ebb3801f /libparted/arch
parent80f4f42c805ee37392c5cc43d8ac08772b7b1cf1 (diff)
downloadparted-026736e9fed89ef00e6e6e84c7e422639ac2715c.tar.gz
libparted: sync partitions > 16
The linux partition sync code was hard coded to only flush the first 16 partitions.
Diffstat (limited to 'libparted/arch')
-rw-r--r--libparted/arch/linux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 4376d17..71f5034 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -289,6 +289,8 @@ struct blkdev_ioctl_param {
static char* _device_get_part_path (PedDevice const *dev, int num);
static int _partition_is_mounted_by_path (const char* path);
+static unsigned int _device_get_partition_range(PedDevice const* dev);
+
static int
_read_fd (int fd, char **buf)
@@ -1581,6 +1583,7 @@ _flush_cache (PedDevice* dev)
{
LinuxSpecific* arch_specific = LINUX_SPECIFIC (dev);
int i;
+ int lpn = _device_get_partition_range(dev);
if (dev->read_only)
return;
@@ -1588,7 +1591,7 @@ _flush_cache (PedDevice* dev)
ioctl (arch_specific->fd, BLKFLSBUF);
- for (i = 1; i < 16; i++) {
+ for (i = 1; i < lpn; i++) {
char* name;
int fd;