From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6AF8BC0015E for ; Mon, 24 Jul 2023 16:40:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231587AbjGXQkr (ORCPT ); Mon, 24 Jul 2023 12:40:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231575AbjGXQkj (ORCPT ); Mon, 24 Jul 2023 12:40:39 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3AF81981; Mon, 24 Jul 2023 09:40:20 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 3B5B967373; Mon, 24 Jul 2023 18:40:18 +0200 (CEST) Date: Mon, 24 Jul 2023 18:40:17 +0200 From: Christoph Hellwig To: Nitesh Shetty Cc: Alexander Viro , Christian Brauner , hch@lst.de, gost.dev@samsung.com, Anuj Gupta , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs/read_write: Enable copy_file_range for block device. Message-ID: <20230724164017.GC26430@lst.de> References: <20230724060336.8939-1-nj.shetty@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230724060336.8939-1-nj.shetty@samsung.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org > { > - struct inode *inode_in = file_inode(file_in); > - struct inode *inode_out = file_inode(file_out); > + struct inode *inode_in = file_in->f_mapping->host; > + struct inode *inode_out = file_out->f_mapping->host; This doesn't directly have anything to do with block devices, as regular files can also have a f_mapping that's different. None of the file systems actually supporting copy offload right now do, but changing the dereference here is a correctness thing totally independent of block device support.