From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Nelson Date: Mon, 21 Mar 2016 10:59:33 -0700 Subject: [U-Boot] [RFC V2 PATCH 1/3] drivers: block: add block device cache In-Reply-To: <1458524727-4643-2-git-send-email-eric@nelint.com> References: <1458524727-4643-1-git-send-email-eric@nelint.com> <1458524727-4643-2-git-send-email-eric@nelint.com> Message-ID: <56F03685.8090202@nelint.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 03/20/2016 06:45 PM, Eric Nelson wrote: > Add a block device cache to speed up repeated reads of block devices by > various filesystems. > ... > > Signed-off-by: Eric Nelson > --- > drivers/block/Makefile | 1 + > drivers/block/cache_block.c | 240 ++++++++++++++++++++++++++++++++++++++++++++ > include/part.h | 69 +++++++++++++ > 3 files changed, 310 insertions(+) > create mode 100644 drivers/block/cache_block.c > ... > diff --git a/include/part.h b/include/part.h > index dc8e72e..1ac73dcc 100644 > --- a/include/part.h > +++ b/include/part.h > @@ -376,4 +376,73 @@ int gpt_verify_partitions(struct blk_desc *dev_desc, > gpt_header *gpt_head, gpt_entry **gpt_pte); > #endif > I think this stuff now belongs in blk.h instead of part.h: > +#ifdef CONFIG_BLOCK_CACHE > +/** > + * cache_block_read() - attempt to read a set of blocks from cache > + * > + * @param iftype - IF_TYPE_x for type of device