dm bufio: delete unused and inefficient dm_bufio_discard_buffers
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 27 May 2020 11:04:46 +0000 (07:04 -0400)
committerMike Snitzer <snitzer@redhat.com>
Fri, 5 Jun 2020 00:57:38 +0000 (20:57 -0400)
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>
drivers/md/dm-bufio.c
include/linux/dm-bufio.h

index bf289be..993e624 100644 (file)
@@ -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.
index 07e1f16..5ec6bfb 100644 (file)
@@ -124,13 +124,6 @@ int dm_bufio_issue_flush(struct dm_bufio_client *c);
 int dm_bufio_issue_discard(struct dm_bufio_client *c, sector_t block, sector_t count);
 
 /*
- * 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);
-
-/*
  * Like dm_bufio_release but also move the buffer to the new
  * block. dm_bufio_write_dirty_buffers is needed to commit the new block.
  */