Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp1258124rdg; Fri, 11 Aug 2023 15:34:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFNg7Wr+DRFYdD33L1uUbms4hC0ySZSkw3/LpOTpYBBRNcIX1Uy4xHepdjimoLdji4TcUsU X-Received: by 2002:a05:6402:1b06:b0:522:ab77:36b7 with SMTP id by6-20020a0564021b0600b00522ab7736b7mr2730562edb.4.1691793282062; Fri, 11 Aug 2023 15:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691793282; cv=none; d=google.com; s=arc-20160816; b=O5q6117PvG23v3CdCABTM5wDwXv5pza+ICJ6cmrcreZqp6MVQlsbPz61mKpK+YqYHg vz0qDqfWp7P2mZh/9zLLTyKK/6EdcT2O5dRRX8eotZ1ZgfYT3nwhPksjygB3MhnFTwiG 9pJ0w3s9zBEDpzSHj2GflcO+M+gHPXxP+VAJQwZwEaXDT5N3KnVubUoAcQhvfL/F+rq+ wSzzk+t2tq0nni75PCAScl1uJYGVXUqHst3OjR4zHXGfcz5JcwOfDMQzW2dRC/+xnHd8 HwVTQ04fyMvmDHLpd61MLDd+eJrCqlRUNV+5Us3UYaCIseSoCzCp1rjMFQQRkxULr4TA EkaQ== 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:content-language:subject:user-agent:mime-version :date:message-id; bh=hCulArU7T/2N0cjtt9v/Sb6kpK5zL9r3ISOsLR/eGqQ=; fh=cAbOUiFLjTeW77TQOgawX0tk2ZYaCn9Nl4YOSZpwi/c=; b=UR+B9i/K9PdwbACK1cAAvTvi7yI6hsYDvVjjVAgAFd82rcUSzKxCNoVRf+I2eBkU8n tkzJhTjLkeH7qBCoz/LrxpXk4wb40Yt7J6KfmEgehALd/RruHdX90iKFQFX9bVoJRbNX pS55/MitRcoeEOGznreIcqoQUFsVxVurkChpYwndJCcPZgdHxmEriEQdH7tRKWfqVCi/ inTJLJYpWDuLxV/oKDbpPScQnTzF1t8aPtRGR5enMuU9v7fNxY04tdQIjPjxg9daFR8f xdfd8QPC8SutIk8v5em5iUARhLVBxAQUFFBvl29v9YJi2kti6Y2fVoxcMhVIIkTYw7yO bOYQ== ARC-Authentication-Results: i=1; mx.google.com; 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=acm.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c9-20020aa7c749000000b00523cc71f6b3si1650578eds.317.2023.08.11.15.34.18; Fri, 11 Aug 2023 15:34:42 -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; 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=acm.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236947AbjHKWGN (ORCPT + 99 others); Fri, 11 Aug 2023 18:06:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231659AbjHKWGL (ORCPT ); Fri, 11 Aug 2023 18:06:11 -0400 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4B572D57; Fri, 11 Aug 2023 15:06:11 -0700 (PDT) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1bc7b25c699so17952905ad.1; Fri, 11 Aug 2023 15:06:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691791571; x=1692396371; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hCulArU7T/2N0cjtt9v/Sb6kpK5zL9r3ISOsLR/eGqQ=; b=J/C1ZReKG1KJpEsoHjyOdEU0WWkxb8/jDnHYSmqBLqtBaIpfXuwmMyzm/Jf7to5SNt CGXU+uHXe7bdMz/N7lCbQ7sJryMvcWkgYcsao1pSD0i/ufFfe8tSTHAu2xVk2g8UapHR tKFH/omV5AMTsBkpopJ7DRThdkPGZkz7257eTBP0OSSV6tna8F+9+kK+22VF3NV/ThIz 2cNflgc9PVkOgi2r+pqZYEwx8shcTxtebWvp64/Fbdb+VfFoGBl+Z+MSzDL6rRASSHF4 NBLpR7HqfDNf13KJltHo+4jdyQEk/kVnJLxk9shqvrtgNZpBhquc/7l1LQU/2JLWu6cv vxzw== X-Gm-Message-State: AOJu0Yyb+GNJ9osNBQuFhLNfBg6m9FI5Fuw4ueY89oNlfh9D5jk3gVFT xoZZl08VlmvH+olOK7upnvE= X-Received: by 2002:a17:903:244d:b0:1b8:5ab2:49a4 with SMTP id l13-20020a170903244d00b001b85ab249a4mr3374277pls.53.1691791571131; Fri, 11 Aug 2023 15:06:11 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:cdd8:4c3:2f3c:adea? ([2620:15c:211:201:cdd8:4c3:2f3c:adea]) by smtp.gmail.com with ESMTPSA id c11-20020a170903234b00b001a183ade911sm4424160plh.56.2023.08.11.15.06.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Aug 2023 15:06:10 -0700 (PDT) Message-ID: <2e263977-0ee7-ae78-5a8a-2a67df43df76@acm.org> Date: Fri, 11 Aug 2023 15:06:08 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [dm-devel] [PATCH v14 03/11] block: add copy offload support Content-Language: en-US To: Nitesh Shetty , Jens Axboe , Jonathan Corbet , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Keith Busch , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , Alexander Viro , Christian Brauner Cc: martin.petersen@oracle.com, linux-doc@vger.kernel.org, gost.dev@samsung.com, Anuj Gupta , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, mcgrof@kernel.org, dlemoal@kernel.org, linux-fsdevel@vger.kernel.org References: <20230811105300.15889-1-nj.shetty@samsung.com> <20230811105300.15889-4-nj.shetty@samsung.com> From: Bart Van Assche In-Reply-To: <20230811105300.15889-4-nj.shetty@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 On 8/11/23 03:52, Nitesh Shetty wrote: > + if (rem != chunk) > + atomic_inc(&cio->refcount); This code will be easier to read if the above if-test is left out and if the following code is added below the for-loop: if (atomic_dec_and_test(&cio->refcount)) blkdev_copy_endio(cio); Thanks, Bart.