On Tue, 23 Sep 2025 11:20:52 -0500 Eric Blake <[email protected]> wrote:
> On Tue, Sep 23, 2025 at 02:30:01PM +0800, Ray Lee wrote: > > Signed-off-by: Ray Lee <[email protected]> > > --- > > block/mirror.c | 8 ++++---- > > 1 file changed, 4 insertions(+), 4 deletions(-) > > This patch does what it says, but lacks a rationale as to why it is > important. What was confusing about the existing name? Is this > intended to be part of a larger series where some other patch will be > easier to read with the difference in naming? Is it because of > collisions between static functions in two different .o files making > gdb breakpoints harder to understand? Or something else altogether? > > Since the commit message didn't list a reason why this patch would > matter, I'm inclined to treat it as churn for the sake of churn, not > fixing any bugs. > The primary motivation for this change is to improve code clarity and maintainability. The original name `mirror_co_read` suggests that the function is solely responsible for reading data, which is misleading. In reality, the function orchestrates the copying of data from the source to the target during the mirror operation, encompassing both reading from the source and writing to the destination. The name `mirror_co_copy` more accurately reflects this broader responsibility, aligning with the function??s actual behavior and reducing potential confusion for developers reading or maintaining the code. This commit renames the `mirror_co_read` function to `mirror_co_copy` to better reflect its purpose, as it handles copying data rather than just reading. The change updates the function name and all related references, including comments and coroutine creation, to maintain consistency. No functional changes are introduced.
