Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1162726rdg; Fri, 11 Aug 2023 11:45:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHTLFzwIHym7oJSMBcjtcREVObnUofejmXpp75aNqQU+cGiLqc72aFsP6t7yrnpkenZRtk3 X-Received: by 2002:aa7:c6d7:0:b0:523:38eb:395f with SMTP id b23-20020aa7c6d7000000b0052338eb395fmr2215036eds.2.1691779547687; Fri, 11 Aug 2023 11:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691779547; cv=none; d=google.com; s=arc-20160816; b=wxf1gQbG4HFS6XnAPxRc0RafTiz8zM5ldAx7ynIlJEl5a8eHadMNCm8WE5MPOnsX7m kmJ2uxP0r8i4GRYwo1ecdSRlVgyNS7UVwwnr5aTnuSuvhpwzAbcUtrMOODHvxb/ZQZku AVdVu3KDtAClAPdDaVsFmDk29t8r+PGbZvNaH3uc86Kp5WUs9iTvtN78GRWCirOVdS6J K3RA+ks4Oo5HA3ajQpa4afeT/SEg63bD0gc9We+YwET8n8hscFwRblJHDmF9N5uY03ug x1qt1/TFZ/kQWdnZ6OMtPJocM2hQeGKP1cbLdAIGXPpR/w3YTfvIjjn7sRHRtHbUJ/3A kLWQ== 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=k6t3J8B3hSDEqGXc5bKM6Q6lPcFaImK3d7mB/xpl/0w=; fh=oQJfh+Vr4T6Dbl3+mbv1Iadpbiax+AEVFgc4RYmtzn0=; b=ObbStjr0iKqGmCJHBDMEP3lpgpvjVI+s4C339mNXolX5pXAEyOjbRkpt6it88ZL5VQ xjlfdyVhOcZoTaIHByXnMNSOIC66YVHefz8UPuwNz7ttVWeHZuwRjOL/Ed3D88/1Yk9e 4Ulma0Soox+/BrtXDaarAo0ztzoorDs1ZxfXgZORijWLACWgATjmPG/z0quUIPfyb1UT Woi8KdKXATKRZwT3Rg0eK5FmrqGqSwzERgfqiJXIDLdQ2ja1jUfPz6xrR+itCR2yDzwc REPFGV66QNUJneD8d2bGyn3tzFchaJTf99xDZXXKWYqiEwGt/cMcJebkGrOOuFLHRW57 QAVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dZiHdUv3; 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 b7-20020a05640202c700b00522206ad6ccsi3890051edx.403.2023.08.11.11.45.23; Fri, 11 Aug 2023 11:45: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=dZiHdUv3; 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 S237111AbjHKSKA (ORCPT + 99 others); Fri, 11 Aug 2023 14:10:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237108AbjHKSJb (ORCPT ); Fri, 11 Aug 2023 14:09:31 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77DD8358C; Fri, 11 Aug 2023 11:09:22 -0700 (PDT) Received: from localhost.localdomain (unknown [39.34.188.71]) (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 5EF7A6607197; Fri, 11 Aug 2023 19:09:15 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1691777361; bh=9uTk0llNWEPmmOOkPfdRM+BOIR6HHEXo0/iE/XdTOcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dZiHdUv3U6izyyApUhRB7GlYkOqvT0JwkXUO+luehOwIVQaEWa0P03h9TnZ1sp5mR fhUbtl0k1mlgsu2+wZtAX0PijdX+jzWI2Dhb6G0rheKgnF38QzFGyWysi3RJLDPsp/ pzj/6VIRYsowXIua+GFEEQLHD4ps+aHt5SYO00g8VMLdLGF3N2fW+gih47PuDkJcU6 wx8MOvycUoCmshVm+rZ4OyATVC8ijOlsRHdhjYnUdG4xCj4h9yLzdZgt+fPdpEWR+H xn4ZirOb0x7USXfbcNUVUfVygQi3quiSq8kAgI+dCWcWkuQnHOKeVjAclCHtrAEmX9 6T+Iv3QVIBoIA== 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 v29 4/6] tools headers UAPI: Update linux/fs.h with the kernel sources Date: Fri, 11 Aug 2023 23:08:40 +0500 Message-Id: <20230811180842.3141781-5-usama.anjum@collabora.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230811180842.3141781-1-usama.anjum@collabora.com> References: <20230811180842.3141781-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, URIBL_BLOCKED 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 v29: - Comment updates Changes in v27: - Comment updates in fs.h 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 | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/tools/include/uapi/linux/fs.h b/tools/include/uapi/linux/fs.h index b7b56871029c5..0202af0434791 100644 --- a/tools/include/uapi/linux/fs.h +++ b/tools/include/uapi/linux/fs.h @@ -305,4 +305,63 @@ 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) + +/* Bitmasks provided in pm_scan_args masks and reported in page_region.categories. */ +#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) +#define PAGE_IS_HUGE (1 << 6) + +/* + * 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 Address where the scan stopped (written by kernel). + * walk_end == end (tag removed) informs that the scan completed on entire range. + * @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.40.1