On 11/15/2011 04:02 PM, Christoph Hellwig wrote: > On Tue, Nov 15, 2011 at 03:47:20PM +0800, Liu Yuan wrote: >> From: Liu Yuan <tailai.ly at taobao.com> >> >> store_create_and_write_obj_cow() and store_create_and_write_obj() share >> a lot of logic, it is neat to unify them. > > Err, I just split them exactly because they don't share any logic. The > only think shared are the calls to ob_open and store_write_obj_fd, but > any actual logic is different. > Umm, Shame on me, I didn't look at the git commit history beforehand. But for cow object, just have two extra steps: read_copy() and write_copy(). This two steps are internal object operation for cow. If store_create_and_write_obj() semantically means to operate on the higher level objects, that is requested object, whether it be cow object or non-cow object, I think it is better to handle different type object internally, not explicitly. >> - use fallocate() for cow object creation too. > > Why? We write the whole object in one go, so this shouldn't make > a difference. Umm, seems useless, I just squeeze it to the code path. any noticeable performance penalty? Thanks, Yuan |