diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2019-04-26 15:59:24 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2019-04-26 17:48:03 +0200 |
commit | f8011d334426cee77276a1038b627b5cb0470258 (patch) | |
tree | cefef25958a2adff23ebadbd60b7f2b761db92f9 /Documentation/device-mapper | |
parent | dm writecache: remove unused member page_offset in writeback_struct (diff) | |
download | linux-f8011d334426cee77276a1038b627b5cb0470258.tar.xz linux-f8011d334426cee77276a1038b627b5cb0470258.zip |
dm writecache: avoid unnecessary lookups in writecache_find_entry()
This is a small optimization in writecache_find_entry().
If we go past the condition "if (unlikely(!node))", we can be certain that
there is no entry in the tree that has the block equal to the "block"
variable.
Consequently, we can return the next entry directly, we don't need to go
to the second part of the function that finds the entry with lowest or
highest seq number that matches the "block" variable.
Also, add some whitespace and cleanup needless braces.
Suggested-by: Huaisheng Ye <yehs1@lenovo.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'Documentation/device-mapper')
0 files changed, 0 insertions, 0 deletions