Commit ff3f7115 authored by Sweet Tea Dorminy's avatar Sweet Tea Dorminy Committed by Mikulas Patocka
Browse files

dm vdo: remove remaining ring references



Lists are the new rings, so update all remaining references to rings to
talk about lists.

Signed-off-by: default avatarSweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: default avatarMatthew Sakai <msakai@redhat.com>
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
parent 51ba14fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -451,7 +451,7 @@ static struct page_info * __must_check find_page(struct vdo_page_cache *cache,
 * select_lru_page() - Determine which page is least recently used.
 *
 * Picks the least recently used from among the non-busy entries at the front of each of the lru
 * ring. Since whenever we mark a page busy we also put it to the end of the ring it is unlikely
 * list. Since whenever we mark a page busy we also put it to the end of the list it is unlikely
 * that the entries at the front are busy unless the queue is very short, but not impossible.
 *
 * Return: A pointer to the info structure for a relevant page, or NULL if no such page can be
+10 −10
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ struct hash_lock {
	 * A list containing the data VIOs sharing this lock, all having the same record name and
	 * data block contents, linked by their hash_lock_node fields.
	 */
	struct list_head duplicate_ring;
	struct list_head duplicate_vios;

	/* The number of data_vios sharing this lock instance */
	data_vio_count_t reference_count;
@@ -343,7 +343,7 @@ static void return_hash_lock_to_pool(struct hash_zone *zone, struct hash_lock *l
{
	memset(lock, 0, sizeof(*lock));
	INIT_LIST_HEAD(&lock->pool_node);
	INIT_LIST_HEAD(&lock->duplicate_ring);
	INIT_LIST_HEAD(&lock->duplicate_vios);
	vdo_waitq_init(&lock->waiters);
	list_add_tail(&lock->pool_node, &zone->lock_pool);
}
@@ -441,7 +441,7 @@ static void set_hash_lock(struct data_vio *data_vio, struct hash_lock *new_lock)
		VDO_ASSERT_LOG_ONLY(data_vio->hash_zone != NULL,
				    "must have a hash zone when holding a hash lock");
		VDO_ASSERT_LOG_ONLY(!list_empty(&data_vio->hash_lock_entry),
				    "must be on a hash lock ring when holding a hash lock");
				    "must be on a hash lock list when holding a hash lock");
		VDO_ASSERT_LOG_ONLY(old_lock->reference_count > 0,
				    "hash lock reference must be counted");

@@ -464,10 +464,10 @@ static void set_hash_lock(struct data_vio *data_vio, struct hash_lock *new_lock)

	if (new_lock != NULL) {
		/*
		 * Keep all data_vios sharing the lock on a ring since they can complete in any
		 * Keep all data_vios sharing the lock on a list since they can complete in any
		 * order and we'll always need a pointer to one to compare data.
		 */
		list_move_tail(&data_vio->hash_lock_entry, &new_lock->duplicate_ring);
		list_move_tail(&data_vio->hash_lock_entry, &new_lock->duplicate_vios);
		new_lock->reference_count += 1;
		if (new_lock->max_references < new_lock->reference_count)
			new_lock->max_references = new_lock->reference_count;
@@ -1789,10 +1789,10 @@ static bool is_hash_collision(struct hash_lock *lock, struct data_vio *candidate
	struct hash_zone *zone;
	bool collides;

	if (list_empty(&lock->duplicate_ring))
	if (list_empty(&lock->duplicate_vios))
		return false;

	lock_holder = list_first_entry(&lock->duplicate_ring, struct data_vio,
	lock_holder = list_first_entry(&lock->duplicate_vios, struct data_vio,
				       hash_lock_entry);
	zone = candidate->hash_zone;
	collides = !blocks_equal(lock_holder->vio.data, candidate->vio.data);
@@ -1815,7 +1815,7 @@ static inline int assert_hash_lock_preconditions(const struct data_vio *data_vio
		return result;

	result = VDO_ASSERT(list_empty(&data_vio->hash_lock_entry),
			    "must not already be a member of a hash lock ring");
			    "must not already be a member of a hash lock list");
	if (result != VDO_SUCCESS)
		return result;

@@ -1942,8 +1942,8 @@ void vdo_release_hash_lock(struct data_vio *data_vio)
			    "returned hash lock must not be in use with state %s",
			    get_hash_lock_state_name(lock->state));
	VDO_ASSERT_LOG_ONLY(list_empty(&lock->pool_node),
			    "hash lock returned to zone must not be in a pool ring");
	VDO_ASSERT_LOG_ONLY(list_empty(&lock->duplicate_ring),
			    "hash lock returned to zone must not be in a pool list");
	VDO_ASSERT_LOG_ONLY(list_empty(&lock->duplicate_vios),
			    "hash lock returned to zone must not reference DataVIOs");

	return_hash_lock_to_pool(zone, lock);
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ struct compressed_block {

/*
 * Each packer_bin holds an incomplete batch of data_vios that only partially fill a compressed
 * block. The bins are kept in a ring sorted by the amount of unused space so the first bin with
 * block. The bins are kept in a list sorted by the amount of unused space so the first bin with
 * enough space to hold a newly-compressed data_vio can easily be found. When the bin fills up or
 * is flushed, the first uncanceled data_vio in the bin is selected to be the agent for that bin.
 * Upon entering the packer, each data_vio already has its compressed data in the first slot of the
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ void vdo_priority_table_remove(struct priority_table *table, struct list_head *e

	/*
	 * Remove the entry from the bucket list, remembering a pointer to another entry in the
	 * ring.
	 * list.
	 */
	next_entry = entry->next;
	list_del_init(entry);
+3 −3
Original line number Diff line number Diff line
@@ -43,9 +43,9 @@
 * has a vio which is used to commit that block to disk. The vio's data is the on-disk
 * representation of the journal block. In addition each in-memory block has a buffer which is used
 * to accumulate entries while a partial commit of the block is in progress. In-memory blocks are
 * kept on two rings. Free blocks live on the 'free_tail_blocks' ring. When a block becomes active
 * (see below) it is moved to the 'active_tail_blocks' ring. When a block is fully committed, it is
 * moved back to the 'free_tail_blocks' ring.
 * kept on two lists. Free blocks live on the 'free_tail_blocks' list. When a block becomes active
 * (see below) it is moved to the 'active_tail_blocks' list. When a block is fully committed, it is
 * moved back to the 'free_tail_blocks' list.
 *
 * When entries are added to the journal, they are added to the active in-memory block, as
 * indicated by the 'active_block' field. If the caller wishes to wait for the entry to be
Loading