diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2020-05-27 14:04:46 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2020-06-05 03:57:38 +0300 |
commit | a1c979f330cb82cae7a3b19464f9815e43060fe3 (patch) | |
tree | d0e7a8661a2523b443ee0f7db1108c8d73a74fe6 /drivers/md | |
parent | b4756d43a1dd2cfb778eb3cef3ba2efd2dcd5263 (diff) | |
download | linux-a1c979f330cb82cae7a3b19464f9815e43060fe3.tar.xz |
dm bufio: delete unused and inefficient dm_bufio_discard_buffers
There is no user for this interface. If in future it is needed it can
be reimplemented to walk the rbtree of buffers instead of doing
block-by-block lookups.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-bufio.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c index bf289be1ee3a..993e624e506c 100644 --- a/drivers/md/dm-bufio.c +++ b/drivers/md/dm-bufio.c @@ -1359,32 +1359,6 @@ int dm_bufio_issue_discard(struct dm_bufio_client *c, sector_t block, sector_t c EXPORT_SYMBOL_GPL(dm_bufio_issue_discard); /* - * Free the specified range of buffers. If a buffer is held by other process, it - * is not freed. If a buffer is dirty, it is discarded without writeback. - * Finally, send the discard request to the device. - */ -int dm_bufio_discard_buffers(struct dm_bufio_client *c, sector_t block, sector_t count) -{ - sector_t i; - - for (i = block; i < block + count; i++) { - struct dm_buffer *b; - dm_bufio_lock(c); - b = __find(c, i); - if (b && likely(!b->hold_count)) { - wait_on_bit_io(&b->state, B_READING, TASK_UNINTERRUPTIBLE); - wait_on_bit_io(&b->state, B_WRITING, TASK_UNINTERRUPTIBLE); - __unlink_buffer(b); - __free_buffer_wake(b); - } - dm_bufio_unlock(c); - } - - return dm_bufio_issue_discard(c, block, count); -} -EXPORT_SYMBOL_GPL(dm_bufio_discard_buffers); - -/* * We first delete any other buffer that may be at that new location. * * Then, we write the buffer to the original location if it was dirty. |