"Yan, Zheng" <ukernel@xxxxxxxxx> writes: <snip> >> + put_rd_wr_caps(src_ci, src_got, dst_ci, dst_got); > > If some objects were copied by 'copy_from', we need to mark Fw dirty > and update size (if necessary) before dropping dest inode's Fw cap. > do_splice_direct should be called twice at most. one for partial > object the beginning, one for partial object at the end. I think we > can organize the code like > > - some preliminary check (file layouts are the same, src_off/dest_off > have same align) > - use do_splice_direct to partial object at the beginning (if any) > - "copy_from" loop > - mark Fw dirty > - use do_splice_direct to partial object at the end (if any) Right, I've been postponing this code re-organisation but I guess now it's the time (although I'm currently travelling so it'll take some time before I can come back to it). This reorganisation will also allow me to fix the behaviour where both offsets will never be object aligned during the copy. In that case I think the best thing to do is to return -EOPNOTSUP and let the VFS do the whole thing, otherwise we'll end up calling do_splice_direct for every chunk and never doing an actual object copy. (I'm not sure if that's what you meant above with "src_off/dest_off have same align"). And once anyway: thanks a lot for your review! Cheers, -- Luis