All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Eric Van Hensbergen <ericvh@gmail.com>
Cc: linux-kernel@vger.kernel.org, v9fs-developer@lists.sourceforge.net
Subject: Re: [PATCH] 9p: add write-cache support to loose cache mode (take 4)
Date: Fri, 16 Feb 2007 17:01:22 -0800	[thread overview]
Message-ID: <20070216170122.4cdafd78.akpm@linux-foundation.org> (raw)
In-Reply-To: <11716732192318-git-send-email-ericvh@gmail.com>

On Fri, 16 Feb 2007 18:46:59 -0600
Eric Van Hensbergen <ericvh@gmail.com> wrote:

> Loose cache mode was added primarily to asssist exclusive, read-only
> mounts (like venti) -- however, there is also a case for using loose
> write cacheing in support of read/write exclusive mounts.  This feature
> is linked to the loose cache option and is disabled by default.
> 
> This code adds the necessary code to support writes through the page
> cache.  Write caches are not used for synthetic files or for files opened
> in APPEND mode.
> 

Me again ;)

> +int v9fs_prepare_write(struct file *file, struct page *page,
> +		       unsigned from, unsigned to)
> +{
> +	if(!PageUptodate(page)) {
> +		if (to - from != PAGE_CACHE_SIZE) {
> +			void *kaddr = kmap_atomic(page, KM_USER0);
> +			memset(kaddr, 0, from);
> +			memset(kaddr + to, 0, PAGE_CACHE_SIZE - to);
> +			flush_dcache_page(page);
> +			kunmap_atomic(kaddr, KM_USER0);
> +		}
> +		if ((file->f_flags & O_ACCMODE) != O_WRONLY)
> +			v9fs_vfs_readpage_worker(file, page);
> +	}
> +
> +	return 0;
> +}

Seems strange to memset part of the page and to then go and fill the page
in from backing store.  Perhaps some optimisation is possible here?

And did the error from v9fs_vfs_readpage_worker() just get lost?

> +/**
> + * v9fs_commit_write - prepare for mmap or page-cache I/O
> + *
> + * @file: file being read

"written"

> + * @page: structure to page
> + * @offset: starting offset
> + * @to: ending offset
> + *
> + */
> +
>

  reply	other threads:[~2007-02-17  1:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-15 14:44 [PATCH] 9p: add write-cache support to loose cache mode (take 2) Eric Van Hensbergen
2007-02-15 19:19 ` Josef Sipek
2007-02-16 15:37 ` [PATCH] 9p: add write-cache support to loose cache mode (take 3) Eric Van Hensbergen
2007-02-16 20:12   ` Andrew Morton
2007-02-16 22:28     ` Eric Van Hensbergen
2007-02-17  0:46   ` [PATCH] 9p: add write-cache support to loose cache mode (take 4) Eric Van Hensbergen
2007-02-17  1:01     ` Andrew Morton [this message]
2007-02-17  6:03       ` Eric Van Hensbergen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070216170122.4cdafd78.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ericvh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=v9fs-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.