Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp794399pxa; Wed, 19 Aug 2020 15:23:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweAXlm4dsU4+ew77ZJEEbTytuGNbDq9mYq5sv3TVs7bU7ILEDdCgMITT7hBsFKWAX/4H9L X-Received: by 2002:a17:906:9989:: with SMTP id af9mr425958ejc.385.1597875796517; Wed, 19 Aug 2020 15:23:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597875796; cv=none; d=google.com; s=arc-20160816; b=O1MtANiRrJgE/UDKOqVK4mjZeZsdUux5ZZjteOE+XnDEstAArnqePpfIF+O//cuyQw AMWW+CuasF53e6a1IxNTFR91rdWc1FdrCM77l5ptqtyPIdv+3q/7NKQD16Rg6EiIwUmV fCjVmVaVK0A77EOds5b1vaRLm6ar1RrNxsFhlUGm51jtQZayGgZnCLLKiPaDJXqDDgG+ KOrmARENhH8CHle+3vnemLwH3dCbK1DlGhdCnOAHIkfl+bQfyNDNIC0nt6htvu7aAeIq F2WSo4OzJbt24SR2qvh9fUhxdoeSXDGXqdIzzSfY1tJA+tLf3nseloCcwlUUk86fnVXv 88fA== 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=Mul6xYMxBSgZ+hw59Zt3uye6OAmruS4cZeubQ0rXxgM=; b=lturunpAiSz8XGoxM2S3abvfnNJCNYhAgociWgFckCTpbnUBxko3qoPa9X6Kei3bie sFRIES418CH6UbBVSKVo9vJJC+2d3c72RrnGYJ2sb+6aQCxOuoU5HW9Y9TB8RenB7+BT EPmeI+XWjjcG6GAdlVGLmB2Vl7PcvnFr50EwDboxQ/KDYz8StLeEnob3Efg1KbvJGHDs kCcxzPrO2jgP7AeOeLJEkOUbav9WLTOqbueSKs6MuuWcfUtgjItiEfrW8rCq5AnuqKmp dJ+3RtnE43gspALvPnioPxObPfNsF1hKmaf+3SLyYAgvMatoMe5eUhXL2IZFG6DCyqzw K/TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OV7Kyua9; 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 y19si25022eje.337.2020.08.19.15.22.52; Wed, 19 Aug 2020 15:23:16 -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=OV7Kyua9; 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 S1727920AbgHSWVg (ORCPT + 99 others); Wed, 19 Aug 2020 18:21:36 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:59956 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727915AbgHSWVP (ORCPT ); Wed, 19 Aug 2020 18:21:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597875672; 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=Mul6xYMxBSgZ+hw59Zt3uye6OAmruS4cZeubQ0rXxgM=; b=OV7Kyua9NmYVT4IFZrSWji0DuMULCAHmnphFoO3qHuXbRRyBvJr4jaemYLM6GaXP9drSxf RMPyEvvQ7SJ/dBaph0Cz+8ocmgkhhSNhEptBU1KybCJje7mBHiPbVb231SY+1Rj5tZAiIw 7YUXaMxVYP2fZkKZY/AtBxcOkYGv6Zg= 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-535-dmD4I7AnOHuEHQVyL9Tchw-1; Wed, 19 Aug 2020 18:21:08 -0400 X-MC-Unique: dmD4I7AnOHuEHQVyL9Tchw-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 72E668030B0; Wed, 19 Aug 2020 22:21:07 +0000 (UTC) Received: from horse.redhat.com (ovpn-115-197.rdu2.redhat.com [10.10.115.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85FBD5D9E8; Wed, 19 Aug 2020 22:21:01 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 10D3E2256EA; Wed, 19 Aug 2020 18:20:54 -0400 (EDT) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, virtio-fs@redhat.com Cc: vgoyal@redhat.com, miklos@szeredi.hu, stefanha@redhat.com, dgilbert@redhat.com, dan.j.williams@intel.com, Peng Tao Subject: [PATCH v3 12/18] fuse: Introduce setupmapping/removemapping commands Date: Wed, 19 Aug 2020 18:19:50 -0400 Message-Id: <20200819221956.845195-13-vgoyal@redhat.com> In-Reply-To: <20200819221956.845195-1-vgoyal@redhat.com> References: <20200819221956.845195-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..60a7bfc787ce 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