Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp948802rwp; Thu, 13 Jul 2023 03:57:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlHFW+9B6v00LLtxLYxxAl1smhBL7zQ0YcyVlsS8ZVQJq8Quk/3UbzieT1MhfGDk3F+8QonQ X-Received: by 2002:aa7:c0d9:0:b0:51e:ca0:8a2e with SMTP id j25-20020aa7c0d9000000b0051e0ca08a2emr1384018edp.36.1689245874767; Thu, 13 Jul 2023 03:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689245874; cv=none; d=google.com; s=arc-20160816; b=Esiq5Jvpu2WUdTR0A/mlVDRr/ZdP11BaSWwhabAKFty4ahgbNO3Kv1/mbxZUF0Qpuj RDWkqOFIY5kHcmUJuR8wMhy8KLPD0n9Y7B6i7P0JadZFfhA906m0lx4somGfaeie0O1k f6X+xp8eOPon6SRbLpeyBUqNjBdDtqBGqoUL1/FMc4H0R1s7f5RHAuQ6E0mxgO6e/W1C 0o/vuxrpdm9YbOW7idSAbJYbly45qfJ9GN0JhjTByeRaPtqX52+9wvhK889rwR2lypbP oU+hMx0UZHJ4CM/jawsHnAV+7inM/RAbLRS4dw0L07+SJwwYeSL1KO/Bi7oP74+mlea0 yBYA== 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=8wiGM7Q7eAABgqXCBfO0EzWj9ozwqucI7Vc0VSe2/BM=; fh=oQJfh+Vr4T6Dbl3+mbv1Iadpbiax+AEVFgc4RYmtzn0=; b=F1F4kf0dA/1Zq7gD0qKRpRy29ot5yVtXoTT9W7iX6uuaKxlgxBY04rM/mF0cRbW0ZH KtygzJtp0nbeXRm/Am3YrqGdK1dccuKyiQadYCHcNqjEhEdxA5EuUNnfz/QFWnNiXe5V bwORB9+Z6bAzAOgprQErfBiYogNdYUFrdymniWe6cbPTkD2IcXMEj7IOxgSuBYr75OoB sslygRXsWObvieRNs9bjyjCwWa7lznGlCC1T3hb8Zvkq6W6rcs/ClnUGeJ1PgbU/LPnx i3ct+xfIvV7qxLfg/egz5r9EmD8HHbwKgF/Qx/jABhQtGL0SzYc3xzn0U2dpSKSOD4Tl vZpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PvGLzxJ7; 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 v16-20020aa7cd50000000b0051e23250f88si6722859edw.349.2023.07.13.03.57.30; Thu, 13 Jul 2023 03:57:54 -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=PvGLzxJ7; 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 S234290AbjGMKP0 (ORCPT + 99 others); Thu, 13 Jul 2023 06:15:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234088AbjGMKPM (ORCPT ); Thu, 13 Jul 2023 06:15:12 -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 389242719; Thu, 13 Jul 2023 03:14:56 -0700 (PDT) Received: from localhost.localdomain (unknown [39.45.151.35]) (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 BED7E6606F62; Thu, 13 Jul 2023 11:14:48 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1689243295; bh=5buco7QtB4jur/NsS/yDxCuMSRfJbuncKSNIdEednz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PvGLzxJ7F5jdqklNVtgby62C9tywkBI3jnlfwtULnVuh6eincQpfUHpNHKDrmWeQb /yl0HpmEqxEWJI9f+GSdgnz9RnpRgXPYhoRS0JgYBG7CI4RFrPf/rFjUkz5nPUEF9N 3tb7Bu2uCbMUcbrU1Kz/mjTTAzC8LlzPyWHgy9j4fDiywl2dkoS2+C9Gq1F6DqkKu8 KUNqWyh0n3tlFVYzabQf+wbr9/dYs8BPtHKebtlQHCa1hgpqc+SXhABqbJHhvyLOHc 62IomXapv4PssrcJA9S9N1QSJezcN9Ovdlsnj9H0k4gjiytrMdfOtG/bjttbWHyLBA 24AdNJNwi7GpQ== 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 v25 3/5] tools headers UAPI: Update linux/fs.h with the kernel sources Date: Thu, 13 Jul 2023 15:14:13 +0500 Message-Id: <20230713101415.108875-4-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230713101415.108875-1-usama.anjum@collabora.com> References: <20230713101415.108875-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,RCVD_IN_DNSWL_BLOCKED, 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 --- Changes in v21: - Update tools/include/uapi/linux/fs.h Changes in v19: - Update fs.h accourding to precious patch --- tools/include/uapi/linux/fs.h | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tools/include/uapi/linux/fs.h b/tools/include/uapi/linux/fs.h index b7b56871029c..ac684d99e68f 100644 --- a/tools/include/uapi/linux/fs.h +++ b/tools/include/uapi/linux/fs.h @@ -305,4 +305,59 @@ 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 flags 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) +#define PAGE_IS_PFNZERO (1 << 4) + +/* + * struct page_region - Page region with 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 flags; +}; + +/* + * struct pm_scan_arg - Pagemap ioctl argument + * @size: Size of the structure + * @flags: Flags for the IOCTL + * @start: Starting address of the region + * (Ending address of the walk is also returned in it) + * @end: Ending address of the region + * @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 end; + __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