mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Eric Van Hensbergen" <ericvh@gmail.com>
To: "Andrew Morton" <akpm@linux-foundation.org>
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: Sat, 17 Feb 2007 00:03:14 -0600	[thread overview]
Message-ID: <a4e6962a0702162203y7af3d87ake846d7c295c88af6@mail.gmail.com> (raw)
In-Reply-To: <20070216170122.4cdafd78.akpm@linux-foundation.org>

On 2/16/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Fri, 16 Feb 2007 18:46:59 -0600
> Eric Van Hensbergen <ericvh@gmail.com> wrote:
> > +     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);
> > +     }
>
> 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?
>

Just double-checking in an effort to actually get the next patch right
(hopefully) -- seems like there are two cases -- if I can read from
the file, I just call readpage and it'll zero out bits.  If the file
is open write-only, things are a little cloudy -- fs/cifs looks like
they just don't do anything.  In the write-only case, do I need to
zero the unwritten portions of the page, or does this get handled
under the covers?  Looks like NFS just avoids this by only writing the
bits that change, which I suppose has other advantages.  I'll refactor
the writepage code to follow the NFS example versus the CIFS code I
originally based my implementation on.

                      -eric

      reply	other threads:[~2007-02-17  6:03 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
2007-02-17  6:03       ` Eric Van Hensbergen [this message]

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=a4e6962a0702162203y7af3d87ake846d7c295c88af6@mail.gmail.com \
    --to=ericvh@gmail.com \
    --cc=akpm@linux-foundation.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®