Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp2196528rwb; Thu, 27 Jul 2023 03:47:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlGOeiuslJbOw+cJJfvJc+n6GZ0wjXFkM1iVgZk9s880PVyHgH82Te9T9HGUMzEtWs7c1n/M X-Received: by 2002:a17:906:310d:b0:969:93f2:259a with SMTP id 13-20020a170906310d00b0096993f2259amr1600343ejx.73.1690454856271; Thu, 27 Jul 2023 03:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690454856; cv=none; d=google.com; s=arc-20160816; b=oN1462guFZkOcD9Wz1eUrLR/PSxZdDqHJipz57MRhNQwZwXXvgNUVA/HIErIL+Qi0h YthxQrCyTqlzuYpedsdnzAv8mS2gFlEtv0DjddcfGpBoYpwP7+UBIbVTaMg30E5qpksB iWyMy6PVe4tfRTRSPfdIO+mc92sP4Veu51NpvLjjn20ICDfr9D49lKd1KM/S2/NQPTL3 gT8h9LpIW1aoWGPDWGrYk6rXIr/PqYE4eqBponWM9jmDaXvg25Ze777n4uFfMghqQKnE mUdtwjqQoO8aMwUjRybWM5mpTyLjB/gbdXxB+4jJO3JmJyIjEXarGyJ8JR8wrD+pcKxC BiSg== 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=wsz9WqYV5jVQc+TBJks4MSrsY1i7UTzQuAjaomif5F4=; fh=oQJfh+Vr4T6Dbl3+mbv1Iadpbiax+AEVFgc4RYmtzn0=; b=hHHvr8LSfr7xFum7K7ReXECvapr7AM3oP89kUyNskub6aKKVexX5GCn2WEXzomsB5B azS3ESa1IcZ21hOXxPMK9vCm65froGpkpiyneqRDIyiue2Bgll+eSLnVSqe1cxniM6l6 pzas46IVgUrJNbgga/XIent6S1Uk4dWlhND6vGWftIuj4OWOLVFS1FOpD2aiB0QSyzKD RmjT5eo2SOqZTT8aTehWERFHca8cGRtLb+Mx6lXzkiXqsK9FdxHw+XgJoCk7FlRspk31 aKRBJh14r/IvToRsa0FjkUkUoKpF8OBr2igDDCdwvgyNfYVPIGcLjnGTnxguDOlXELWl gjOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AVTalQpm; 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 h19-20020a17090634d300b00987e40fd473si834738ejb.1019.2023.07.27.03.47.11; Thu, 27 Jul 2023 03:47:36 -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=AVTalQpm; 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 S233977AbjG0Jku (ORCPT + 99 others); Thu, 27 Jul 2023 05:40:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233893AbjG0Jjs (ORCPT ); Thu, 27 Jul 2023 05:39:48 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15AC54207; Thu, 27 Jul 2023 02:37:31 -0700 (PDT) Received: from localhost.localdomain (unknown [59.103.218.24]) (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 A2FE6660702D; Thu, 27 Jul 2023 10:37:14 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1690450649; bh=dabNFCG6XmuM1SNYKLB4djPlZIef3vyE5I3SQQtbvxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AVTalQpmFPRaIFA4HBHC9I9feR4ru83QmgUHp7mvMKqC7SbA//H/oc6An9pc+18Ti 4DBQIS85WyF20JZnX3ub3z94dmOpmvH0JfO52zTLPDMHBoJ/F//3RfBc5KRusLFZJT /5f6FHi0pC8RCTqOz6hnAEQpE0wyqwFzbS57d02xufENLDTu0LpVzZC5+9tC70xehb nDy3qwXsqXiGgi6EyamZacJhJ5PhlzR2dZPMeo5LK9oypaKTd1gJe+hUkk8gxx2D2o T1wtolUZ7v2WPpnPkHw9iE3RLPbzZIyafGOTGdRMBChucM6J5IQr5+TPJLVVCyLpA5 5juu8pAMy7t4g== 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 v26 3/5] tools headers UAPI: Update linux/fs.h with the kernel sources Date: Thu, 27 Jul 2023 14:36:35 +0500 Message-Id: <20230727093637.1262110-4-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230727093637.1262110-1-usama.anjum@collabora.com> References: <20230727093637.1262110-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 --- Changes in v26: - Update according to tools/include/uapi/linux/fs.h Changes in v21: - Update tools/include/uapi/linux/fs.h Changes in v19: - Update fs.h according to precious patch --- tools/include/uapi/linux/fs.h | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/tools/include/uapi/linux/fs.h b/tools/include/uapi/linux/fs.h index b7b56871029c5..1bb3c625c2381 100644 --- a/tools/include/uapi/linux/fs.h +++ b/tools/include/uapi/linux/fs.h @@ -305,4 +305,62 @@ 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_WPALLOWED (1 << 0) +#define PAGE_IS_WRITTEN (1 << 1) +#define PAGE_IS_FILE (1 << 2) +#define PAGE_IS_PRESENT (1 << 3) +#define PAGE_IS_SWAPPED (1 << 4) +#define PAGE_IS_PFNZERO (1 << 5) + +/* + * struct page_region - Page region with flags + * @start: Start of the region + * @end: End of the region (exclusive) + * @categories: PAGE_IS_* category bitmask for the region + */ +struct page_region { + __u64 start; + __u64 end; + __u64 categories; +}; + +/* Flags for PAGEMAP_SCAN ioctl */ +#define PM_SCAN_WP_MATCHING (1 << 0) /* Write protect the pages matched. */ +#define PM_SCAN_CHECK_WPASYNC (1 << 1) /* Abort the scan when a non-WP-enabled page is found. */ + +/* + * struct pm_scan_arg - Pagemap ioctl argument + * @size: Size of the structure + * @flags: Flags for the IOCTL + * @start: Starting address of the region + * @end: Ending address of the region + * @walk_end: Ending address of the visited memory is returned + * (This helps if entire range hasn't been visited) + * @vec: Address of page_region struct array for output + * @vec_len: Length of the page_region struct array + * @max_pages: Optional limit for number of returned pages (0 = disabled) + * @category_inverted: PAGE_IS_* categories which values match if 0 instead of 1 + * @category_mask: Skip pages for which any category doesn't match + * @category_anyof_mask: Skip pages for which no category matches + * @return_mask: PAGE_IS_* categories that are to be reported in `page_region`s returned + */ +struct pm_scan_arg { + __u64 size; + __u64 flags; + __u64 start; + __u64 end; + __u64 walk_end; + __u64 vec; + __u64 vec_len; + __u64 max_pages; + __u64 category_inverted; + __u64 category_mask; + __u64 category_anyof_mask; + __u64 return_mask; +}; + #endif /* _UAPI_LINUX_FS_H */ -- 2.39.2