[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH RFC v2 08/22] block/pcache: implement pickup par
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-block] [PATCH RFC v2 08/22] block/pcache: implement pickup parts of the cache |
Date: |
Fri, 2 Sep 2016 10:59:46 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 29.08.2016 um 19:10 hat Pavel Butsykin geschrieben:
> Implementation of obtaining fragments of the cache belonging to one area
> of request. This will allow to handle the case when a request is partially
> hits the cache.
>
> Signed-off-by: Pavel Butsykin <address@hidden>
> +static void pcache_pickup_parts_of_cache(PrefCacheAIOCB *acb, PCNode *node,
> + uint64_t num, uint32_t size)
> +{
> + uint32_t up_size;
> +
> + do {
> + if (num < node->cm.sector_num) {
> + PCNode *new_node;
> + RbNodeKey lc_key = {
> + .num = num,
> + .size = node->cm.sector_num - num,
> + };
> + up_size = lc_key.size;
> +
> + if (!pcache_node_find_and_create(acb, &lc_key, &new_node)) {
> + node = new_node;
> + continue;
> + }
We're creating additional nodes here; and we need them because they have
their own status. But once the read has completed, wouldn't it make
sense to merge all adjacent nodes in NODE_SUCCESS_STATUS?
Kevin
- Re: [Qemu-block] [PATCH RFC v2 08/22] block/pcache: implement pickup parts of the cache,
Kevin Wolf <=