1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/test/unit
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
..
activation-generator_t.c tests: indent 2018-12-23 01:07:27 +01:00
bcache_t.c bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
bcache_utils_t.c bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
bitset_t.c device_mapper: rename libdevmapper.h -> all.h 2018-06-08 12:31:45 +01:00
config_t.c device_mapper: rename libdevmapper.h -> all.h 2018-06-08 12:31:45 +01:00
dmlist_t.c device_mapper: rename libdevmapper.h -> all.h 2018-06-08 12:31:45 +01:00
dmstatus_t.c device_mapper: rename libdevmapper.h -> all.h 2018-06-08 12:31:45 +01:00
framework.c unit-tests: Move to test/unit 2018-04-27 16:55:07 +01:00
framework.h configure: avoid repeative inclusion of configure.h 2018-12-21 19:19:50 +01:00
io_engine_t.c bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
Makefile makefiles: also fix build of unit test 2018-12-17 11:51:38 +01:00
matcher_data.h unit-tests: Move to test/unit 2018-04-27 16:55:07 +01:00
matcher_t.c device_mapper: rename libdevmapper.h -> all.h 2018-06-08 12:31:45 +01:00
percent_t.c device_mapper: rename libdevmapper.h -> all.h 2018-06-08 12:31:45 +01:00
radix_tree_t.c [unit-test/radix-tree] Add a huge test case 2018-09-20 14:38:34 +01:00
rt_case1.c [unit-test/radix-tree] Add a huge test case 2018-09-20 14:38:34 +01:00
run.c unit-tests: Move to test/unit 2018-04-27 16:55:07 +01:00
string_t.c device_mapper: rename libdevmapper.h -> all.h 2018-06-08 12:31:45 +01:00
unit-test.sh tests: drop lvmetad bits 2018-09-10 11:49:11 -05:00
units.h scripts/lvm2_activation_generator_systemd_red_hat: rewrite to use lvmconfig 2018-06-07 16:15:04 +01:00
vdo_t.c tests: update vdo unit test to dm prefix 2018-07-09 10:30:34 +02:00