Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4703109ybf; Wed, 4 Mar 2020 09:02:25 -0800 (PST) X-Google-Smtp-Source: ADFU+vsvGvovFVVLikCC5+qQgER6nFN25Y+jIybAzWfnhBq/N+rQEzz3VQDUoeKwdFT3iTLUje5d X-Received: by 2002:a05:6808:8f1:: with SMTP id d17mr2382766oic.105.1583341345458; Wed, 04 Mar 2020 09:02:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583341345; cv=none; d=google.com; s=arc-20160816; b=jN2Br/sLsqfOTqSdbXm9tEkm/6ZUPXC6qd2t/RYDFl/w2/kmrRgNCAs/04m9z+ZgB0 BH75RAvYreYiDlWcHfuQ26uuiCfjRVtdVILzFvgklPg93sm94OY4lJ9rSY7AZYrU4Ut+ VRrp2IWBZ9paqmA0G7sMG5ZigTferuU5GDjOeUQZLgO4XolH6kpVZZyr6wWMnSqAqSH7 6YLCyiyh1dDBI0rinfEzhJXqBTpK+I05aPU4tv4sgGdHtV4tfY/iCbnNAhTjssqErS0S Hk6V7wreWu6GS5g2TnYuTvCdri8ySxp+3nge5rU4o/bAPVY5fz62AgcKg8fxzCuXY1ec uKsA== 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 :dkim-signature; bh=Er9GaMZzdsOf9xEWkAkuca5dLTt+xn8O50AMDB2wK58=; b=hHFz4XR2DWHdxbJb0SP29RPzjtkEZJMCVYm59wPMDdZ0YeYTOijXXgQEr8MRQvx/ia sXyOjGG64+xffFfJdTUgy/e007gO9WFzx/iIiACJILr0pecyg3aXhWKntgi6K1ryhfeW vZWFWpLTf7dgX/KTUgOqfJNe5oiKC4jjYKvoKcwlOEExMYdUxAFi/Rt54zqSsmQb44Ag C+viwiexRVMyNrp6lAmKIZ6sC3KgGRv6l1w/VX2LsrSI8jiv0P5/bti2xcWm13HkZspI /TxGQJ0mbArknJ7K7sr5wQWgKPTsA0RYVIEWBVESqVkPXR1n4Oln6jO01Cq54m5ZbPIU AUtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OhmPYUqR; 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=pass (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 y2si1369605oto.195.2020.03.04.09.02.07; Wed, 04 Mar 2020 09:02:25 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OhmPYUqR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729973AbgCDQ7R (ORCPT + 99 others); Wed, 4 Mar 2020 11:59:17 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:55642 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729638AbgCDQ7P (ORCPT ); Wed, 4 Mar 2020 11:59:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583341155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Er9GaMZzdsOf9xEWkAkuca5dLTt+xn8O50AMDB2wK58=; b=OhmPYUqR0mJR/I1+1sSkVGdy9lUEMAfXQ7IP+zVottKtJ5/cbRWELM1E2BzHBUobrzIgjT 4sgHCP9F1PbYvl8sxr7alromq8P9L+yommQYFM1mRCYWGjsFV4hqd67pV364VuAmYKvQMo q7FJNZ/hSmjeRdhiuUu8QkQQpqrBV1M= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-216-M5lHkdEMMj-8WUyOMMWnBA-1; Wed, 04 Mar 2020 11:59:13 -0500 X-MC-Unique: M5lHkdEMMj-8WUyOMMWnBA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3BC1EDB64; Wed, 4 Mar 2020 16:59:12 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15B9873892; Wed, 4 Mar 2020 16:59:12 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 6A74C225812; Wed, 4 Mar 2020 11:59:03 -0500 (EST) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, virtio-fs@redhat.com, miklos@szeredi.hu Cc: vgoyal@redhat.com, stefanha@redhat.com, dgilbert@redhat.com, mst@redhat.com, Peng Tao Subject: [PATCH 12/20] fuse: Introduce setupmapping/removemapping commands Date: Wed, 4 Mar 2020 11:58:37 -0500 Message-Id: <20200304165845.3081-13-vgoyal@redhat.com> In-Reply-To: <20200304165845.3081-1-vgoyal@redhat.com> References: <20200304165845.3081-1-vgoyal@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Content-Transfer-Encoding: quoted-printable 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 Signed-off-by: Peng Tao --- include/uapi/linux/fuse.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h index 5b85819e045f..62633555d547 100644 --- a/include/uapi/linux/fuse.h +++ b/include/uapi/linux/fuse.h @@ -894,4 +894,41 @@ struct fuse_copy_file_range_in { uint64_t flags; }; =20 +#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 { + /* number of fuse_removemapping_one follows */ + uint32_t count; +}; + +struct fuse_removemapping_one { + /* Offset into the dax window start the unmapping */ + uint64_t moffset; + /* Length of mapping required */ + uint64_t len; +}; + +#define FUSE_REMOVEMAPPING_MAX_ENTRY \ + (PAGE_SIZE / sizeof(struct fuse_removemapping_one)) + #endif /* _LINUX_FUSE_H */ --=20 2.20.1