2022-08-23 03:12:22 +02:00
|
|
|
/* This patch is related with following upstream kernel commit. */
|
|
|
|
|
|
|
|
From e511c4a3d2a1f64aafc1f5df37a2ffcf7ef91b55 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jane Chu <jane.chu@oracle.com>
|
|
|
|
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 <dan.j.williams@intel.com>
|
|
|
|
Signed-off-by: Jane Chu <jane.chu@oracle.com>
|
|
|
|
Reviewed-by: Christoph Hellwig <hch@lst.de>
|
|
|
|
Cc: Mike Snitzer <snitzer@redhat.com>
|
|
|
|
Reviewed-by: Vivek Goyal <vgoyal@redhat.com>
|
|
|
|
Link: https://lore.kernel.org/r/165247982851.52965.11024212198889762949.stgit@dwillia2-desk3.amr.corp.intel.com
|
|
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
|
|
---
|
|
|
|
|
|
|
|
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
|
2023-01-05 14:24:33 +01:00
|
|
|
@@ -39,7 +39,7 @@ static int map_superblock_for_dax(struct
|
2022-08-23 03:12:22 +02:00
|
|
|
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)
|
2023-01-05 14:24:33 +01:00
|
|
|
@@ -100,7 +100,7 @@ int drbd_dax_map(struct drbd_backing_dev
|
2022-08-23 03:12:22 +02:00
|
|
|
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)
|