mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
1570e76233
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. |
||
---|---|---|
.. | ||
activation-generator_t.c | ||
bcache_t.c | ||
bcache_utils_t.c | ||
bitset_t.c | ||
config_t.c | ||
dmlist_t.c | ||
dmstatus_t.c | ||
framework.c | ||
framework.h | ||
io_engine_t.c | ||
Makefile | ||
matcher_data.h | ||
matcher_t.c | ||
percent_t.c | ||
radix_tree_t.c | ||
rt_case1.c | ||
run.c | ||
string_t.c | ||
unit-test.sh | ||
units.h | ||
vdo_t.c |