1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/test
David Teigland 1570e76233 bcache: use indirection table for fd
Add a "device index" (di) for each device, and use this
in the bcache api to the rest of lvm.  This replaces the
file descriptor (fd) in the api.  The rest of lvm uses
new functions bcache_set_fd(), bcache_clear_fd(), and
bcache_change_fd() to control which fd bcache uses for
io to a particular device.

. lvm opens a dev and gets and fd.
  fd = open(dev);

. lvm passes fd to the bcache layer and gets a di
  to use in the bcache api for the dev.
  di = bcache_set_fd(fd);

. lvm uses bcache functions, passing di for the dev.
  bcache_write_bytes(di, ...), etc.

. bcache translates di to fd to do io.

. lvm closes the device and clears the di/fd bcache state.
  close(fd);
  bcache_clear_fd(di);

In the bcache layer, a di-to-fd translation table
(int *_fd_table) is added.  When bcache needs to
perform io on a di, it uses _fd_table[di].

In the following commit, lvm will make use of the new
bcache_change_fd() function to change the fd that
bcache uses for the dev, without dropping cached blocks.
2020-09-18 15:10:11 -05:00
..
api tests: disable dbustest with valgrind testing 2020-09-10 23:55:03 +02:00
dbus lvmdbusd: Add support for LVM writecache 2020-08-06 13:54:34 -05:00
lib tests: inittest supports SKIP_WITH_LOW_SPACE 2020-09-18 17:30:31 +02:00
shell tests: printf to awk 2020-09-18 17:30:45 +02:00
unit bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
.gitignore test: add results/ to .gitignore 2016-12-10 18:00:25 +00:00
Makefile.in tests: enusure lib is initilized 2019-11-14 18:06:42 +01:00