Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9980C433E0 for ; Wed, 17 Jun 2020 07:28:34 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 652C320786 for ; Wed, 17 Jun 2020 07:28:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.ozlabs.org header.i=@lists.ozlabs.org header.b="Jq68E5Rk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=aol.com header.i=@aol.com header.b="mfw3C5yM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 652C320786 Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=lists.ozlabs.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49mxWN3x38zDqsq for ; Wed, 17 Jun 2020 17:28:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.ozlabs.org; s=201707; t=1592378912; bh=QhOv+3eSK5V9tGxPa6TKNo5lOD0amIUernJk6wGS7Mc=; h=To:Subject:Date:References:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Jq68E5RkHo7HwjsmK2S3ieGpIakdTjVfLysg0qXQs9erS5WJi/cEdtJzNlPAQ8c9V eAhi6TRcvHrXtWUyzTKKbgToXWZvY+DjGxdMbh7UOe65JzHuY+r/qXueWyhoxo4KPg 0aX1o4z5Zbq7ar8FX/ADNdWkz3SaW0MMM9cy0nBGgdpF/i93h7pbHes/eLCtbBmxlI rTrOol4Am4ezGvdXFB+R33CKlnYGmK9Vj/S1NFHIqL99X2r0471fiCC1EzFJmYEepx Fkl0QKl0dGW/sb7ZRxXTnCWdTeYa51muAdyp9G2NHsnjazrdBvPZnNXotXxFHyHOQq f3Pt7v+EoDxaA== Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=aol.com (client-ip=74.6.129.40; helo=sonic301-1.consmr.mail.bf2.yahoo.com; envelope-from=hsiangkao@aol.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=reject dis=none) header.from=aol.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aol.com header.i=@aol.com header.a=rsa-sha256 header.s=a2048 header.b=mfw3C5yM; dkim-atps=neutral Received: from sonic301-1.consmr.mail.bf2.yahoo.com (sonic301-1.consmr.mail.bf2.yahoo.com [74.6.129.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49mxW903Y8zDqRL for ; Wed, 17 Jun 2020 17:28:20 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1592378891; bh=ru9RH7ikNyj/x48cS2YclH0i9ns/cJ1jgBc8E7LhItU=; h=From:To:Cc:Subject:Date:References:From:Subject; b=mfw3C5yMSo2f9NnpILQoBzkpHOXP2xUCvxqF8J2tjADMT3ZnUkH0FDlHtKxR1b2aQIa9TqjIN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wEWVL4v. FXItlOR0KQiQquiJDJ4F9sN84xaY9QqMX_DHwAetutfzUcRBy7npYKeGqzhMqCrUhcqQV3hiBc7o tNDUisGWjBA7QlAe07zdLhntGXEnDc0Dz6DdLTFRkhaKYc4JeQSyC4ARqkaHykVdFoCNoDal.gnC Q.PWU.dijPT2iSZMWZHovY_KxUFALuDgtulMoHhcROHCxDSzhmJXZomVq.W.1ZmqtS2n8YYA18.Y j0ZdaTd51mOiM4q_p9efd11BsTOha.RSkrqmpOl_QXucc8js_GFMfkIQtmxk6WOfVfEYi.qhzrZC 3QkojKf4x0zWyMsnXcb2MQ0yZopvhr315z9jy4VRU3.4fUwpiaVIf7bDmGs3iIcrvfT_KJmtf.c1 1dPG1S7ySxchvNiAVzLFRCVZ9F276_V5PU97E1p.6pcT6Z.tpNdWnu915lTUnJMPBRqSn0eye3P4 8PEPkcP0S7ffug8rynLFe5VE0s7BgObIfQn3OV25HUgn77pS.aqpQQWRv.psLTk9VhYtxlgTqec4 SNCluWji8ecogK071pSe4NovNOQ44bRR2VY42MscuapZ.kpkhsHHzihYqN.XqiorbIAC2Y2Lla6V nAbq63XOHBaV6Dk8U274- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Wed, 17 Jun 2020 07:28:11 +0000 Received: by smtp413.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID a80268c6b25d608660288644fb7285ad; Wed, 17 Jun 2020 07:28:08 +0000 (UTC) To: linux-erofs@lists.ozlabs.org Subject: [PATCH] erofs-utils: pass down inode for erofs_prepare_xattr_ibody Date: Wed, 17 Jun 2020 15:27:44 +0800 Message-Id: <20200617072744.7979-1-hsiangkao@aol.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit References: <20200617072744.7979-1-hsiangkao.ref@aol.com> X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Gao Xiang via Linux-erofs Reply-To: Gao Xiang Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" From: Gao Xiang Instead of several independent arguments for convenience. No logic changes. Signed-off-by: Gao Xiang --- include/erofs/xattr.h | 3 +-- lib/inode.c | 4 +--- lib/xattr.c | 7 ++++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/erofs/xattr.h b/include/erofs/xattr.h index 2e99669..9e2e1ea 100644 --- a/include/erofs/xattr.h +++ b/include/erofs/xattr.h @@ -42,8 +42,7 @@ #define XATTR_NAME_POSIX_ACL_DEFAULT "system.posix_acl_default" #endif -int erofs_prepare_xattr_ibody(const char *path, mode_t mode, - struct list_head *ixattrs); +int erofs_prepare_xattr_ibody(struct erofs_inode *inode); char *erofs_export_xattr_ibody(struct list_head *ixattrs, unsigned int size); int erofs_build_shared_xattrs_from_path(const char *path); diff --git a/lib/inode.c b/lib/inode.c index dff5f2c..5013184 100644 --- a/lib/inode.c +++ b/lib/inode.c @@ -827,11 +827,9 @@ struct erofs_inode *erofs_mkfs_build_tree(struct erofs_inode *dir) struct dirent *dp; struct erofs_dentry *d; - ret = erofs_prepare_xattr_ibody(dir->i_srcpath, - dir->i_mode, &dir->i_xattrs); + ret = erofs_prepare_xattr_ibody(dir); if (ret < 0) return ERR_PTR(ret); - dir->xattr_isize = ret; if (!S_ISDIR(dir->i_mode)) { if (S_ISLNK(dir->i_mode)) { diff --git a/lib/xattr.c b/lib/xattr.c index aa614f6..769ab9c 100644 --- a/lib/xattr.c +++ b/lib/xattr.c @@ -352,17 +352,17 @@ err: return ret; } -int erofs_prepare_xattr_ibody(const char *path, mode_t mode, - struct list_head *ixattrs) +int erofs_prepare_xattr_ibody(struct erofs_inode *inode) { int ret; struct inode_xattr_node *node; + struct list_head *ixattrs = &inode->i_xattrs; /* check if xattr is disabled */ if (cfg.c_inline_xattr_tolerance < 0) return 0; - ret = read_xattrs_from_file(path, mode, ixattrs); + ret = read_xattrs_from_file(inode->i_srcpath, inode->i_mode, ixattrs); if (ret < 0) return ret; @@ -381,6 +381,7 @@ int erofs_prepare_xattr_ibody(const char *path, mode_t mode, ret += sizeof(struct erofs_xattr_entry); ret = EROFS_XATTR_ALIGN(ret + item->len[0] + item->len[1]); } + inode->xattr_isize = ret; return ret; } -- 2.24.0