Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp934920yba; Wed, 15 May 2019 12:32:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8unf9WOpur1Xtos8JfFfky4nv0I0qee8gxcewEdibtvzFbIvMFQBuP8rzv52N7SMDPxLy X-Received: by 2002:aa7:8683:: with SMTP id d3mr4175677pfo.145.1557948769893; Wed, 15 May 2019 12:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557948769; cv=none; d=google.com; s=arc-20160816; b=tab/XbSF8MDeDC5+z5pE+yra46D+NdpUxaTkNvhmPB43/9YEKKzdianrneOL63V6LW AlMjjfbSGsiejSuP/z1sWGB2ZEHy6Tw1HSn/50IfXv9UjmjsPZhKc86GbKTDqD0KazGx /4WVys+5fjZjCixgovDm9/eKWLCvgM57e1PEC8sVTiqLYun78Kmn6G/U9WY0Fg3ZtzUu Uz+e77Aax8ySHIoNjPO/vUpA2JySLPaHRRjia05aNuxwOr/XqYV97bdd2LXlF6uR8p0P 1mNIXKMyILkNUxqs2CLffktnTajwg84cymPVsNjcODG7DJnPh/booo/i1/X9w1XKx5N2 u/VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=mGSC325LPOSYK6AkupJY3+Ujb3wXP2IfIex+kjmqdoc=; b=k3/Te85i07P97x9Y6kPB7ecU7roPCFbzU8Wk9yy5ntOOBVbUO0UugN9qDFzFdeeuN8 zVKOIAP8d6pgYh0Q5XsmQxl7yt1kT1ax56hF1ISDPhcnpkFx2JFK5HeTk4OLQmfsdO60 FtJAtC9RCSEMvg3o6eeMz/3qvEVidR0WgrboZG+bdeQtzlGaaIwNuGKDj1Ns5tby3Cek sYFPxJOCtlRfUleHq1v0LL/EuMpmw29qQO1uxuvhTqG0lwiyDGEPsUaenEk0d/DL5prJ L898iZjo8ugl5A11apTOsVv8rIE/hDnfvSNJuz+7gMOKcxpD32JF6p5d2xxP3SuGv+Fo /zSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si2521689pgj.451.2019.05.15.12.32.34; Wed, 15 May 2019 12:32:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727827AbfEOTa3 (ORCPT + 99 others); Wed, 15 May 2019 15:30:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58872 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727550AbfEOT1e (ORCPT ); Wed, 15 May 2019 15:27:34 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B327E3001A77; Wed, 15 May 2019 19:27:33 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F3DF19C71; Wed, 15 May 2019 19:27:33 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id E5707225488; Wed, 15 May 2019 15:27:29 -0400 (EDT) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-nvdimm@lists.01.org Cc: vgoyal@redhat.com, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, swhiteho@redhat.com Subject: [PATCH v2 20/30] fuse: Introduce setupmapping/removemapping commands Date: Wed, 15 May 2019 15:27:05 -0400 Message-Id: <20190515192715.18000-21-vgoyal@redhat.com> In-Reply-To: <20190515192715.18000-1-vgoyal@redhat.com> References: <20190515192715.18000-1-vgoyal@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 15 May 2019 19:27:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce two new fuse commands to setup/remove memory mappings. This will be used to setup/tear down file mapping in dax window. Signed-off-by: Vivek Goyal --- include/uapi/linux/fuse.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h index 2ac598614a8f..9eb313220549 100644 --- a/include/uapi/linux/fuse.h +++ b/include/uapi/linux/fuse.h @@ -399,6 +399,8 @@ enum fuse_opcode { FUSE_RENAME2 = 45, FUSE_LSEEK = 46, FUSE_COPY_FILE_RANGE = 47, + FUSE_SETUPMAPPING = 48, + FUSE_REMOVEMAPPING = 49, /* CUSE specific operations */ CUSE_INIT = 4096, @@ -822,4 +824,35 @@ struct fuse_copy_file_range_in { uint64_t flags; }; +#define FUSE_SETUPMAPPING_ENTRIES 8 +#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0) +struct fuse_setupmapping_in { + /* An already open handle */ + uint64_t fh; + /* Offset into the file to start the mapping */ + uint64_t foffset; + /* Length of mapping required */ + uint64_t len; + /* Flags, FUSE_SETUPMAPPING_FLAG_* */ + uint64_t flags; + /* Offset in Memory Window */ + uint64_t moffset; +}; + +struct fuse_setupmapping_out { + /* Offsets into the cache of mappings */ + uint64_t coffset[FUSE_SETUPMAPPING_ENTRIES]; + /* Lengths of each mapping */ + uint64_t len[FUSE_SETUPMAPPING_ENTRIES]; +}; + +struct fuse_removemapping_in { + /* An already open handle */ + uint64_t fh; + /* Offset into the dax window start the unmapping */ + uint64_t moffset; + /* Length of mapping required */ + uint64_t len; +}; + #endif /* _LINUX_FUSE_H */ -- 2.20.1