From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 58857C4727C for ; Sat, 26 Sep 2020 00:21:31 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D63B620708; Sat, 26 Sep 2020 00:21:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="eHVNgSo8"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="Tb4DCLvT"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="MEqMR1fJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D63B620708 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1kLxxv-0006oy-Uj; Sat, 26 Sep 2020 00:21:27 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLxxv-0006os-Io for linux-f2fs-devel@lists.sourceforge.net; Sat, 26 Sep 2020 00:21:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=T1DVnTV/Iyvac1kNC77Y1KhUVre2fhWMO1Q8QNAxYQ4=; b=eHVNgSo8KTpZ6l5XVvjN6JsGtA sO1FjmurRlUZcikRLnvLCrzRbTfBFMJDhahUEcmBTmfrr5qVoQhKpU6DMVWhYX7wUSmDYVK0Sqp5y pVk5XXtrpoe4lUCc5FAohKAaQ6HPUVIf17iKgfhQMbADDSytsf1d3NQqel7c5+4Ol6/M=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type: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=T1DVnTV/Iyvac1kNC77Y1KhUVre2fhWMO1Q8QNAxYQ4=; b=T b4DCLvTiT6+1LI63kGsqZh3jLq8VgGkb6XZXRt9Lex3o8tzfnsOowqqdmiGOUBcwyd4GNNmRkBS7r GTTVlouU/iKjw+BTv7AjdS5hbqJIpjBl0eAYk0VhSwg5y0PiEhxKIq3RzCPjC2/ofhn4IsMZtXvlF 80+1H6Pry47DHySg=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1kLxxr-008WN0-E0 for linux-f2fs-devel@lists.sourceforge.net; Sat, 26 Sep 2020 00:21:27 +0000 Received: from localhost.localdomain (unknown [49.65.245.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B6ADD20708; Sat, 26 Sep 2020 00:21:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601079670; bh=w3xgP3gAwRlU3vYJVUANpQQUeyeF3V/RiVdViNeNL1I=; h=From:To:Cc:Subject:Date:From; b=MEqMR1fJJSFuBupHaRkT/QxkloTXml0X4aPZtjmQL2HY5wvyhGg0EnRppPBWfEG5w MeYrJO/NM/2mMdryIZWeP5L1qRJOwCyX1AHGK2zr2AQyU/dl0gbKCwE63Su1geYdHt dxFObno/6muCr3JKV0D0vtz+NXtvKtemEx00aAJI= From: Chao Yu To: jaegeuk@kernel.org Date: Sat, 26 Sep 2020 08:20:46 +0800 Message-Id: <20200926002046.6560-1-chao@kernel.org> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-Headers-End: 1kLxxr-008WN0-E0 Subject: [f2fs-dev] [PATCH] f2fs: remove unneeded parameter in find_in_block() 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: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net From: Chao Yu We can relocate @res_page assignment in find_in_block() to its caller, so unneeded parameter could be removed for cleanup. Signed-off-by: Chao Yu --- fs/f2fs/dir.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index ceb4431b5669..8d98597d3960 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -190,21 +190,15 @@ static unsigned long dir_block_index(unsigned int level, static struct f2fs_dir_entry *find_in_block(struct inode *dir, struct page *dentry_page, const struct f2fs_filename *fname, - int *max_slots, - struct page **res_page) + int *max_slots) { struct f2fs_dentry_block *dentry_blk; - struct f2fs_dir_entry *de; struct f2fs_dentry_ptr d; dentry_blk = (struct f2fs_dentry_block *)page_address(dentry_page); make_dentry_ptr_block(dir, &d, dentry_blk); - de = f2fs_find_target_dentry(&d, fname, max_slots); - if (de) - *res_page = dentry_page; - - return de; + return f2fs_find_target_dentry(&d, fname, max_slots); } #ifdef CONFIG_UNICODE @@ -330,10 +324,11 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir, } } - de = find_in_block(dir, dentry_page, fname, &max_slots, - res_page); - if (de) + de = find_in_block(dir, dentry_page, fname, &max_slots); + if (de) { + *res_page = dentry_page; break; + } if (max_slots >= s) room = true; -- 2.22.0 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel