Feature #21944
closed
I think even kernel VFS does not provide hook for this. kernel uses both splice_read and splice_write callbacks to implement this syscall. there is no easy way to combine these two callbacks into one.
Zheng Yan wrote:
I think even kernel VFS does not provide hook for this. kernel uses both splice_read and splice_write callbacks to implement this syscall. there is no easy way to combine these two callbacks into one.
The struct file_operations has a .copy_file_range field which nfs and cifs seem to use to implement this. Or did I misunderstood you?
I see there's no one assigned to this feature, so I'll try to spend some time in the next few weeks to have a look and see if this is doable.
I finally managed to spend some time looking at this, so here's a small update.
I managed to hack libceph to include a ceph_osdc_copy_from function, which I'm able to use to copy an object in a file into an object in a different file. Unfortunately, I'm missing something because when I cat the file I see there's no data there anymore (the file is truncated). If I use 'rados -p cephfs_data_a get <object ID>' I can see that the object has changed and includes the expected contents, but the FS client doesn't see that change (even with an umount/mount).
So... I'm missing something (probably something obvious!). I tried playing with caps, but not luck. Anyway, I'll continue playing a bit more with this.
And another update: I've managed to implement a copy_file_range PoC, where the RADOS 'copy-from' operation is used (or, at least, partially used as we still need some manual copy when the files offsets (or copy len) aren't object aligned).
The code still requires a good clean-up, specially the cephfs side of it (the actually copy-from code lives in the libceph module and should be mostly ready). I expect to send out an RFC soon.
- Subject changed from Implement file_copy_range to kclient: implement file_copy_range
- Status changed from New to In Progress
- Assignee set to Luis Henriques
- Source set to Development
- Component(FS) kceph added
See "[RFC PATCH 0/2] copy_file_range in cephfs kernel client" on ceph-devel.
- Subject changed from kclient: implement file_copy_range to kclient: implement copy_range_range
- Subject changed from kclient: implement copy_range_range to kclient: implement copy_file_range
- Project changed from CephFS to Linux kernel client
- Start date deleted (
10/27/2017)
- Category set to fs/ceph
- Status changed from In Progress to Resolved
Also available in: Atom
PDF