]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Speed up consecutive hostdisk operations on the same device.
authorColin Watson <cjwatson@ubuntu.com>
Sun, 14 Mar 2010 15:39:14 +0000 (15:39 +0000)
committerColin Watson <cjwatson@ubuntu.com>
Sun, 14 Mar 2010 15:39:14 +0000 (15:39 +0000)
* util/hostdisk.c (struct grub_util_biosdisk_data): New structure.
(grub_util_biosdisk_open): Initialise disk->data.
(struct linux_partition_cache): New structure.
(linux_find_partition): Cache partition start positions; these are
expensive to compute on every read and write.
(open_device): Cache open file descriptor in disk->data, so that we
don't have to reopen it and flush the buffer cache for consecutive
operations on the same device.
(grub_util_biosdisk_close): New function.
(grub_util_biosdisk_dev): Set `close' member.

* conf/common.rmk (grub_probe_SOURCES): Add kern/list.c.
* conf/i386-efi.rmk (grub_setup_SOURCES): Likewise.
* conf/i386-pc.rmk (grub_setup_SOURCES): Likewise.
* conf/sparc64-ieee1275.rmk (grub_setup_SOURCES): Likewise.
* conf/x86_64-efi.rmk (grub_setup_SOURCES): Likewise.

1  2 
ChangeLog
conf/sparc64-ieee1275.rmk
util/hostdisk.c

diff --cc ChangeLog
index faa88bbe27041625362cd95c2616a05e0ccf030f,90bbce0e2350c3ce204895e230dffdafd204af35..b79c05f63db8a59edac3031a9bae44fae9bb7004
+++ b/ChangeLog
++2010-03-14  Colin Watson  <cjwatson@ubuntu.com>
++
++      Speed up consecutive hostdisk operations on the same device.
++
++      * util/hostdisk.c (struct grub_util_biosdisk_data): New structure.
++      (grub_util_biosdisk_open): Initialise disk->data.
++      (struct linux_partition_cache): New structure.
++      (linux_find_partition): Cache partition start positions; these are
++      expensive to compute on every read and write.
++      (open_device): Cache open file descriptor in disk->data, so that we
++      don't have to reopen it and flush the buffer cache for consecutive
++      operations on the same device.
++      (grub_util_biosdisk_close): New function.
++      (grub_util_biosdisk_dev): Set `close' member.
++
++      * conf/common.rmk (grub_probe_SOURCES): Add kern/list.c.
++      * conf/i386-efi.rmk (grub_setup_SOURCES): Likewise.
++      * conf/i386-pc.rmk (grub_setup_SOURCES): Likewise.
++      * conf/sparc64-ieee1275.rmk (grub_setup_SOURCES): Likewise.
++      * conf/x86_64-efi.rmk (grub_setup_SOURCES): Likewise.
++
 +2010-03-14  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      Compile parts of grub-emu as modules.
 +
 +      * Makefile.in (TARGET_CPPFLAGS) [emu]: Remove -nostdinc -isystem.
 +      (pkglib_DATA) [emu]: Remove moddep.lst command.lst fs.lst
 +      partmap.lst parttool.lst handler.lst video.lst crypto.lst terminal.lst.
 +      (all-local): Add $(GRUB_EMU).
 +      (install-local): Install $(GRUB_EMU).
 +      (uninstall): Uninstall $(GRUB_EMU).
 +      * commands/parttool.c: Replace GRUB_UTIL with GRUB_NO_MODULES.
 +      * kern/dl.c: Likewise.
 +      * commands/sleep.c: Not include machine/time.h.
 +      * conf/any-emu.rmk (COMMON_LDFLAGS): New variable.
 +      (COMMON_CFLAGS): Likewise.
 +      (sbin_UTILITIES): Remove grub-emu.
 +      (grub_emu_SOURCES): Removed.
 +      (kernel_img_RELOCATABLE): New variable.
 +      (pkglib_PROGRAMS): Add kernel.img.
 +      (kernel_img_SOURCES): New variable
 +      (kernel_img_CFLAGS): Likewise.
 +      (kernel_img_LDFLAGS): Likewise.
 +      (TARGET_NO_STRIP): Likewise.
 +      (TARGET_NO_DYNAMIC_MODULES): Likewise.
 +      (pkglib_MODULES): Add progname.mod, hostfs.mod, host.mod, reboot.mod,
 +      halt.mod, cpuid.mod, usb.mod, sdl.mod and pci.mod.
 +      (grub-emu): New target.
 +      (GRUB_EMU): New variable.
 +      * configure.ac: Whitelist -emu as possible x86_64 architecture.
 +      * efiemu/main.c: Replace GRUB_UTIL with GRUB_MACHINE_EMU.
 +      * loader/xnu.c: Likewise.
 +      * include/grub/pci.h: Likewise.
 +      * genemuinit.sh: New file.
 +      * genemuinitheader.sh: Likewise.
 +      * genmk.rb: Don't strip if TARGET_NO_STRIP is yes.
 +      Support TARGET_NO_DYNAMIC_MODULES.
 +      * include/grub/dl.h (GRUB_NO_MODULES): New variable.
 +      * commands/search.c: Fix GRUB_MOD_INIT and GRUB_MOD_FINI arguments.
 +      * disk/loopback.c: Likewise.
 +      * font/font_cmd.c: Likewise.
 +      * partmap/acorn.c: Likewise.
 +      * partmap/amiga.c: Likewise.
 +      * partmap/apple.c: Likewise.
 +      * partmap/gpt.c: Likewise.
 +      * partmap/msdos.c: Likewise.
 +      * partmap/sun.c: Likewise.
 +      * parttool/msdospart.c: Likewise.
 +      * term/gfxterm.c: Likewise.
 +      * video/bitmap.c: Likewise.
 +      * video/readers/jpeg.c: Likewise.
 +      * video/readers/png.c: Likewise.
 +      * video/readers/tga.c: Likewise.
 +      * video/video.c: Likewise.
 +      * util/grub-emu.c (read_command_list): Removed.
 +      (main): Don't call util_init_nls.
 +      * util/misc.c (grub_err_printf) [!GRUB_UTIL]: Removed.
 +      (grub_util_init_nls) [!GRUB_UTIL]: Likewise.
 +
 +2010-03-14  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add datetime.mod,
 +      date.mod, datehook.mod.
 +      (datetime_mod_SOURCES): New variable.
 +      (datetime_mod_CFLAGS): Likewise.
 +      (datetime_mod_LDFLAGS): Likewise.
 +      (date_mod_SOURCES): Likewise.
 +      (date_mod_CFLAGS): Likewise.
 +      (date_mod_LDFLAGS): Likewise.
 +      (datehook_mod_SOURCES): Likewise.
 +      (datehook_mod_CFLAGS): Likewise.
 +      (datehook_mod_LDFLAGS): Likewise.
 +      * conf/sparc64-ieee1275.rmk: Likewise.
 +      * lib/ieee1275/datetime.c: New file.
 +
 +2010-03-14  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add ieee1275_fb.mod.
 +      (ieee1275_fb_mod_SOURCES): New variable.
 +      (ieee1275_fb_mod_CFLAGS): Likewise.
 +      (ieee1275_fb_mod_LDFLAGS): Likewise.
 +      * include/grub/ieee1275/ieee1275.h (grub_ieee1275_devices_iterate):
 +      New proto.
 +      * kern/ieee1275/init.c (HEAP_MAX_SIZE): Increased.
 +      (HEAP_MAX_ADDR): Likewise.
 +      * kern/ieee1275/openfw.c (grub_children_iterate): Don't skip empty
 +      type.
 +      Correct stop condition.
 +      (grub_ieee1275_devices_iterate): New function.
 +      * video/ieee1275.c: New file.
 +
 +2010-03-14  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      Merge sparc grub-mkimage into generic grub-mkimage and a.out support.
 +
 +      * boot/sparc64/ieee1275/boot.S (boot_continue): Use SCRATCH_PAD_BOOT
 +      as scratch.
 +      * boot/sparc64/ieee1275/diskboot.S (after_info_block): Use
 +      SCRATCH_PAD_DISKBOOT as scratch.
 +      (bootit): Pass Openfirmware pointer in %o4.
 +      * conf/sparc64-ieee1275.rmk (kernel_img_LDFLAGS): Link at 0x4400 instead
 +      of 0x200000.
 +      (grub_mkimage_SOURCES): Replace util/sparc64/ieee1275/grub-mkimage.c
 +      with util/grub-mkrawimage.c.
 +      * configure.ac: Handle GRUB_MACHINE_SPARC64 and GRUB_MACHINE_MIPS.
 +      * include/grub/aout.h (AOUT_MID_SUN): New definition.
 +      (grub_aout_get_type) [GRUB_UTIL]: Removed.
 +      (grub_aout_load) [GRUB_UTIL]: Likewise.
 +      * include/grub/kernel.h (grub_modules_get_end): New proto.
 +      * include/grub/sparc64/ieee1275/boot.h (SCRATCH_PAD): Removed.
 +      (SCRATCH_PAD_BOOT): New definition.
 +      (SCRATCH_PAD_DISKBOOT): Likewise.
 +      (GRUB_BOOT_MACHINE_IMAGE_ADDRESS): Set to 0x4400.
 +      * include/grub/sparc64/ieee1275/ieee1275.h
 +      (grub_ieee1275_original_stack): New variable
 +      * include/grub/sparc64/ieee1275/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE):
 +      New definition
 +      (GRUB_KERNEL_MACHINE_STACK_SIZE): Likewise.
 +      (GRUB_PLATFORM_IMAGE_FORMATS): Likewise.
 +      (GRUB_PLATFORM_IMAGE_DEFAULT_FORMAT): Likewise.
 +      (GRUB_PLATFORM_IMAGE_DEFAULT): Likewise.
 +      (GRUB_PLATFORM_IMAGE_RAW): Likewise.
 +      (GRUB_PLATFORM_IMAGE_AOUT): Likewise.
 +      (grub_platform_image_format_t): New type.
 +      * kern/mips/yeeloong/init.c (grub_modules_get_end): Move from here ...
 +      * kern/main.c (grub_modules_get_end)
 +      [GRUB_MACHINE_MIPS_YEELOONG || GRUB_MACHINE_SPARC64]: ... here.
 +      * kern/sparc64/ieee1275/crt0.S: Store firmware entry point in %o0.
 +      (codestart): Switch stacks.
 +      * kern/sparc64/ieee1275/init.c (grub_ieee1275_original_stack): New
 +      variable.
 +      (grub_heap_init): Use grub_modules_get_end.
 +      * loader/sparc64/ieee1275/linux.c (grub_linux_boot): Restore original
 +      stack.
 +      * util/grub-mkrawimage.c (generate_image): Support sparc64.
 +      (main): Likewise.
 +      * util/sparc64/ieee1275/grub-mkimage.c: Removed.
 +
 +2010-03-14  Thorsten Glaser <tg@mirbsd.org>
 +
 +      * util/grub-mkrescue.in: Base ISO UUID on UTC.
 +
 +2010-03-08  Matt Kraai  <kraai@ftbfs.org>
 +
 +      * util/i386/pc/grub-setup.c (setup): Fix a grammatical error (Debian
 +      bug #559005).
 +
 +2010-03-07  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * genmoddep.awk: Output all missing symbols and not only first.
 +
 +2010-03-06  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * NEWS: Put the date of 1.98 release.
 +
 +2010-03-06  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * configure.ac: Update CPPFLAGS and not CFLAGS when checking for
 +      ft2build.h.
 +
 +2010-03-06  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * normal/cmdline.c (grub_cmdline_get): Fix gabled line after
 +      completition in the middle of string.
 +
 +2010-03-06  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * util/grub-mkrescue.in: Use mktemp with explicit template.
 +
 +2010-03-06  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * loader/i386/bsd.c (grub_bsd_get_device): Fix a memory leak.
 +
 +2010-03-06  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * loader/i386/multiboot_mbi.c (grub_multiboot_set_bootdev): Free the
 +      right pointer.
 +
 +2010-03-05  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      Fix FreeBSD compilation.
 +
 +      * Makefile.in (TARGET_CPPFLAGS): Remove -nostdinc -isystem.
 +      * configure.ac: Add -nostdinc -isystem to TARGET_CPPFLAGS if it works.
 +
 +2010-03-05  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * util/import_gcry.py: Add autogenerated files to MAINTAINER_CLEANFILES.
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * gettext/gettext.c (grub_gettext_init_ext): Fix a memory leak.
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * disk/scsi.c (grub_scsi_iterate): Fix a memory leak.
 +
 +2010-03-04  Robert Millan  <rmh.grub@aybabtu.com>
 +
 +      Support relative image path in theme file.
 +
 +      * gfxmenu/gui_image.c (grub_gui_image): New member theme_dir.
 +      (image_set_property): Handle theme_dir and relative path.
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * configure.ac: Alias amd64 to x86_64.
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * NEWS: mention multiboot on EFI.
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * kern/main.c (grub_load_modules): Handle errors from init functions of
 +      embeded modules.
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * normal/autofs.c (autoload_fs_module): Handle errors.
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      Disable linux.mod on qemu-mips since it's not functional and leads
 +      to compilation failure.
 +
 +      * conf/mips.rmk (pkglib_MODULES): Remove linux.mod.
 +      * conf/mips-yeeloong.rmk (pkglib_MODULES): Add linux.mod.
 +      * conf/mips.rmk (linux_mod_SOURCES): Move from here ...
 +      * conf/mips-yeeloong.rmk (linux_mod_SOURCES): ... here
 +      * conf/mips.rmk (linux_mod_CFLAGS): Move from here ...
 +      * conf/mips-yeeloong.rmk (linux_mod_CFLAGS): ... here
 +      * conf/mips.rmk (linux_mod_ASFLAGS): Move from here ...
 +      * conf/mips-yeeloong.rmk (linux_mod_ASFLAGS): ... here
 +      * conf/mips.rmk (linux_mod_LDFLAGS): Move from here ...
 +      * conf/mips-yeeloong.rmk (linux_mod_LDFLAGS): ... here
 +      Reported by: BVK Chaitanya
 +
 +2010-03-04  Jordan Uggla  <jordan.uggla@gmail.com>
 +
 +      * INSTALL: Add gettext as a dependency and add qemu to a new section
 +      "Prerequisites for make-check".
 +
 +2010-03-04  Christian Franke  <franke@computer.org>
 +
 +      * util/grub-pe2elf.c: Add missing include "progname.h".
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * normal/crypto.c (read_crypto_list): Fix a typo.
 +      Reported by: Seth Goldberg.
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * Makefile.in (DISTCLEANFILES): Add stamp-h1.
 +      Reported by: Seth Goldberg.
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * Makefile.in (CLEANFILES) [FONT_SOURCE && grub_mkfont]: Add
 +      ascii.bitmaps.
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * genmk.rb: Remove terminal*.lst in make clean.
 +      Reported by: Seth Goldberg.
 +
 +2010-03-04  Vladimir Serbinenko  <phcoder@gmail.com>
 +
 +      * util/i386/efi/grub-install.in: Copy gettext files.
 +
  2010-03-01  Vladimir Serbinenko  <phcoder@gmail.com>
  
        * fs/ext2.c (grub_ext2_read_block): Fix an integer overflow.
Simple merge
diff --cc util/hostdisk.c
Simple merge