bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fsys_fat.c : disk_read_hook logging accesses to FAT area


From: lode leroy
Subject: fsys_fat.c : disk_read_hook logging accesses to FAT area
Date: Thu, 07 Aug 2003 14:38:54 +0200

Hello.

I'm using fsys_fat to calculate a blocklist of a file.
I have replaced devread() to read data from the device.
I use disk_read_func to accumulate the blocklist.

Doing this, I also get accesses to the FAT itself logged.
I propose the following patch to remedy the problem.

could someone please reply wether or not this patch
is accepted/rejected?

-- lode

~/grub-0.93/stage2 $ diff -u fsys_fat.c fsys_fat.c.orig
--- fsys_fat.c  2003-08-07 14:40:05.000000000 +0200
+++ fsys_fat.c.orig     2003-08-07 14:35:49.000000000 +0200
@@ -207,17 +207,11 @@
         if (cached_pos < 0 ||
             (cached_pos + FAT_SUPER->fat_size) > 2*FAT_CACHE_SIZE)
           {
-             int rvl;
-             static void* backup_disk_read_hook;
             FAT_SUPER->cached_fat = (fat_entry & ~(2*SECTOR_SIZE - 1));
             cached_pos = (fat_entry - FAT_SUPER->cached_fat);
             sector = FAT_SUPER->fat_offset
               + FAT_SUPER->cached_fat / (2*SECTOR_SIZE);
-             backup_disk_read_hook = disk_read_hook;
-             disk_read_hook = NULL;
-             rvl = devread (sector, 0, FAT_CACHE_SIZE, (char*) FAT_BUF);
-             disk_read_hook = backup_disk_read_hook;
-             if (!rvl)
+             if (!devread (sector, 0, FAT_CACHE_SIZE, (char*) FAT_BUF))
               return 0;
           }
         next_cluster = * (unsigned long *) (FAT_BUF + (cached_pos >> 1));

_________________________________________________________________






reply via email to

[Prev in Thread] Current Thread [Next in Thread]