Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1199939rwd; Thu, 15 Jun 2023 07:34:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4aTXseFtbi8ytUlWDAW2e/Hi1/eb5EgXtqbttTNV3ZC+D0hBDDPojNuZq1gXkujEVvQG/U X-Received: by 2002:a17:906:d54b:b0:978:94b1:25ac with SMTP id cr11-20020a170906d54b00b0097894b125acmr22058404ejc.40.1686839687891; Thu, 15 Jun 2023 07:34:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686839687; cv=none; d=google.com; s=arc-20160816; b=NlpSQ+DYMmMU/aJSCyXmRBesFJCf0gIF9wGfjS6BrQzJJ1aQAEXc68DDwui9oX06Fn P7BumvoMiDm4N95PnfycuDNxpaw8qbaghxNzJtuvh/PQu66XHjKSxpvtwaqF+/qNBJG2 N5WV0y2i/ED+4XLO4xkTRTtsuE0HTAQtQYKfcoIla/qM9MWC6059X4fiegSvUGrFC3aR 6Ao4Q8Po50U1uXU2rrWH+MLsoc5WAgCo65rC7gsOtwWhU7xOfujq5jEfEc2jIFi65El4 9QyAsR5TJtVVXOzp1g9Hlu18WgR5QSIFW6GA+vuf5EQU3TUwJ7Lm8CC4k7qTem/GdoJQ /p0g== 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=ku9/Y8s2mP+xONHgtjbEBDk2m9YTYHojnpYbbrsLvSw=; b=zCrQdiflA9gYH60Vl7kwiyhrUW03LrDRn/TwbCbDlihvjOB8REoHO+cRjPVP+UheBF 5rGdeqMkMoj5dvRzE69SLDFaZAlHw81zy6rVFRHmv8TvNadZz/ESDWN0sCnibIiY4yCh 6nDANdHi3Kkp/5a6C4/Pq7cgUzU2INPwZKGbMDJyJucGlfyRZrZjm1ME/zV/yMkdKupr z0IzWG+hYwS04ZMi5wH0RlJuSzEm301S1m1LHHGMKsfbNlnzbuGjXAq5FWbml+w5VFVv L7KjKwWvFVhEe1nKHqgbs+Eujjx7Rlqm3QGK6wGEmXnFKeLdnxCoS9wgXz2DySnTJtlm 0HeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=E5gfS0PT; 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 f14-20020a170906048e00b00982817b0858si1884609eja.364.2023.06.15.07.34.23; Thu, 15 Jun 2023 07:34:47 -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=E5gfS0PT; 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 S1344934AbjFOOM5 (ORCPT + 99 others); Thu, 15 Jun 2023 10:12:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344929AbjFOOMp (ORCPT ); Thu, 15 Jun 2023 10:12:45 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96D162953; Thu, 15 Jun 2023 07:12:33 -0700 (PDT) Received: from localhost.localdomain (unknown [119.155.33.163]) (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 4A6AF6606F74; Thu, 15 Jun 2023 15:12:24 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686838352; bh=P9YCBV1QZ95F3uqEp5i9HYUF9tuHDwaQOv3IScV4z0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E5gfS0PT7X0Y+vqsFeXenWrwrvluBLvAPBrZs3LVVK+s1d5dYHEQMZWOi/GfDW7lb nUHDuzZAz/DOZiwmFhWYWx7aL0B8p0i8iYnrwi4EkTJNGbeKUAY+/ZuLCzpDl0L1JM PbuGpHWiT6tPaXZL/7dkVRYAVJmpZ8qLqvLvmH2pcVtx2JCE00dEkvHvPxhenrHHoC sVwkevcHYx7HaYgl6GqmNIxdlz7s2OsvJtszkCn9oMVM8p05+u5cRpIicxZvrME/pF tBA11+YyC9loHAHH9NAqOmPLj8jNQf2XZapA0XX6Q1A+XZcTvBRk092i2RgOyH8E4p ymi3uoAI0lu+w== 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 v19 3/5] tools headers UAPI: Update linux/fs.h with the kernel sources Date: Thu, 15 Jun 2023 19:11:42 +0500 Message-Id: <20230615141144.665148-4-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230615141144.665148-1-usama.anjum@collabora.com> References: <20230615141144.665148-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 v19: - Update fs.h accourding to precious patch --- 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..a9fb44db84a3 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 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) + +/* + * 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 + * @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