Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3321791rwb; Sun, 9 Oct 2022 03:07:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM42DBN5GmCaeUYT7HBF4HTshLwOahs4jpI7hkkSawL8LGSXLDwnX5u6PZlDcWE8xVYG10oq X-Received: by 2002:a17:907:31c3:b0:770:852b:71a2 with SMTP id xf3-20020a17090731c300b00770852b71a2mr10657963ejb.557.1665310036339; Sun, 09 Oct 2022 03:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665310036; cv=none; d=google.com; s=arc-20160816; b=K+6K4l6tKG5YxpJZrw1m1li3znRMZjaXtJsHFJAvhkLg3ylsMjggcEDG5Zr+vpINZg ireYqTbOCWnhHHnukBjOytqWC7Q+vIpjpexG01XMewsKwHTxlusYVyGVLe00agdiwPbs oEs3aTedmlAFbZFY8E8Yk/NUhkRGNbUCXpbpAGr2ybqRDtLe2BTd+G8xtXpLJCXC+bSf oRL/DfdFzBxZ5c3QliTyD1JhQVBuQL1j7HTg5UNBjnBu9BiR3uyIIH1ZHoi1dC6NAsqK dVNlQl5NgMjlYTBAbOtFrF5AFRsJG6tMcX0T+vbu4SerF6K0t82sAtp/426uy47VvXDV 7vBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=z4m/+MFcLOu4fQCGtHWhklBXP7FJWyhQPBvhnJItC0c=; b=D+X5zCnmr1y6XqCZlCy4IYI5GX+/r0iRjOEmpHI6GsaXrIKDqi06/X1DkpyAiHotRe H7MWlH3ZArZYiOPg2KevthqwZ8jJcya5IFeriXfLxQhNqIxvCqHlBzTt+H7n5TAwVu/T Fgus+tlmqEu65rDgUxDCl9cyBWIHGEx+p6nuYMExlMalWkaKh4Cum+2Sgvxels7zEzoK trOOCyJADfGRYyi2OSq8pmQNVFBT7Q7yIh0QxxCerXXcpE1YTYSMMpzYAtM77TtbQIJZ +UktzTkT72GxD5KRfiWzOLrYLcYAZwYCx8BSbpck1XEmaUgVFIz9OfHBYOacbQAANEJ+ COlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=M0BkIGpC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg40-20020a170907a42800b0073d7ad9607bsi7638148ejc.551.2022.10.09.03.06.44; Sun, 09 Oct 2022 03:07:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=M0BkIGpC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229602AbiJIJvK (ORCPT + 99 others); Sun, 9 Oct 2022 05:51:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbiJIJvH (ORCPT ); Sun, 9 Oct 2022 05:51:07 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 605791BEB5 for ; Sun, 9 Oct 2022 02:51:05 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id y8so8455196pfp.13 for ; Sun, 09 Oct 2022 02:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=z4m/+MFcLOu4fQCGtHWhklBXP7FJWyhQPBvhnJItC0c=; b=M0BkIGpCPs5WRIhkp5YvPZkU11BRLUcfcPNWBr3DX2G/p7/g7R0/gWmemHB6ZtiJw6 jJlsadqBG5YSHH1FbvPluGZTEHsH8CynoCL5n/Rwvbfq8AZ2s00eduguIaNplfp168nJ 4SVwb1BM4Imfwk5YISPgREglA7TCyGIo6lW/AYsnrm14/mFiDBLBGZzhrWTxpiJKh7RJ XNXZ4/CSmAl0PZ/G4AMnlnLtPQikFhtu9tEE2Vg2y7E8MWtLkyUk82+9jT/kuIeVRX5r EjTPdmtsl7eDlzOYEogrczXyUuRKb6e3pJ6r9lm1bfWt1RfSVz+EJXZlpENZgJP8AIbd vDwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=z4m/+MFcLOu4fQCGtHWhklBXP7FJWyhQPBvhnJItC0c=; b=ASmEZ4HrTPJii0o/sxN+1CWb0VRPsetJxACEP52nJygdnbFgV+nTwdezNdO3Qz1GyC sHw8a9VYQ2k+OEMSwinnaPPuSHG3N9AMeGh4bwqlzbqav/vqKPUeXMZM2sfY+DQIYBOG Xvf5fm9vtnrSSmhsZOWxzeczQtXhqfoxqvPk5OEn0n9bx4w14sJNAr4QQdEzi8F9smz5 2b3t60YMqeaHr+77Xic1ad/tfyZqJgMt8SErOUfnIbxeBj1/zDMswOfyRS7xrEUY4N1y CtfmlcbqPg0/OH+K1aFQLFYvkewOBviMqJT8vH3SdjGE/BfiTEmlI83wVLdeisGZKcCe oBtA== X-Gm-Message-State: ACrzQf13YzOy4o3Vw7SNAY4VCzBvLoarscK+4mxHDICTetb0/YkFX8gk tlPFiVFDgJwcgzdhyLXhsJvI1g== X-Received: by 2002:a05:6a00:1a08:b0:545:362c:b219 with SMTP id g8-20020a056a001a0800b00545362cb219mr13787740pfv.27.1665309064778; Sun, 09 Oct 2022 02:51:04 -0700 (PDT) Received: from [10.3.156.122] ([63.216.146.190]) by smtp.gmail.com with ESMTPSA id b7-20020a621b07000000b0053b723a74f7sm4795147pfb.90.2022.10.09.02.51.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Oct 2022 02:51:04 -0700 (PDT) Message-ID: <35dfe983-f916-d972-497d-269ec44cf7bf@bytedance.com> Date: Sun, 9 Oct 2022 17:50:58 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [External] Re: [RFC PATCH 2/5] cachefiles: extract ondemand info field from cachefiles_object To: JeffleXu , dhowells@redhat.com, xiang@kernel.org Cc: linux-cachefs@redhat.com, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, yinxin.x@bytedance.com References: <20220818135204.49878-1-zhujia.zj@bytedance.com> <20220818135204.49878-3-zhujia.zj@bytedance.com> <4fbf60f5-4ed1-3dd8-e4d3-de796e701956@linux.alibaba.com> From: Jia Zhu In-Reply-To: <4fbf60f5-4ed1-3dd8-e4d3-de796e701956@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2022/10/8 17:06, JeffleXu 写道: > > > On 8/18/22 9:52 PM, Jia Zhu wrote: > >> /* >> * Backing file state. >> */ >> @@ -67,8 +73,7 @@ struct cachefiles_object { >> unsigned long flags; >> #define CACHEFILES_OBJECT_USING_TMPFILE 0 /* Have an unlinked tmpfile */ >> #ifdef CONFIG_CACHEFILES_ONDEMAND >> - int ondemand_id; >> - enum cachefiles_object_state state; >> + void *private; >> #endif >> }; > > Personally I would prefer > > struct cachefiles_object { > ... > #ifdef CONFIG_CACHEFILES_ONDEMAND > struct cachefiles_ondemand_info *private; > #endif > } > > and > >> @@ -88,6 +93,7 @@ void cachefiles_put_object(struct cachefiles_object > *object, >> ASSERTCMP(object->file, ==, NULL); >> >> kfree(object->d_name); >> + #ifdef CONFIG_CACHEFILES_ONDEMAND >> + kfree(object->private); >> + #endif >> >> cache = object->volume->cache->cache; >> fscache_put_cookie(object->cookie, > > so that we can get rid of CACHEFILES_ONDEMAND_OBJINFO() stuff, to make > the code more readable. Hi JingBo. Thanks for your review. I'll revise it in next version. > > >