Re: [RFC PATCH v4 3/4] ceph: support copy_file_range file operation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"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



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux