aboutsummaryrefslogtreecommitdiffstats
path: root/src/disk.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/disk.c')
-rw-r--r--src/disk.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/disk.c b/src/disk.c
index 3772862..c9a230f 100644
--- a/src/disk.c
+++ b/src/disk.c
@@ -1,5 +1,6 @@
#include "project.h"
+#include <linux/fs.h>
DISK *
@@ -45,7 +46,7 @@ disk_read (DISK * d, void *buf, uint64_t lba, int lbas)
if (read (d->fd, buf, lbas) != lbas)
{
perror ("read");
- // abort ();
+ // abort ();
}
}
void
@@ -72,3 +73,15 @@ disk_lbas (DISK * d)
{
return d->lbas;
}
+
+disk_reread_kernel_table (DISK * d)
+{
+ if (ioctl (d->fd, BLKRRPART, NULL))
+ {
+ perror ("Telling kernel to re-read partition table failed:");
+ }
+ else
+ {
+ fprintf (stderr, "Kernel has re-read partition table\n");
+ }
+}