Re: [PATCH] fs/read_write: Enable copy_file_range for block device.

From: Christoph Hellwig
Date: Mon Jul 24 2023 - 12:40:49 EST


> {
> - 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.