From patchwork Thu Feb 2 11:29:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muhammad Usama Anjum X-Patchwork-Id: 13125838 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EBFFC61DA4 for ; Thu, 2 Feb 2023 11:30:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F1DF6B007D; Thu, 2 Feb 2023 06:30:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0A3706B007E; Thu, 2 Feb 2023 06:30:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E85936B0080; Thu, 2 Feb 2023 06:30:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D51A86B007D for ; Thu, 2 Feb 2023 06:30:47 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A00991203BF for ; Thu, 2 Feb 2023 11:30:47 +0000 (UTC) X-FDA: 80422134534.01.2EF1408 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by imf19.hostedemail.com (Postfix) with ESMTP id BC7B01A001F for ; Thu, 2 Feb 2023 11:30:45 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=frnc3kJS; spf=pass (imf19.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.172 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=reject) header.from=collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675337446; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+3yo+ZbtJIQYsshC71ghIJjmRLo6eD0MgFgPIkbvW/8=; b=JrByCk+dQPA8tESCF8JIM3mwQEGG9okcRXvK5XjxGf6Fj9ZFK3l0YGm0ZZzjIF2XUeedi5 zrY6DWjz5bhMO/pPQHk/oelgJih4EHEqPQ7PXjOz56vXYiWsL+gioWzx/3kyaM5s6RNl9Q wWMJFwhojIWCodFL0L7adoDtJmFRpAQ= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=frnc3kJS; spf=pass (imf19.hostedemail.com: domain of usama.anjum@collabora.com designates 46.235.227.172 as permitted sender) smtp.mailfrom=usama.anjum@collabora.com; dmarc=pass (policy=reject) header.from=collabora.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675337446; a=rsa-sha256; cv=none; b=QEUMnR97g7jxlnngS+2rT+YEUEpAQVW6ikTu3gW5ldDBcUsYRFeIvTtX/m4Dfj656qAMTB ry+4mY2VROtPc6D977Ulgm4vLJ3aDNeGomvYkoIWs1EWQQ0WSxVI4enTFm651jQZhfowqp 5t2H+LwVPYED0u+1H21YsVZsfOZOJTw= Received: from localhost.localdomain (unknown [39.45.165.226]) (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 424FE6602EF0; Thu, 2 Feb 2023 11:30:38 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1675337444; bh=R/HtdMw3clmiQDnQYYbhMJw9ubwQr8QixF3sE7Xccl8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=frnc3kJSAm9263yyf3cneyAnevRuTQhVNg9A1vtRWxq0iA+/OOXiWeFyYemDntZKB SWtSV5aOwxF3iCIIxxu96ZaKP+xlERfbcgWdb1xIVZYyoEh70GeX9QOWrZBkneUoJY yP1QqSNlPdJikgL/CepS8i/2+dY0+wyDoIXbBAxXJrYletR3SF+jwDlo3jyOA08jPT RM/szZbA9E5EPYrI25GYGYpCf099RCQjly4HHybl7DPWkvA5Ysq0WWLJ2BmT2MGl+9 roxFv42F/gOmNYTDjULR4BKUTu+DryK/jFMD9XFAxvYxt9XlFggFGOsPSAoS0Dbxm8 fv07vfnsFtEbg== From: Muhammad Usama Anjum To: Peter Xu , David Hildenbrand , Andrew Morton , =?utf-8?b?TWljaGHFgiBNaXJvc8WC?= =?utf-8?b?YXc=?= , Andrei Vagin , Danylo Mocherniuk , Paul Gofman , Cyrill Gorcunov 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 , Mike Rapoport , Nadav Amit , 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 v10 4/6] tools headers UAPI: Update linux/fs.h with the kernel sources Date: Thu, 2 Feb 2023 16:29:13 +0500 Message-Id: <20230202112915.867409-5-usama.anjum@collabora.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230202112915.867409-1-usama.anjum@collabora.com> References: <20230202112915.867409-1-usama.anjum@collabora.com> MIME-Version: 1.0 X-Stat-Signature: 7wz99nwshzxbi1ayddngnfqu6hrrq1nn X-Rspam-User: X-Rspamd-Queue-Id: BC7B01A001F X-Rspamd-Server: rspam06 X-HE-Tag: 1675337445-907786 X-HE-Meta: U2FsdGVkX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n+iq/YaWATnG6DSWISZdhEEqvCGCqBpijsufOExR04KdIudnUVYL+8BBce4aZhzllTeuGZ10wJIYlyRtEZQoGI44SQvEqxHpTuKL+QLCBjFFOa0VpXLLGpj+sxSov1Q8E9/AHEAoKf9BvJv87kWcth+u/xbkjvpeLZE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: New IOCTL and macros has been added in the kernel sources. Update the tools header file as well. Signed-off-by: Muhammad Usama Anjum --- tools/include/uapi/linux/fs.h | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tools/include/uapi/linux/fs.h b/tools/include/uapi/linux/fs.h index b7b56871029c..1ae9a8684b48 100644 --- a/tools/include/uapi/linux/fs.h +++ b/tools/include/uapi/linux/fs.h @@ -305,4 +305,54 @@ 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 pagemap_scan_arg) + +/* Bits are set in the bitmap of the page_region and masks in pagemap_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 bitmap flags + * @start: Start of the region + * @len: Length of the region + * bitmap: Bits sets for the region + */ +struct page_region { + __u64 start; + __u64 len; + __u64 bitmap; +}; + +/* + * struct pagemap_scan_arg - Pagemap ioctl argument + * @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 + * @flags: Flags for the IOCTL + * @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 pagemap_scan_arg { + __u64 start; + __u64 len; + __u64 vec; + __u64 vec_len; + __u32 max_pages; + __u32 flags; + __u64 required_mask; + __u64 anyof_mask; + __u64 excluded_mask; + __u64 return_mask; +}; + +/* Special flags */ +#define PAGEMAP_WP_ENGAGE (1 << 0) + #endif /* _UAPI_LINUX_FS_H */