1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
lvm2/lib/device
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
..
bcache-utils.c bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
bcache.c bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
bcache.h bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
dev-cache.c bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00
dev-cache.h enable full md component detection at the right time 2019-07-10 13:30:50 -05:00
dev-dasd.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
dev-ext-udev-constants.h dev-type: check for DEVLINKS udev db variable existence if udev_device_get_is_initialized fn is not present 2016-09-06 13:21:29 +02:00
dev-ext.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
dev-io.c devs: add some checks for a dev with no path name 2020-05-13 16:26:26 -05:00
dev-luks.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
dev-lvm1-pool.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
dev-md.c cov: always initialized values 2020-09-01 17:57:50 +02:00
dev-swap.c build: Don't generate symlinks in include/ dir 2018-05-14 10:30:20 +01:00
dev-type.c improve get_fs_block_size string to number 2020-06-11 15:05:47 -05:00
dev-type.h Allow dm-integrity to be used for raid images 2020-04-15 12:10:32 -05:00
device-types.h devices: Recognise Veritas Dynamic Multipathing 2017-01-10 22:23:23 +00:00
device.h bcache: use indirection table for fd 2020-09-18 15:10:11 -05:00