On 4/10/24 5:57 PM, Alistair Popple wrote:
...
diff --git a/include/linux/dax.h b/include/linux/dax.h
index 22cd990..bced4d4 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -212,6 +212,17 @@ int dax_zero_range(struct inode *inode, loff_t pos, loff_t 
len, bool *did_zero,
  int dax_truncate_page(struct inode *inode, loff_t pos, bool *did_zero,
                const struct iomap_ops *ops);
+static inline int dax_wait_page_idle(struct page *page,
+                               void (cb)(struct inode *),
+                               struct inode *inode)
+{
+       int ret;
+
+       ret = ___wait_var_event(page, page_ref_count(page) == 1,
+                               TASK_INTERRUPTIBLE, 0, 0, cb(inode));
+       return ret;
+}

Or just:
{
        return ___wait_var_event(page, page_ref_count(page) == 1,
                        TASK_INTERRUPTIBLE, 0, 0, cb(inode));
}

...yes?


thanks,
--
John Hubbard
NVIDIA


Reply via email to