Excerpts from Nirbheek Chauhan's message of 2010-12-06 07:41:16 -0500:
It would work yes. The operation has three cases:
1) file size doesn't change
2) extend the file with new bytes in the middle
3) make the file smaller removing bytes in the middle
#1 is the easiest case, you can just use the clone range ioctl directly
For #2 and #3, all of the file pointers past the bytes you want to add
or remove need to be updated with a new file offset. I'd say for an
initial implementation to use the IOC_CLONE_RANGE code, and after
everything is working we can look at optimizing it with a shift ioctl if
it makes sense.
Of the use cases you list, video editors seems the most useful.
Databases already have things pretty much under control, and delta
patching wants to go to a new file anyway. Video editing software has
long been looking for ways to do this.
-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html