Thread (23 messages) 23 messages, 4 authors, 2017-10-11
STALE3204d
Revisions (2)
  1. v7 [diff vs current]
  2. v8 current

[PATCH v8 09/14] xfs: wire up ->lease_direct()

From: Dan Williams <hidden>
Date: 2017-10-10 14:49:48
Also in: linux-api, linux-fsdevel, linux-iommu, linux-mm, linux-rdma, nvdimm
Subsystem: filesystems (vfs and infrastructure), the rest, xfs filesystem · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds, Carlos Maiolino

A 'lease_direct' lease requires that the vma have a valid MAP_DIRECT
mapping established. For xfs we use the generic_map_direct_lease()
handler for ->lease_direct(). It establishes a new lease and then checks
if the MAP_DIRECT mapping has been broken. We want to be sure that the
process will receive notification that the MAP_DIRECT mapping is being
torn down so it knows why other code paths are throwing failures.

For example in the RDMA/ibverbs case we want ibv_reg_mr() to fail if the
MAP_DIRECT mapping is invalid or in the process of being invalidated.

Cc: Jan Kara <jack@suse.cz>
Cc: Jeff Moyer <redacted>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: "Darrick J. Wong" <redacted>
Cc: Ross Zwisler <redacted>
Cc: Jeff Layton <redacted>
Cc: "J. Bruce Fields" <redacted>
Signed-off-by: Dan Williams <redacted>
---
 fs/xfs/xfs_file.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 4bee027c9366..bc512a9a8df5 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -1157,6 +1157,7 @@ static const struct vm_operations_struct xfs_file_vm_direct_ops = {
 
 	.open		= generic_map_direct_open,
 	.close		= generic_map_direct_close,
+	.lease_direct	= generic_map_direct_lease,
 };
 
 static const struct vm_operations_struct xfs_file_vm_ops = {
@@ -1209,8 +1210,8 @@ xfs_file_mmap_direct(
 	vma->vm_flags |= VM_MIXEDMAP | VM_HUGEPAGE;
 
 	/*
-	 * generic_map_direct_{open,close} expect ->vm_private_data is
-	 * set to the result of map_direct_register
+	 * generic_map_direct_{open,close,lease} expect
+	 * ->vm_private_data is set to the result of map_direct_register
 	 */
 	vma->vm_private_data = mds;
 	return 0;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help