/* This patch is related with following upstream kernel commit. */ From e511c4a3d2a1f64aafc1f5df37a2ffcf7ef91b55 Mon Sep 17 00:00:00 2001 From: Jane Chu Date: Fri, 13 May 2022 15:10:58 -0700 Subject: [PATCH] dax: introduce DAX_RECOVERY_WRITE dax access mode Up till now, dax_direct_access() is used implicitly for normal access, but for the purpose of recovery write, dax range with poison is requested. To make the interface clear, introduce enum dax_access_mode { DAX_ACCESS, DAX_RECOVERY_WRITE, } where DAX_ACCESS is used for normal dax access, and DAX_RECOVERY_WRITE is used for dax recovery write. Suggested-by: Dan Williams Signed-off-by: Jane Chu Reviewed-by: Christoph Hellwig Cc: Mike Snitzer Reviewed-by: Vivek Goyal Link: https://lore.kernel.org/r/165247982851.52965.11024212198889762949.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams --- diff -Nupr a/drbd/drbd_dax_pmem.c b/drbd/drbd_dax_pmem.c --- a/drbd/drbd_dax_pmem.c 2022-08-22 16:26:24.786369807 +0800 +++ b/drbd/drbd_dax_pmem.c 2022-08-22 16:26:47.706276429 +0800 @@ -39,7 +39,7 @@ static int map_superblock_for_dax(struct int id; id = dax_read_lock(); - len = dax_direct_access(dax_dev, pgoff, want, &kaddr, &pfn_unused); + len = dax_direct_access(dax_dev, pgoff, want, DAX_ACCESS, &kaddr, &pfn_unused); dax_read_unlock(id); if (len < want) @@ -100,7 +100,7 @@ int drbd_dax_map(struct drbd_backing_dev int id; id = dax_read_lock(); - len = dax_direct_access(dax_dev, pgoff, want, &kaddr, &pfn_unused); + len = dax_direct_access(dax_dev, pgoff, want, DAX_ACCESS, &kaddr, &pfn_unused); dax_read_unlock(id); if (len < want)