summaryrefslogtreecommitdiff
path: root/drivers/md/dm-thin-metadata.h
diff options
context:
space:
mode:
authorNikos Tsironis <ntsironis@arrikto.com>2019-12-04 17:07:41 +0300
committerMike Snitzer <snitzer@redhat.com>2019-12-06 01:05:24 +0300
commitecda7c0280e6b3398459dc589b9a41c1adb45529 (patch)
treebe4b8ed933bc0b6d59163f5a147fcf553516960a /drivers/md/dm-thin-metadata.h
parent8b3fd1f53af3591d5624ab9df718369b14d09ed1 (diff)
downloadlinux-ecda7c0280e6b3398459dc589b9a41c1adb45529.tar.xz
dm thin metadata: Add support for a pre-commit callback
Add support for one pre-commit callback which is run right before the metadata are committed. This allows the thin provisioning target to run a callback before the metadata are committed and is required by the next commit. Cc: stable@vger.kernel.org Signed-off-by: Nikos Tsironis <ntsironis@arrikto.com> Acked-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-thin-metadata.h')
-rw-r--r--drivers/md/dm-thin-metadata.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/dm-thin-metadata.h b/drivers/md/dm-thin-metadata.h
index f6be0d733c20..7ef56bd2a7e3 100644
--- a/drivers/md/dm-thin-metadata.h
+++ b/drivers/md/dm-thin-metadata.h
@@ -230,6 +230,13 @@ bool dm_pool_metadata_needs_check(struct dm_pool_metadata *pmd);
*/
void dm_pool_issue_prefetches(struct dm_pool_metadata *pmd);
+/* Pre-commit callback */
+typedef int (*dm_pool_pre_commit_fn)(void *context);
+
+void dm_pool_register_pre_commit_callback(struct dm_pool_metadata *pmd,
+ dm_pool_pre_commit_fn fn,
+ void *context);
+
/*----------------------------------------------------------------*/
#endif