[sheepdog] [PATCH v2 4/9] object cache: merge active and inactive dirt_tree/list
Liu Yuan
namei.unix at gmail.com
Thu Jul 26 05:01:34 CEST 2012
On 07/25/2012 08:15 PM, levin li wrote:
> static int object_cache_push(struct object_cache *oc)
> {
> struct object_cache_entry *entry, *t;
> - struct rb_root *inactive_dirty_tree;
> - struct list_head *inactive_dirty_list;
> - int ret = SD_RES_SUCCESS;
> + LIST_HEAD(inactive_dirty_list);
> + int ret = SD_RES_SUCCESS, create;
> + uint64_t bmap;
>
> if (node_in_recovery())
> /* We don't do flushing in recovery */
> return SD_RES_SUCCESS;
>
> - switch_dirty_tree_and_list(oc, &inactive_dirty_tree,
> - &inactive_dirty_list);
> + pthread_mutex_lock(&oc->lock);
> + list_splice_init(&oc->dirty_list, &inactive_dirty_list);
> + pthread_mutex_unlock(&oc->lock);
>
> /* 1. for async flush, there is only one worker
> * 2. for sync flush, Guest assure us of that only one sync
> * request is issued in one of gateway worker threads
> * So we need not to protect inactive dirty tree and list */
This comment should be removed.
Thanks,
Yuan
More information about the sheepdog
mailing list