[linux-cifs-client] Re: [PATCH COW] sys_copyfile

Jörn Engel joern at wohnheim.fh-wedel.de
Tue Apr 27 19:55:03 GMT 2004


On Tue, 27 April 2004 14:46:19 -0500, Steve French wrote:
> On Tue, 2004-04-27 at 11:42, Jörn Engel wrote:
> 
> > Shouldn't it be rather
> > 
> > 	if (old_nd->dentry->d_inode->i_op->copy)
> > 		return old_nd->dentry->d_inode->i_op->copy(old_nd->dentry,
> > 				mode, new_dentry);
> > 
> > or something similar?  The copy() effectively replaces the complete
> > create/sendfile/possibly-unlink series.
> 
> In some network protocols the client does not know whether the server
> wants to support copy operation or not (perhaps if the files were on
> different server partitions the server might return an error e.g), in
> those cases the filesystem client could return error not supported or
> equivalent and the remainder of your function is executed doing the copy
> the harder way (open/read/close create/write/close) but still faster a
> few percent faster than before your patch.

Makes sense.  Then something like

	if (old_nd->dentry->d_inode->i_op->copy) {
		ret = old_nd->dentry->d_inode->i_op->copy(old_nd->dentry,
				mode, new_dentry);
		if (ret != -ENOSYS)
			return ret;
	}

Also, would it be possible to do essentially the same with sendfile()?
That should bring roughly the same speedup for disk based filesystems,
and would be a bit more general.

Jörn

-- 
Don't patch bad code, rewrite it.
-- Kernigham and Pike, according to Rusty


More information about the linux-cifs-client mailing list