dm bufio: add LRU abstraction
authorJoe Thornber <ejt@redhat.com>
Fri, 10 Mar 2023 15:37:20 +0000 (15:37 +0000)
committerMike Snitzer <snitzer@kernel.org>
Thu, 30 Mar 2023 19:57:50 +0000 (15:57 -0400)
commitbe845babda1bb168d3f9f47c171f0a24a3312cba
tree86ef2c74062b4233447536f5615f5ddd36241d9b
parentb75a80f4f5a956f3d335ebf29c7cee1b234ac3cf
dm bufio: add LRU abstraction

A CLOCK algorithm is used in this LRU abstraction.  This avoids
relinking list nodes, which would require a write lock protecting it.

None of the LRU methods are threadsafe; locking must be done at a
higher level.

Code that uses this new LRU will be introduced in the next 2 commits.

As such, this commit will cause "defined but not used" compiler warnings
that will be resolved by the next 2 commits.

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
drivers/md/dm-bufio.c