From patchwork Mon Jun 12 03:01:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 13275400 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED215C7EE37 for ; Mon, 12 Jun 2023 03:02:14 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1q8Xon-0002b0-F5; Mon, 12 Jun 2023 03:02:10 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1q8Xom-0002au-5U for linux-f2fs-devel@lists.sourceforge.net; Mon, 12 Jun 2023 03:02:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=l1v+pSg/oWcs687py8tAQybrfDN3VE3PjazJlaYFLtQ=; b=XzYTrvZuDFai+XzgX5B3O1D0w8 0mAYp/gYocRPBKU5bTUhbkMDxjau/wQemurWrL7k2NLARtGh8RCipcJH/iCxEQvMa/hI1SX+DJy0o jaB42xEzPBRtTUkvrn7j7Q5i7YOBLu59XVrCQZfiE4IO+26JOmVEZEdThI8XB7M9/2Ns=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=l1v+pSg/oWcs687py8tAQybrfDN3VE3PjazJlaYFLtQ=; b=V bTtqHQF0JwaXGHoVllzTLRv8OIHVV2EGgGP69U2dQdTrpZsTWYhB3VghODPf6CFIU0LaAJcZlpJp2 9SejU34Dj3vY2s6mYhPUDk3/FpVthXK2iqqws+t83sxYVCWMUXIjESpyefwIiLZa3WAlpNJhcKTu+ yobMzPDanP+48Jmg=; Received: from mail-tyzapc01on2071.outbound.protection.outlook.com ([40.107.117.71] helo=APC01-TYZ-obe.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1q8XoY-0007se-P9 for linux-f2fs-devel@lists.sourceforge.net; Mon, 12 Jun 2023 03:02:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yr5XQwB115w71XaMsujnuZtRztM7frPMNuh9ri9iEOGEO1rhkK/KcmI1xdU2Umg/h+DdrYeeddK8IoKJcjRkazXESb4/TxqDLSVKE3lVS81rleRqKTX6r0sEQFRj11V7a+xakF2JoDlvm5fXEoXqZXclTCXU9c6GhML4ZVmYL1r8AlUwBla+LyFwi4sXAkRnGS1FzRSWVuoYvPaoeOy6QeU55dEpVq+Ld4oS58KpFtnn1romddMODM/2u+3rEzgUanNEbPnvcWRD7kpCqVZa4rI1Y2bm2+b+JA60fHCXbwraoydmg/H58zUI75HpEo7BP7m+iFpf0E5eub+pB7twqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l1v+pSg/oWcs687py8tAQybrfDN3VE3PjazJlaYFLtQ=; b=Ci9HqkVOtOZy3eGD8ZjWg/0QzC5KzHpY9ad/n04RHgGsqpR7fZYCoYdfWpsuwcWh53mD3aJWUuq9S3BhBlHcr0GyDkrnRVOKCtFnOCdfB32CDljWaEravmMSv7QX8eRtCwJasYj30AS/dQZP2OT3qaIJYiV0XkswVy5dn0iAgw8DvUx5abbq3EeErmTlAJStwil0s3rMaIZTy0/cUytbtcHxdhq7pTVsP5T0tGbL4ZJTrz1Wn1B37rqdL5IL72GLs1y/okWddkIR/j/KVhQrYb1ph68fIqkwrXWK8W0oqPDetjGFHH2GhqoYt2L1EHeDCZ2j0maSFRE79arJASVYDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l1v+pSg/oWcs687py8tAQybrfDN3VE3PjazJlaYFLtQ=; b=Qr07vN+St1CXRNDqCv1ijOppF0Cca8iLf5Kelv/wUrkLOLuOj9Dxkjp0qJ/akkbO2xu5MP0Xj1z9F67ZnNW7ujnGHE/rfmgGSIOnTzkZmrx+o5ZOAxGnyNPf//OpyHM/UE7RTCzu2aGluLKIlAawgoMLJIZjwJd3tV5WmtKU3/I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SI2PR02MB5148.apcprd02.prod.outlook.com (2603:1096:4:153::6) by KL1PR02MB6259.apcprd02.prod.outlook.com (2603:1096:820:dc::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.21; Mon, 12 Jun 2023 03:01:44 +0000 Received: from SI2PR02MB5148.apcprd02.prod.outlook.com ([fe80::6297:13a6:41f1:e471]) by SI2PR02MB5148.apcprd02.prod.outlook.com ([fe80::6297:13a6:41f1:e471%6]) with mapi id 15.20.6500.020; Mon, 12 Jun 2023 03:01:44 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Mon, 12 Jun 2023 11:01:15 +0800 Message-Id: <20230612030121.2393541-1-shengyong@oppo.com> X-Mailer: git-send-email 2.40.1 X-ClientProxiedBy: SI1PR02CA0029.apcprd02.prod.outlook.com (2603:1096:4:1f4::20) To SI2PR02MB5148.apcprd02.prod.outlook.com (2603:1096:4:153::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SI2PR02MB5148:EE_|KL1PR02MB6259:EE_ X-MS-Office365-Filtering-Correlation-Id: 6697293b-f580-4cb5-3f85-08db6af15a45 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XXQOlJhgHZg9QnxtBMsueE+i1ybSyXRQ/xo6pNCmI9/eJ4YqQFk3K4MGgfjhaxbWw1ohWKvrTYa5bmSa9i+ARuvunPgXVe3av2spPj0BMPrfjWF0VJYxKPD5oj9uCK22DZfXbH73dImpGX4KD9fgGS20VPH9JSR4X5wrRSmmjvIjZU2ZftD2nOqCPprcRBrAnQWD6qogVfC6D5s0zlB0HMbzIhSbj9PWygw1n1rrMnknxd6NO3Zx0VPhOylmymnXjthpC6NjS+3pxkDsU8n6S4bLVden7FgIeWJFSTgk3ht4Ewb1Uhp0rdQrkt2fyrTttydG5gUnGRIFtgAJubN1oCEimdsjgTkl/YKf+mvONnZLE16GFde2MO02C+N9m3y08g9ofRULm3rJ/wCaR03Np/f380V+FH9TObJtFOG5s0uGdeNffdHeyzxjZXcbsVXfVfkFyawZbkBcI3bhk/njcJVsmh6NMlewdsvrnxOHDoCfcqYhE16gJRXgBIOgTbDSSt/hKhzEq8SagLgb1hPy2aIPMrRlss2KR2SUlr3dMw3snrFZzBhu6q1mOkjiyr3+nwJpu4JJuS7piWWgegfNEmN7rMMoXRIfEM9QWcWvaCO0PSmhKToHPYl6kaK/L8V1 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SI2PR02MB5148.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(39860400002)(366004)(376002)(396003)(136003)(451199021)(66476007)(66556008)(8936002)(5660300002)(8676002)(36756003)(66946007)(4326008)(478600001)(6666004)(41300700001)(52116002)(6486002)(316002)(38100700002)(38350700002)(6512007)(6506007)(1076003)(26005)(186003)(2906002)(107886003)(2616005)(86362001)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: K2CA3fMnp0BJvs4CIxLHOW5ANTtXk+UjC6e/bThqJzCJ/prDohPndzhjs8nKXV+XJJyYCBU0XCNYH+IC2yiFg/KHbCPy2G2LRiqhv7LR26BvqPKWuH3ScTSJLxRg+vGOC5REmPv3ttn9H875E+O56T18CGVFwLQXbsDI3Fu7gsNoKzUzlaxt6wVUWZVPJGlgkaRdYpbMZ5C33qUBqnRWt1G0WXaxctM9ORbSgwug50LLyOWDB9fKqMN7WmjCbODz2ZoHN3jokJC1h2Gmg5SGgmCehLh5V6eFqQ+wrxKf2/lumvnNS4XXG5f5kHh/N5lQSy0PT3O3MXnrAuKO57VQfiIdFVLJ4Z2h1XFHDnHKe2FecOgJ9GJhAGSttj3RjdsYqObJbiIT5oQ0LRVjVAToUZsS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vdgBYhYG/igNnYqfqmI0/0rKgvTx9nJE6qNC11/dPCkKu5DVadE2rSlfQu6lTHh++MKNx197Go2oGscMpFM8GRH6emmKdRb8hsg X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6697293b-f580-4cb5-3f85-08db6af15a45 X-MS-Exchange-CrossTenant-AuthSource: SI2PR02MB5148.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jun 2023 03:01:44.0198 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JIC0P4AbuRE7r2p/CE9d65Q2C5mlEzB62cjSlcz7Ka0TvoGfT+qIYmcN7+xL2XuZ554ZzcOXn7GdQVu9jgi1Tg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR02MB6259 X-Headers-End: 1q8XoY-0007se-P9 Subject: [f2fs-dev] [PATCH v4 0/6] f2fs: add f2fs_ioc_[get|set]_extra_attr X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Sheng Yong via Linux-f2fs-devel From: Sheng Yong Reply-To: Sheng Yong Cc: ebiggers@kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This patchset introduces two ioctls to get or modify values in f2fs_inode's extra attribute area: * f2fs_ioc_get_extra_attr * f2fs_ioc_set_extra_attr The argument of these two ioctls is `struct f2fs_extra_attr', which has three members: * field: indicates which field in extra attribute area is handled * attr: value or userspace pointer * attr_size: size of `attr' The `field' member could help extend functionality of these two ioctls without modify or add new interfaces, if more fields are added into extra attributes ares in the feture. In order to reuse existed functions, several helpers are added to: * read inode chksum from inode page * get compress blocks * verify compression level And, a compress_option v2 is added to access compress level and flags. Thanks, shengyong v4: * split into small commits v3: * setting lz4(hc) level correctly v2: * fix compiling error if CONFIG_F2FS_FS_ZSTD is disabled by adding a helper f2fs_is_compress_level_valid() * fix compiling warning for casting unsinged long long to pointer Sheng Yong (6): f2fs: add helper to check compression level f2fs: cleanup MIN_INLINE_XATTR_SIZE f2fs: add helper to get inode chksum from inode page f2fs: add f2fs_ioc_get_compress_blocks f2fs: add f2fs_ioc_[get|set]_extra_attr f2fs: access compression level and flags by extra attr ioctls fs/f2fs/compress.c | 31 +++++ fs/f2fs/f2fs.h | 4 + fs/f2fs/file.c | 280 ++++++++++++++++++++++++++++++++++++-- fs/f2fs/inode.c | 21 +++ fs/f2fs/super.c | 6 +- fs/f2fs/xattr.h | 1 + include/uapi/linux/f2fs.h | 33 +++++ 7 files changed, 359 insertions(+), 17 deletions(-)