From 73e39b57bc1a7cdd564155102785ee690ad9583d Mon Sep 17 00:00:00 2001 From: marcel Date: Wed, 26 Feb 2003 09:13:05 +0000 Subject: Increase the block size for reading and writing from 8KB to 1MB and introduce a preprocessor define for it. The larger block size significantly speeds up the loading of the kernel. Submitted by: Arun Sharma --- sys/boot/efi/libefi/efifs.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sys/boot') diff --git a/sys/boot/efi/libefi/efifs.c b/sys/boot/efi/libefi/efifs.c index d42bc71..ce76e70 100644 --- a/sys/boot/efi/libefi/efifs.c +++ b/sys/boot/efi/libefi/efifs.c @@ -36,6 +36,9 @@ #include #include "efiboot.h" +/* Perform I/O in blocks of size EFI_BLOCK_SIZE. */ +#define EFI_BLOCK_SIZE (1024 * 1024) + static int efifs_open(const char *upath, struct open_file *f) { @@ -123,8 +126,8 @@ efifs_read(struct open_file *f, void *buf, size_t size, size_t *resid) bufp = buf; while (size > 0) { sz = size; - if (sz > 8192) - sz = 8192; + if (sz > EFI_BLOCK_SIZE) + sz = EFI_BLOCK_SIZE; status = file->Read(file, &sz, bufp); twiddle(); if (EFI_ERROR(status)) @@ -150,8 +153,8 @@ efifs_write(struct open_file *f, void *buf, size_t size, size_t *resid) bufp = buf; while (size > 0) { sz = size; - if (sz > 8192) - sz = 8192; + if (sz > EFI_BLOCK_SIZE) + sz = EFI_BLOCK_SIZE; status = file->Write(file, &sz, bufp); twiddle(); if (EFI_ERROR(status)) -- cgit v1.1