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.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 74933C30658 for ; Tue, 2 Jul 2024 12:02:54 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=tpack+0f; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4WD1kj1HZGz3g5r for ; Tue, 2 Jul 2024 22:02:53 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=tpack+0f; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.101; helo=out30-101.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=lists.ozlabs.org) Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4WD1k13tgfz3fyG for ; Tue, 2 Jul 2024 22:02:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1719921733; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=73+Ioq9OsYvM8E4T/xaLaB3w3e9H0BGxJ8shZbl01EY=; b=tpack+0feQkwABeZIinuCllKO8Lh7zE51dXXhm2uhLt34NtxKotz0WfG/zj3yAlHmHw1ekUihwmclESJMLRVEFXTCqDoTBWZXpOl25YA6nUDOl2f393OvoOIsR3vD+OQvGV5MeD+MdIRvtyWLloiMve8RLTdGLPBAfLVf8nSNvs= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R231e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067112;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=2;SR=0;TI=SMTPD_---0W9igBua_1719921730; Received: from 30.97.48.142(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0W9igBua_1719921730) by smtp.aliyun-inc.com; Tue, 02 Jul 2024 20:02:11 +0800 Message-ID: <6c329bf4-9544-4c81-9ac5-5d7afd7a451d@linux.alibaba.com> Date: Tue, 2 Jul 2024 20:02:10 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] erofs-utils: lib: chagne function definition of erofs_blocklist_open() To: Hongzhen Luo , linux-erofs@lists.ozlabs.org References: <20240702115647.2457003-1-hongzhen@linux.alibaba.com> From: Gao Xiang In-Reply-To: <20240702115647.2457003-1-hongzhen@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: , Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On 2024/7/2 19:56, Hongzhen Luo wrote: > Modified the definition of the function `erofs_blocklist_open` to accept > a file pointer rather than a string, for external use in liberofs. > > Signed-off-by: Hongzhen Luo > --- > include/erofs/block_list.h | 2 +- > lib/block_list.c | 9 ++++----- > mkfs/main.c | 21 ++++++++++++++------- > 3 files changed, 19 insertions(+), 13 deletions(-) > > diff --git a/include/erofs/block_list.h b/include/erofs/block_list.h > index 9f9975e..00da82c 100644 > --- a/include/erofs/block_list.h > +++ b/include/erofs/block_list.h > @@ -13,7 +13,7 @@ extern "C" > > #include "internal.h" > > -int erofs_blocklist_open(char *filename, bool srcmap); > +int erofs_blocklist_open(FILE *fp, bool srcmap); > void erofs_blocklist_close(void); In that case, should we don't `fclose(block_list_fp);` but return `FILE *` instead? As, FILE *erofs_blocklist_close(void); And makes the caller to close the FILE *. Thanks, Gao Xiang