Commit ef992373 authored by Shenghui Wang's avatar Shenghui Wang Committed by Mike Snitzer

dm bufio: update comment in dm-bufio.c

* Hashtable has been replaced by rbtree to manage buffers.
  Update the comment.
* Fix typo in the comment for dm_bufio_issue_flush
Signed-off-by: default avatarShenghui Wang <shhuiw@foxmail.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent e8ea141a
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
/* /*
* Linking of buffers: * Linking of buffers:
* All buffers are linked to cache_hash with their hash_list field. * All buffers are linked to buffer_tree with their node field.
* *
* Clean buffers that are not being written (B_WRITING not set) * Clean buffers that are not being written (B_WRITING not set)
* are linked to lru[LIST_CLEAN] with their lru_list field. * are linked to lru[LIST_CLEAN] with their lru_list field.
...@@ -457,7 +457,7 @@ static void free_buffer(struct dm_buffer *b) ...@@ -457,7 +457,7 @@ static void free_buffer(struct dm_buffer *b)
} }
/* /*
* Link buffer to the hash list and clean or dirty queue. * Link buffer to the buffer tree and clean or dirty queue.
*/ */
static void __link_buffer(struct dm_buffer *b, sector_t block, int dirty) static void __link_buffer(struct dm_buffer *b, sector_t block, int dirty)
{ {
...@@ -472,7 +472,7 @@ static void __link_buffer(struct dm_buffer *b, sector_t block, int dirty) ...@@ -472,7 +472,7 @@ static void __link_buffer(struct dm_buffer *b, sector_t block, int dirty)
} }
/* /*
* Unlink buffer from the hash list and dirty or clean queue. * Unlink buffer from the buffer tree and dirty or clean queue.
*/ */
static void __unlink_buffer(struct dm_buffer *b) static void __unlink_buffer(struct dm_buffer *b)
{ {
...@@ -993,7 +993,7 @@ static struct dm_buffer *__bufio_new(struct dm_bufio_client *c, sector_t block, ...@@ -993,7 +993,7 @@ static struct dm_buffer *__bufio_new(struct dm_bufio_client *c, sector_t block,
/* /*
* We've had a period where the mutex was unlocked, so need to * We've had a period where the mutex was unlocked, so need to
* recheck the hash table. * recheck the buffer tree.
*/ */
b = __find(c, block); b = __find(c, block);
if (b) { if (b) {
...@@ -1327,7 +1327,7 @@ int dm_bufio_write_dirty_buffers(struct dm_bufio_client *c) ...@@ -1327,7 +1327,7 @@ int dm_bufio_write_dirty_buffers(struct dm_bufio_client *c)
EXPORT_SYMBOL_GPL(dm_bufio_write_dirty_buffers); EXPORT_SYMBOL_GPL(dm_bufio_write_dirty_buffers);
/* /*
* Use dm-io to send and empty barrier flush the device. * Use dm-io to send an empty barrier to flush the device.
*/ */
int dm_bufio_issue_flush(struct dm_bufio_client *c) int dm_bufio_issue_flush(struct dm_bufio_client *c)
{ {
...@@ -1356,7 +1356,7 @@ EXPORT_SYMBOL_GPL(dm_bufio_issue_flush); ...@@ -1356,7 +1356,7 @@ EXPORT_SYMBOL_GPL(dm_bufio_issue_flush);
* Then, we write the buffer to the original location if it was dirty. * Then, we write the buffer to the original location if it was dirty.
* *
* Then, if we are the only one who is holding the buffer, relink the buffer * Then, if we are the only one who is holding the buffer, relink the buffer
* in the hash queue for the new location. * in the buffer tree for the new location.
* *
* If there was someone else holding the buffer, we write it to the new * If there was someone else holding the buffer, we write it to the new
* location but not relink it, because that other user needs to have the buffer * location but not relink it, because that other user needs to have the buffer
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment