Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4288726pxk; Tue, 8 Sep 2020 16:13:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQR4XO5j6Vkfwq4baRe/huqEHtl+FYGWeQFHn6HYW+d58dMg6nSukerHZfOESq8UmkkJCU X-Received: by 2002:a17:906:344e:: with SMTP id d14mr880032ejb.42.1599606805633; Tue, 08 Sep 2020 16:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599606805; cv=none; d=google.com; s=arc-20160816; b=AG81YkLImFJAE97F7u80Bui7Lgk3jhhGwX+eVld6HHelfTm42AqAuxB6qzA+t7sM+B hMF0qkrr4LJi6R3duOColJ1x18ax6mx+sRLJs1RvDrt+6xiK0S57OB3iZI5l1wmivbgj yEt5BCW261voazMrnO9eutc+iBKfCG/K4eiDj2SB1rG/3l5SyjrvuB5VAyrzZgR2P8sA flscvRW7GtjHLNxklSEbwRFtaj7TEgt7tXnfi8vRXrLVvKGHC9Yu/SLdWygv1m12IMjn eZVnYdFI/BWcN4pjhLh3DmdiI3HkadR4oqxfUYZdxBI2EiVsVLqpTMZgVzePK5pewlXV rqiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=d2eXmnCqu0SOOWoMlCLyygGtYkUiwKo4dKRW0ixC3Qc=; b=q797IFJt846cBl8JS8ZLTAEbMeuDRuoiDDnOyOScn/ClCshLkttwhn6oFsjEHD7+Zs iBLd9n65UbvG4xZsKj5iY+091D5RKhjkZM8dqZHofmPLXM9YsQoMhGbFdkxiyYlGKcdr CKA5WVHSi0yu9HXtBfqNB5D5vNSlv7BgKiJ04D4TGTp+nIpkxf+5Q/iKapzTB2iLpucw /S8zy2cH8T/PQOwdXdJkAcEvZptCZ2CTVaQ3SUU+m91Qt4YI0xCRQOMnDYbZQHrR5wHP L65W/WpxCfh78I+Lwzpm2I9IdkS/BZJRtidQ5lu/vSBcOwjLE9Noej2biSdfdAb1AkI6 RlHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F83+yibe; 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 gw6si317357ejb.240.2020.09.08.16.13.03; Tue, 08 Sep 2020 16:13:25 -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=F83+yibe; 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 S1729908AbgIHXME (ORCPT + 99 others); Tue, 8 Sep 2020 19:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728297AbgIHXL7 (ORCPT ); Tue, 8 Sep 2020 19:11:59 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BCF6C061573; Tue, 8 Sep 2020 16:11:59 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id gf14so360438pjb.5; Tue, 08 Sep 2020 16:11:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=d2eXmnCqu0SOOWoMlCLyygGtYkUiwKo4dKRW0ixC3Qc=; b=F83+yibeQuEhJKMBgMMEZWgtOX/N47s7/FjWmpncrajXpMzj3DycInSP57lZ9TFWvA WD2/GU2ySfG155GFM68+rkB+PiulBHhHFFmSA48T8p7AB7bJPqR/7tJGXqafOknQfUjz fdzr1AutBPLDKqqsuJ3SXGVQzE0lgR9HDYKeOclqPfBlgv9cxHi8XnC7o37LoWc71CGi Ev1/f8oylIXxSK64AcOJvZXFfXcYoTHL7XVF892uqeDO/vNm2MUJdcUS03wtB8ors6JX yHojeq1iu/DcEOVWL0dftXD4XIZW3VcfZPQDDXV/a1alUDa/BGneHydY7Y0BDQMV4d92 y0JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=d2eXmnCqu0SOOWoMlCLyygGtYkUiwKo4dKRW0ixC3Qc=; b=f/9vxT2NAK5RzpnzwRGm0xYbw5fOuYvdiE0kUj7128T1MpIC0bXMP5AmvecZgjQggq BrEeevOyCNHeP+Aig8/di4H2QERnBtGSkKLI9QwQub0bDTV2ckuxRZWzpBk312ob376o mUzaqz4x0GPCbfAaCpz6W+BSjRVHfTmKX9I48qDi3xNKY0YH4RRMNojEaHJ4T0N3544o 8pPbcp/qJE0JCUmJxixnueMAFWERjccWBwnv4uJaG/LXAw9rOgPqmGyV5x2ZkTU7jWbh /tJGy3h9deTnrsQtgqnZwNK10DDNAh+JC5y1UhsiEV6nNqiYu6nj72cwjroRBe741O+D xXKw== X-Gm-Message-State: AOAM533qoZopHE0DCOtxAzLT6M7pBpEBsFOCfpuXNaIBNK+I9VJk4LTI Lxs6KWQI/uTMbi2mssiiDhNFf4TMVMMKc8Zk X-Received: by 2002:a17:90a:b387:: with SMTP id e7mr1031212pjr.228.1599606719169; Tue, 08 Sep 2020 16:11:59 -0700 (PDT) Received: from haolee.github.io ([2600:3c01::f03c:91ff:fe02:b162]) by smtp.gmail.com with ESMTPSA id 82sm313998pgd.6.2020.09.08.16.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 16:11:58 -0700 (PDT) Date: Tue, 8 Sep 2020 23:11:56 +0000 From: Hao Lee To: Al Viro Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs: Eliminate a local variable to make the code more clear Message-ID: <20200908231156.GA23779@haolee.github.io> References: <20200729151740.GA3430@haolee.github.io> <20200908130656.GC22780@haolee.github.io> <20200908184857.GT1236603@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200908184857.GT1236603@ZenIV.linux.org.uk> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 08, 2020 at 07:48:57PM +0100, Al Viro wrote: > On Tue, Sep 08, 2020 at 01:06:56PM +0000, Hao Lee wrote: > > ping > > > > On Wed, Jul 29, 2020 at 03:21:28PM +0000, Hao Lee wrote: > > > The dentry local variable is introduced in 'commit 84d17192d2afd ("get > > > rid of full-hash scan on detaching vfsmounts")' to reduce the length of > > > some long statements for example > > > mutex_lock(&path->dentry->d_inode->i_mutex). We have already used > > > inode_lock(dentry->d_inode) to do the same thing now, and its length is > > > acceptable. Furthermore, it seems not concise that assign path->dentry > > > to local variable dentry in the statement before goto. So, this function > > > would be more clear if we eliminate the local variable dentry. > > How does it make the function more clear? More specifically, what > analysis of behaviour is simplified by that? When I first read this function, it takes me a few seconds to think about if the local variable dentry is always equal to path->dentry and want to know if it has special purpose. This local variable may confuse other people too, so I think it would be better to eliminate it. Thanks, Hao Lee