Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3943607rwe; Mon, 17 Apr 2023 06:02:27 -0700 (PDT) X-Google-Smtp-Source: AKy350aSNqozJial1PCrCSL0Qa+x7qj6cqy5P3O4VMtSqFg96Jqx9+U3i3In+oXelDGNtkNT2anp X-Received: by 2002:a17:902:e542:b0:1a6:e564:6044 with SMTP id n2-20020a170902e54200b001a6e5646044mr2207988plf.7.1681736546966; Mon, 17 Apr 2023 06:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681736546; cv=none; d=google.com; s=arc-20160816; b=bEbajp4QG1XT0B3sIWxghcFTkfpHcl5To14Jfdl1UOAgWxjNqc8niE31BAlwLtQcFp OESmESt+megj5eV1AYWE5J6tnhbrWcfA2Czcgnz34U7axldswtOlIOGAn/Ee8w/geLST +YzNHgiC7LH39Jhp9An+Ne65Z1yWP1ZHHWx0ALbuV/JUkxVA8qMdt0oKpGBOoiHKLl41 3gcQqKGIfAxxL4Yg4Y+vmBr4TuypW6rHNM9h7PTvJjw/XkSoWnl2noMfd/qinWLsJISS 6HD3qEoKq7zZkUYvUix7G+k4it1PiL4VdZeyPldFfKqto1zMPVyA5tCyKCodt3dgPr+4 RiJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2rGbnCmi5anYVXXiUXGuyAouYOZfihaHaNDZbBNAjqQ=; b=yIaQRe+Qd10xGBg+ihmd7zdUCTkH4u7migrLFGrXdOu7YLgNZGELWPqYzwtMmQfJxW b22wu09i5tKWvsuqBWTXB4HmgN9eZQC9s34qs6WP3VM+jqsDr5ecCMDEl9Nokf0ABSIA AWaq2AAMFdi3Co8/uRG9ZBE4PwBPkxVz8s6vaZMdTIbDKhoWDg2Pu9GiDqEtOoTlZ5MQ 4ud2pFeGTg1L6Bt0C1R9Gf/M6kYPwLKbdegPz0+QvkV8f4DMwNfzJ/8T0qq1n3YfSfed UESSF9wRrcyUVGk7w+iJJ3bJqyzzKjFw6zRLkcAlUQfgpU/6BwTg1FAF6CjgQ8fL+Q63 ylkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JsyPkv1w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020a1709026a8c00b001a527a498fcsi11069693plk.169.2023.04.17.06.02.11; Mon, 17 Apr 2023 06:02:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JsyPkv1w; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230024AbjDQNA2 (ORCPT + 99 others); Mon, 17 Apr 2023 09:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229812AbjDQM6Z (ORCPT ); Mon, 17 Apr 2023 08:58:25 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A3E11716; Mon, 17 Apr 2023 05:57:20 -0700 (PDT) Received: from localhost.localdomain (unknown [39.37.187.173]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id E8BDE6603237; Mon, 17 Apr 2023 13:57:08 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1681736238; bh=ZpDkuHO27naMA3P55LraZJjP93DvvWKsAguR36UqCHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JsyPkv1wEMdN1syicLfNVVqWXefHlCC69dZWmHKFb12UNwgVkNTd1I7jVE8btnmtE n7DTTQgYdGJPpitvR912Yis4+2W+ZPiT+Ez293+pnVNPr3TgKD+gR9hBJounNZJNj7 nEDIMP/M0vbAEoeCN86vuaF8CEVS9KFCG3z5lZQ7qLTRaZynPJrG+hvWbQ56V4oofS 2XqFnfFLGoaNTGGUjvIn5eeYtDYsr24/qygd4UbuUiuAXalhzLpgzE+m5Rdv2c0NO9 qpNNTSXTZWJoYKoSjaCKfX1p0xgTkj0PW3RPPDbkVLpyIbRaoud20j1Y6R2ewEoAeO 4/grKIa3hKDZg== From: Muhammad Usama Anjum To: Peter Xu , David Hildenbrand , Andrew Morton , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Andrei Vagin , Danylo Mocherniuk , Paul Gofman , Cyrill Gorcunov , Mike Rapoport , Nadav Amit Cc: Alexander Viro , Shuah Khan , Christian Brauner , Yang Shi , Vlastimil Babka , "Liam R . Howlett" , Yun Zhou , Suren Baghdasaryan , Alex Sierra , Muhammad Usama Anjum , Matthew Wilcox , Pasha Tatashin , Axel Rasmussen , "Gustavo A . R . Silva" , Dan Williams , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Greg KH , kernel@collabora.com Subject: [PATCH v13 3/5] tools headers UAPI: Update linux/fs.h with the kernel sources Date: Mon, 17 Apr 2023 17:56:28 +0500 Message-Id: <20230417125630.1146906-4-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230417125630.1146906-1-usama.anjum@collabora.com> References: <20230417125630.1146906-1-usama.anjum@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org New IOCTL and macros has been added in the kernel sources. Update the tools header file as well. Signed-off-by: Muhammad Usama Anjum --- tools/include/uapi/linux/fs.h | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tools/include/uapi/linux/fs.h b/tools/include/uapi/linux/fs.h index b7b56871029c..47879c38ce2f 100644 --- a/tools/include/uapi/linux/fs.h +++ b/tools/include/uapi/linux/fs.h @@ -305,4 +305,57 @@ typedef int __bitwise __kernel_rwf_t; #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\ RWF_APPEND) +/* Pagemap ioctl */ +#define PAGEMAP_SCAN _IOWR('f', 16, struct pm_scan_arg) + +/* Bits are set in the bitmap of the page_region and masks in pm_scan_args */ +#define PAGE_IS_WRITTEN (1 << 0) +#define PAGE_IS_FILE (1 << 1) +#define PAGE_IS_PRESENT (1 << 2) +#define PAGE_IS_SWAPPED (1 << 3) + +/* + * struct page_region - Page region with bitmap flags + * @start: Start of the region + * @len: Length of the region in pages + * bitmap: Bits sets for the region + */ +struct page_region { + __u64 start; + __u64 len; + __u64 bitmap; +}; + +/* + * struct pm_scan_arg - Pagemap ioctl argument + * @size: Size of the structure + * @flags: Flags for the IOCTL + * @start: Starting address of the region + * @len: Length of the region (All the pages in this length are included) + * @vec: Address of page_region struct array for output + * @vec_len: Length of the page_region struct array + * @max_pages: Optional max return pages + * @required_mask: Required mask - All of these bits have to be set in the PTE + * @anyof_mask: Any mask - Any of these bits are set in the PTE + * @excluded_mask: Exclude mask - None of these bits are set in the PTE + * @return_mask: Bits that are to be reported in page_region + */ +struct pm_scan_arg { + __u64 size; + __u64 flags; + __u64 start; + __u64 len; + __u64 vec; + __u64 vec_len; + __u64 max_pages; + __u64 required_mask; + __u64 anyof_mask; + __u64 excluded_mask; + __u64 return_mask; +}; + +/* Supported flags */ +#define PM_SCAN_OP_GET (1 << 0) +#define PM_SCAN_OP_WP (1 << 1) + #endif /* _UAPI_LINUX_FS_H */ -- 2.39.2