Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30031490rwd; Wed, 5 Jul 2023 23:10:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlF8yieYMTcnMolMThPxskjzt3KrccoBJm97kZxjwbqYDS4UxqPiBOLEilyyLUBJrDrtJgyW X-Received: by 2002:a05:6a20:3d1f:b0:12f:c61e:7cc3 with SMTP id y31-20020a056a203d1f00b0012fc61e7cc3mr1109741pzi.38.1688623837159; Wed, 05 Jul 2023 23:10:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688623837; cv=none; d=google.com; s=arc-20160816; b=c8B8JD3wQLXX/rUC6/F6SxrQXj5/p1HyJMGAKKfrTdqExyBjbiVTL6hh0SKS+WLIbC 0c/5t3lmrxPFR6IBdBHocCkYW7Z1Xgoykjj5DzdA9hbZNt7UnQDM+pBUPM+PXASqGbfT 7P44RT6BnWw6bBr5GO6Oi2GNohtHpmZDMIzAw4RHmVyKCbjcAWpJQ81JO26NHBVtw/Z6 GKme5ke/Lw786QtpcCT3eCto5b8d/UhE5cdJSXDgi5Owt6bKGQpypxS/koWA4lEeT6jH ACPzmDgBdf3k1rS1xocgzlEcsjw7iQbHq/ttkf8AZ7F0BlD2F7rx0h3xTVlKHB54giOQ LH8g== 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=dbQNGtGACIQsftNZ7KUBngOprAThCirieIIIiWW7vZHoBU0h78ERNwq+jGMyRVcX1d UPy0afN9r6BjKsfXOYVp5oEYX7sy00Q36tD7owPo7mmhYka8S6Cx3OWvYtGyq0WxwuaX T71FFUvz45IdaTXjySIPMbnGS41DA0wT5QreapKTFt6VrGgTSrxKvpjjVSHmUT1O0BZT stSmXhndXaMCDPlQsESvxyw1gVuvsoD0z4tV8QRiR5tZpkc7DCLCj58QE40TFvaHYEc9 mZf09t+3aUW/NE9VfxfLqshOEAB/beYN5xQ3yMxoe+ijwoJsBSWBeQa5vUVMSJ7xoZ5M nthg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=YsrvwX5G; 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 n13-20020a170902d2cd00b001b7fd6f95f6si695123plc.515.2023.07.05.23.10.22; Wed, 05 Jul 2023 23:10:37 -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=YsrvwX5G; 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 S233325AbjGFGDU (ORCPT + 99 others); Thu, 6 Jul 2023 02:03:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233344AbjGFGDP (ORCPT ); Thu, 6 Jul 2023 02:03:15 -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 E10AA1FEE; Wed, 5 Jul 2023 23:02:49 -0700 (PDT) Received: from localhost.localdomain (unknown [119.155.52.241]) (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 4EDB86606FBC; Thu, 6 Jul 2023 07:02:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1688623368; bh=5buco7QtB4jur/NsS/yDxCuMSRfJbuncKSNIdEednz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YsrvwX5GSGxHNTmn7qDMGntfvnI9TVy+4t6ChZmnFYtgVgJzmZPcs2zja73svx4oK 3R4h/WuQwcsW7jw2J0Mh3W5s9YsK6VwA5KFV41IG1TITc1IsugViY9p9Vq+apwAksO bGxwlnxEpgC53yoxWKtJCshdst0r9s5QZHD76GGnVWLltSbV63TJX+nfWrqywVZ5gJ 7csbILiioHF4sHwkn/kZS1xrunUgJHn8421lyEPEMG0ZdsJjxygxddqOdjMmRnGjTi pWet9PS3LpEqoMyUmQj7LSelFapXAcfbvQntEpUkw909PhPa9pXqC49/wk5DPdpi3p Ot9HpwTnAtB/g== 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 v23 3/5] tools headers UAPI: Update linux/fs.h with the kernel sources Date: Thu, 6 Jul 2023 11:01:45 +0500 Message-Id: <20230706060147.444375-4-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230706060147.444375-1-usama.anjum@collabora.com> References: <20230706060147.444375-1-usama.anjum@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_SORBS_WEB,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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