Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2509163pxa; Fri, 7 Aug 2020 12:57:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8jErOoPvrVs8bk0sBK+38UTTgPnb8x/snCpGiKOUDEFWzuwR4OKWEnBENSNU7mk+AEJ1a X-Received: by 2002:a17:906:d8b6:: with SMTP id qc22mr11526578ejb.468.1596830267168; Fri, 07 Aug 2020 12:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596830267; cv=none; d=google.com; s=arc-20160816; b=HjP0hrREOx0pDMZHLnNWWslGUZUYI3lcL4WiFAa4PDhP2GHlWictPt7+Yoei6bbZZ9 ErTliMX790chjvJqA7dobt3jz1MLd2pWrLZI7qRdK6lJYGBhUbql53NVpoZlSXiYXITY K1pN6mvCQj1wr+awbzOaWwXpgQzftIiLnG0AldJaygKDFC8yfIGqXVHZ7tXd33zFnhW6 /MaKiFs+5Vp6oL1c1Jpxh2AoMw/kkz8nCFJu6e4BJk+V+5JQFCFnzL01rwkzmeDBgHgO vRET66SMlvEJ3Sp2yiCX2dDkUlVSvPUnXBb0xeY53q0QEwQrqjaJlL+tuilCjy0C5ZXZ FpUg== 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=ZDqXD2TtSUhhe1fmfc71LWO9xKmi0hI+AvOpGNLOk0I=; b=0slqyIxwcficLPFrYju63lNlwQsKfc8rdviR1iIRPVJscvYhgWzMCKbPW3yrG5Ng5l fblDM9VxgZME/a9Qfbsxwzw5n3IGpKJdExeZZrMMImVBqwRgSk/HlsxlwGUwNadE5R+1 V5Peix7usXFbc7EipsXYDGlaq+0X9A65mNwyZmy2aH7Xfz83pN2GKMHPLAJsyxjTg+qv /4B0/+WAy4zLHgv6McLPQrN6+6l/bjDtLSgslHhrSCJsuPXKtaO+hJIumyD4i8xVl63A fiUNvy4JyvJIxiPrMhDfNyzTkmU/GLqtBKKcEnrbYKYXGIvP7sMbZTunbPm+iQpggsy8 5fIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NRk61K5u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id d23si5625997edv.224.2020.08.07.12.57.24; Fri, 07 Aug 2020 12:57:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NRk61K5u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727800AbgHGT4W (ORCPT + 99 others); Fri, 7 Aug 2020 15:56:22 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:55546 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726978AbgHGTz4 (ORCPT ); Fri, 7 Aug 2020 15:55:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596830155; 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=ZDqXD2TtSUhhe1fmfc71LWO9xKmi0hI+AvOpGNLOk0I=; b=NRk61K5uyjpXaMw264RTED2+/On7NDYHXsw6VUqQRroMlTcHrXilNd24XL9zP/5G6Ylttx gELsHlh3IsC93rrhRdsZ5fRWzoW/FYcI7Eb/XZAl0ISj8f4+bsNzBIRJZYmcSdB9+Xc+f+ IoQQhDMsk8Z12FPcvTb3jwbNdLJDiz0= 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-400-Ws3ldtSPPaK-FvFvMpiWAg-1; Fri, 07 Aug 2020 15:55:53 -0400 X-MC-Unique: Ws3ldtSPPaK-FvFvMpiWAg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4A835800688; Fri, 7 Aug 2020 19:55:52 +0000 (UTC) Received: from horse.redhat.com (ovpn-113-142.rdu2.redhat.com [10.10.113.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBF935D9E8; Fri, 7 Aug 2020 19:55:46 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id F20F7222E55; Fri, 7 Aug 2020 15:55:38 -0400 (EDT) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, virtio-fs@redhat.com Cc: vgoyal@redhat.com, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, Peng Tao Subject: [PATCH v2 12/20] fuse: Introduce setupmapping/removemapping commands Date: Fri, 7 Aug 2020 15:55:18 -0400 Message-Id: <20200807195526.426056-13-vgoyal@redhat.com> In-Reply-To: <20200807195526.426056-1-vgoyal@redhat.com> References: <20200807195526.426056-1-vgoyal@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h index 5b85819e045f..4c386116978a 100644 --- a/include/uapi/linux/fuse.h +++ b/include/uapi/linux/fuse.h @@ -894,4 +894,33 @@ struct fuse_copy_file_range_in { uint64_t flags; }; +#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_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 */ -- 2.25.4