Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp456503pxa; Wed, 12 Aug 2020 06:26:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJye5u8e8jr8rLk5xY1lQMa0Vec4py8UfkMvg7oUdpq0EtobZxw+aV8UY3+qwfGvagYeDXxW X-Received: by 2002:aa7:da48:: with SMTP id w8mr30465930eds.329.1597238807228; Wed, 12 Aug 2020 06:26:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597238807; cv=none; d=google.com; s=arc-20160816; b=okXUsqBb7inSo2cXqCODByDqfNGXzIP08Bp9fWSHwX8rGcE8oigoXkWzRQVXjUPYMb oiFl9UUrmrZWIf/oBYrL0FbD17P9o3rlF4yGlGDW0IQeiKUar/1gOj3iS3uJC4qkS6CK iK2uyrATrMrYKYK/SocI5ktD4HfNHiN1XFr0pIB6T2GN31FNZ1wIMTGM7V0Ox2Z0mbhM jW1uZMC8xPhlmsIIL02RwHGuWbJKBT2f//4/EP+Fobj9wINKC2q5v4UvUKCbl+7j63LG gsPXjbtALJqPShb2zoscUi1D6uJirhTP28tShIZd2moBriQeDxW1OajzbH06JsKpMt5K Tdxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=vsh9LbZS25VEwc0/PjxhGwt9OFiuf3IWSR0oj9yoXvw=; b=sDBm2cKV1tcuQvP1h0aP/wZxfAga2Qa8yEpCZIsRo26DoC9+Vu/afbWWAj1Hm1OWVk LH3XoIXHM0wizReJhldCfBRnDEknzh9NN+W10th3MKonMuCS+xBh1z9hwDaYndzj3vrM gRNpEGV1RWJ9jarQUz1esDCo05aScBpWyPi+RsfwzZn7XfuycqixOrDjEYuxpA3tR11v hpw64GGiVbVjCGyncHK1MpURi5mOxRT1X+k3aEPR4bLWj5LCwVqmMvIllsxc+cmN/EL0 voOj1ZEPFblMxwMUpbMFKMNzlE/ICbLnv23Mo7LiXnkqBZJTROe0VVGh9PyvnS6J0iJy WAhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S7YCoH5o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bq11si1205965ejb.126.2020.08.12.06.26.24; Wed, 12 Aug 2020 06:26:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=S7YCoH5o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728050AbgHLNZo (ORCPT + 99 others); Wed, 12 Aug 2020 09:25:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728025AbgHLNZj (ORCPT ); Wed, 12 Aug 2020 09:25:39 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5868FC06174A; Wed, 12 Aug 2020 06:25:39 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id x15so1098657plr.11; Wed, 12 Aug 2020 06:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=vsh9LbZS25VEwc0/PjxhGwt9OFiuf3IWSR0oj9yoXvw=; b=S7YCoH5o5rRbjQDSAxwO7eUJunX0kiLLGSMwZIWFWHz47Qw4/FgRFtCSjTTRcdUSu8 9lVM94zWynKyrTS7KAxQji9qr/iZPkxY4fHzegWZJ354ByrUZiCkJ2NxJdk5h4ve4BMr dhJsQbllIxeqa9vrvc0fjQMSspTj1JbpkyxswO+lmuv4DQUQuUgAALFv2d8NBmmOjCLA Qe8JkUHBVvAg3IrdDM/mzYUoY8LDCNS4yX5wkPY0RGDX1FXJeNFhhey6Pkim+zPRJVz+ ccR56uyIIHgZODeNBFkhXmcGFmJ8YIK+D5kFCR9iRFuExidvNlX2ebarebvG+MuGptfp KDoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=vsh9LbZS25VEwc0/PjxhGwt9OFiuf3IWSR0oj9yoXvw=; b=R7skH/JdBp8yvi1zTXeMpUUd6MZZO/G7xVE/1IiKfovUKs8YSL8bJq6pqjAduTHR+f 1zPQqwwKkNviIyCpGnIhT7gZLFwNWVuZFsUSkqnPMf5OUWdzKr+gdw4K/JDISRoWewi5 HpaeCWygHVGxmVI3xqev/k+Fa8xsHANiCZhdCQ04C40ipU5tuAl3SCP3hLZ8DIJ6yrA+ KHKVm7PYa4/oq48j3dea59JU9VSKTu6nNeZk4i527iW1BKL11hw8vcSG69xtMIVjSiGv tRU0NV/cJT05N9OhxQulSMgIk3UwzdoZBL3fQ0qStP8TbViPoD6MgqpAXdymwXKlCRHy I0Rg== X-Gm-Message-State: AOAM531hIQM07pEJ+X7IOWQ3bv2ZPPUKPHZJrq3pgKPsLMpedUG6uCld lYTayh4e74TJLoIlB10rRjINuPyx X-Received: by 2002:a17:902:8509:: with SMTP id bj9mr5285483plb.179.1597238738473; Wed, 12 Aug 2020 06:25:38 -0700 (PDT) Received: from ?IPv6:2404:7a87:83e0:f800:5c24:508b:d8c0:f3b? ([2404:7a87:83e0:f800:5c24:508b:d8c0:f3b]) by smtp.gmail.com with ESMTPSA id q71sm2247255pjq.7.2020.08.12.06.25.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Aug 2020 06:25:38 -0700 (PDT) Subject: Re: [PATCH v3] exfat: integrates dir-entry getting and validation To: Namjae Jeon Cc: kohada.tetsuhiro@dc.mitsubishielectric.co.jp, mori.takahiro@ab.mitsubishielectric.co.jp, motai.hirotaka@aj.mitsubishielectric.co.jp, 'Sungjong Seo' , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200806010229.24690-1-kohada.t2@gmail.com> <003c01d66edc$edbb1690$c93143b0$@samsung.com> From: Tetsuhiro Kohada Message-ID: Date: Wed, 12 Aug 2020 22:25:34 +0900 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <003c01d66edc$edbb1690$c93143b0$@samsung.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thank you for your reply. >> @@ -171,7 +174,9 @@ struct exfat_entry_set_cache { >> unsigned int start_off; >> int num_bh; >> struct buffer_head *bh[DIR_CACHE_SIZE]; >> - unsigned int num_entries; >> + int num_entries; >> + struct exfat_de_file *de_file; >> + struct exfat_de_stream *de_stream; > I prefer to assign validated entries to **de and use it using enum value. > struct exfat_dentry **de; I've tried several implementations that add a struct exfat_dentry type.(*de0 & *de1; *de[2]; etc...) The problem with the struct exfat_dentry type is that it is too flexible for type. This means weak typing. Therefore, when using them, de[XXX_FILE]->dentry.file.zzz ... It is necessary to re-specify the type. (against the DRY principle) Strong typing prevents use with wrong type, at compiling. I think the approach of using de_file/de_stream could be strongly typed. I don't think we need excessive flexibility. BR --- Tetsuhiro Kohada