Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2982303ybz; Mon, 27 Apr 2020 08:00:17 -0700 (PDT) X-Google-Smtp-Source: APiQypL2/PujuNPd5cgd55TeWu1Ob4NTqMQieFoTksc0fCLrNFHM/4Kn6KXKp8z2bUcJZAcQYBUO X-Received: by 2002:aa7:db0b:: with SMTP id t11mr17753849eds.304.1587999617768; Mon, 27 Apr 2020 08:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587999617; cv=none; d=google.com; s=arc-20160816; b=0hqy7WJwSMMGhdstl78h4Wsi5aA2YKBVScdVfoNWT8rHAkN/t0LCnIN33OaDT4LrZ4 CuIyWYJxFw10EEeDJjYkGPXxUYwFlU0R1hvHExi4UehKHHL6IZpv1rHCSaB0lwnsMuBa /3SIE01VVhTB7TPNM+kk0YyTlWt1nRegVCEL00wFG2zQ7njWBuLLrn08b4M0afXvYHNW YKTGuugO+j5iTrOBJhi3QGZWeRs7toSPNhHoLzA57nO95iMMQ7ZcqEfjbj8B7MTHu0x2 bP4E0W4vhV5BRkOj8twFd/hrJwWr+VaIdbWDrhAHCv6UAAylAIeHtavIudYv2SK/XZyH sPxg== 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; bh=gWI2oNaX+rA4Y4pklYJSrmInyC/lchlIj8va7N38YLI=; b=DmujIxxGRRxqkJkW/bCTJOQ2CQkIR9bVMIP5GmXPzEWPT+JO8GXNh0m40tuIueYKq9 X9YzxMhU3o8HXK6jKM5SkvIUM6laJF5tnpKIAJr29GY8RVuMVOqKWLjUIj/MCiCkJz5o pUEWZ8UfdBXtTzKAMCLGLtZ0p6avHlDdztN22a9iiXabyAlTNyfrwi5u1Ar/MGlqJmXG P/196tutgyGKc/hxZPaoS/vZmS7S5sXYgnjCDrjHQH8FSBr9RCPwCloc8LC1CG4rCLcC AuPKevVzMCRRLl+S+IH2VuyeKb475c4+b8DfQ5tPTtQYKf/6i70JFIkjajgFXssgsgus OyVA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n24si2882692ejg.142.2020.04.27.07.59.54; Mon, 27 Apr 2020 08:00:17 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728091AbgD0Ozx (ORCPT + 99 others); Mon, 27 Apr 2020 10:55:53 -0400 Received: from verein.lst.de ([213.95.11.211]:48764 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbgD0Ozw (ORCPT ); Mon, 27 Apr 2020 10:55:52 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id E836468C7B; Mon, 27 Apr 2020 16:55:48 +0200 (CEST) Date: Mon, 27 Apr 2020 16:55:48 +0200 From: Christoph Hellwig To: Martijn Coenen Cc: axboe@kernel.dk, hch@lst.de, ming.lei@redhat.com, narayan@google.com, zezeozue@google.com, kernel-team@android.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, maco@google.com, bvanassche@acm.org, Chaitanya.Kulkarni@wdc.com, jaegeuk@kernel.org Subject: Re: [PATCH v3 4/9] loop: Refactor loop_set_status() size calculation Message-ID: <20200427145548.GD5490@lst.de> References: <20200427074222.65369-1-maco@android.com> <20200427074222.65369-5-maco@android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200427074222.65369-5-maco@android.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 27, 2020 at 09:42:17AM +0200, Martijn Coenen wrote: > figure_loop_size() calculates the loop size based on the passed in > parameters, but at the same time it updates the offset and sizelimit > parameters in the loop device configuration. That is a somewhat > unexpected side effect of a function with this name, and it is only only > needed by one of the two callers of this function - loop_set_status(). > > Move the lo_offset and lo_sizelimit assignment back into loop_set_status(), > and use the newly factored out functions to validate and apply the newly > calculated size. This allows us to get rid of figure_loop_size in a > follow-up commit. > Looks good, Reviewed-by: Christoph Hellwig