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 <[email protected]>

> +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

Reply via email to