summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2016-12-15 20:10:27 +0000
committerBryn M. Reeves <bmr@redhat.com>2017-03-09 18:50:15 +0000
commit8b78982297bb9c8484f8add7fdf96e93c8238769 (patch)
treee2d1f4bde9221b9b8a52d04bea7da6794fe258fb /include
parentc98868181fa3ee0816d525ef186c1059a46f1d0b (diff)
downloadlvm2-8b78982297bb9c8484f8add7fdf96e93c8238769.tar.gz
daemons: add dmfilemapd
Add a daemon that can be launched to monitor a group of regions corresponding to the extents of a file, and to update the regions as the file's allocation changes. The daemon is intended to be started from a library interface, but can also be run from the command line: dmfilemapd <fd> <group_id> <path> <mode> [<foreground>[<log_level>]] Where fd is a file descriptor open on the mapped file, group_id is the group identifier of the mapped group and mode is either "inode" or "path". E.g.: # dmfilemapd 3 0 vm.img inode 1 3 3<vm.img ... If foreground is non-zero, the daemon will not fork to run in the background. If verbose is non-zero, libdm and daemon log messages will be printed. It is possible for the group identifier to change when regions are re-mapped: this occurs when the group leader is deleted (regroup=1 in dm_stats_update_regions_from_fd()), and another region is created before the daemon has a chance to recreate the leader region. The operation is inherently racey since there is currently no way to atomically move or resize a dm_stats region while retaining its region_id. Detect this condition and update the group_id value stored in the filemap monitor. A function is also provided in the the stats API to launch the filemap monitoring daemon: int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path, dm_filemapd_mode_t mode, unsigned foreground, unsigned verbose); This carries out the first fork and execs dmfilemapd with the arguments specified. A dm_filemapd_mode_t value is specified by the mode argument: either DM_FILEMAPD_FOLLOW_INODE, or DM_FILEMAPD_FOLLOW_PATH. A helper function, dm_filemapd_mode_from_string(), is provided to parse a string containing a valid mode name into the appropriate dm_filemapd_mode_t value.
Diffstat (limited to 'include')
-rw-r--r--include/configure.h.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/configure.h.in b/include/configure.h.in
index cf8dc9450..89a5e4885 100644
--- a/include/configure.h.in
+++ b/include/configure.h.in
@@ -127,6 +127,9 @@
/* Path to dmeventd pidfile. */
#undef DMEVENTD_PIDFILE
+/* Define to 1 to enable the device-mapper filemap daemon. */
+#undef DMFILEMAPD
+
/* Define to enable compat protocol */
#undef DM_COMPAT