1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib
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
..
activate Revert "raid: add _rimage and _rmeta as origin_only" 2020-09-09 00:58:52 +02:00
cache cleanup: matching declaration order 2020-09-01 17:57:50 +02:00
cache_segtype cachevol: move flag setting after taking archive 2019-10-17 13:03:50 +02:00
commands hints: free hint structs on exit 2020-05-13 17:20:16 -05:00
config config: drop reading file with mmap 2020-08-28 21:43:02 +02:00
datastruct build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
device bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
display Revert "lvdisplay: dispaly correct status when underlying devs missing" 2020-08-28 13:28:15 -05:00
error device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
filters devs: rename dev_is_md dev_is_md_component 2019-05-21 11:44:39 -05:00
format_text gcc: zero-sized array to fexlible array C99 2020-09-01 17:57:50 +02:00
freeseg device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
integrity Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
label bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
locking locking: restore blocking signal for VG_GLOBAL lck 2020-09-14 00:15:14 +02:00
log logging: remove unused code 2019-02-28 10:30:54 -06:00
lvmpolld device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
metadata bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
mirror pvmove: remove some cmirror related code 2019-10-11 11:31:42 -05:00
misc Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
mm gcc: use apropriate type for reading and printing values 2020-08-28 21:43:03 +02:00
notify build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
properties build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
raid Revert "lvdisplay: dispaly correct status when underlying devs missing" 2020-08-28 13:28:15 -05:00
report integrity: fix segfault reporting integrity for other lvs 2020-09-09 10:22:07 -05:00
snapshot Merge branch '2018-06-04-data-structs' 2018-06-08 14:21:07 +01:00
striped device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
thin Merge branch '2018-06-04-data-structs' 2018-06-08 14:21:07 +01:00
unknown device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
uuid build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
vdo vdo: remember configure VDO write policy in metadata 2019-10-04 17:31:55 +02:00
writecache writecache: add settings cleaner and max_age 2020-06-10 12:15:50 -05:00
zero device_mapper: remove dbg_malloc. 2018-06-08 13:40:53 +01:00
Makefile.in Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00