From patchwork Tue Apr 18 06:20:06 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: 13215065 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 8ED0DC77B7E for ; Tue, 18 Apr 2023 06:20:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E25DE900005; Tue, 18 Apr 2023 02:20:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DD6208E0002; Tue, 18 Apr 2023 02:20:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC572900005; Tue, 18 Apr 2023 02:20:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id BDF268E0002 for ; Tue, 18 Apr 2023 02:20:54 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8AFB7140107 for ; Tue, 18 Apr 2023 06:20:54 +0000 (UTC) X-FDA: 80693513628.23.87CF9F9 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by imf11.hostedemail.com (Postfix) with ESMTP id C023A4001E for ; Tue, 18 Apr 2023 06:20:52 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=bC9KBL3G; spf=pass (imf11.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=quarantine) header.from=collabora.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681798853; 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=2rGbnCmi5anYVXXiUXGuyAouYOZfihaHaNDZbBNAjqQ=; b=nOjAJCztQyA4Ye6O/oAeqAWX3f9UdE3EN+a1ueLCbTyd8LOq3fwaTvxik6WMvnLJFCSBGv 0s34mXtQL+CFcnSoJdb+AE2sI1d0PccNa0HX1zdshtPRALeB6LwlcmlwZ7ihulkSNmsq3n IRGwV78WlRSWovk3wER4fjHGBaWoAWc= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=collabora.com header.s=mail header.b=bC9KBL3G; spf=pass (imf11.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=quarantine) header.from=collabora.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681798853; a=rsa-sha256; cv=none; b=I7c57PYuCRs40laLzKLpnrcR0P5o3yWlAFizC7INHlGnsYKzgucsoWOztOE4MAvQli5n1c kLcvDJj+AQJEXMc2N0eI35P7qs0amydPnm+4E5XMEhAiRVc6PDyB3SWPzPDLjY/oTMGfoz TM1tIWYS7WsKytD+k/aaUk38WwxJwWk= Received: from localhost.localdomain (unknown [39.37.187.173]) (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 D4D53660323F; Tue, 18 Apr 2023 07:20:44 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1681798851; bh=ZpDkuHO27naMA3P55LraZJjP93DvvWKsAguR36UqCHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bC9KBL3Gp+MM+m70j/Hgi07DOU43zR37hB3y8dn5xvvEX3uFVVIN7PRS382ZeFRaW nybODWUB4psQEVni9r1PjnclhW1XELb0Uvc8Q78YfF8qkNYMq5VWsYv+BLWzCGr+cf jKuCORDB+JV2X8ZWUkqDMfqZlljdLZK/73cTcK50PI451L+X+j+0JMlgb3Tij/wgF+ 0+w+2ttexoqbp7fmduP7nXilynY9cDZQdLXPRt6Zi71czO4I6DK5ddW1EgrxfU+tkf I+6aGnCuDZfyyGjUJLDxZswJaMlNPw9S5KCKHNkyVtUay+5loqkSPU+5Mr6kiZPWgo dgwDueHNknK7A== 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 , 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 v14 3/5] tools headers UAPI: Update linux/fs.h with the kernel sources Date: Tue, 18 Apr 2023 11:20:06 +0500 Message-Id: <20230418062008.1434826-4-usama.anjum@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230418062008.1434826-1-usama.anjum@collabora.com> References: <20230418062008.1434826-1-usama.anjum@collabora.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: zn8ijunmyoa4h4g969oocr73wxeoa8mb X-Rspamd-Queue-Id: C023A4001E X-HE-Tag: 1681798852-638202 X-HE-Meta: U2FsdGVkX1/iXKsk1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dY/tmK1MK+1GU+q5sLsUsIQLysvF/hot5sRD2xL3MAu82F4uvqLUXtMmZwPnj6xmEMt+6lWj7CZMEZEgzGccgf7A9c5S0nP6BvdYozb8aNLiAJqfcOUMDpBJ2R8aprOSD8QTIZRhe6kmS/WWsWHrq/cCkXUr+sTsNg= 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 | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tools/include/uapi/linux/fs.h b/tools/include/uapi/linux/fs.h index b7b56871029c..47879c38ce2f 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 the bitmap 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 bitmap 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 bitmap; +}; + +/* + * 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 */