Re: [PATCH] zerocopy NFS updated

David S. Miller
2002-04-11T11:43:33Z

From: Hirokazu Takahashi <taka@valinux.co.jp>
Date: Thu, 11 Apr 2002 20:38:23 +0900 (JST)

Hmmm... If I'd implement them.....
How about following codes ?

nfsd read()
{
:
page_cache_get(page);
if (page is mapped to anywhere)
page = duplicate_and_rehash(page);
else {
page_lock(page);
page->flags |= COW;
page_unlock(page);
}
sendpage(page);
page_cache_release(page);
}

What if a process mmap's the page between duplicate_and_rehash and the
card actually getting the data?

This is hopeless. The whole COW idea is 1) expensive 2) complex to
implement.

This is why we don't implement sendfile with anything other than a
simple page reference. Otherwise the overhead and complexity is
unacceptable.

No, you must block truncate operations on the file until the client
ACK's the nfsd read request if you wish to use sendfile() with
nfsd.