public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	NFS maillist <nfs@lists.sourceforge.net>
Subject: Re: [PATCH] Convert NFS client to use ->readpages()
Date: Wed, 06 Nov 2002 01:34:50 -0800	[thread overview]
Message-ID: <3DC8E23A.2578323F@digeo.com> (raw)
In-Reply-To: shssmyfe8nt.fsf@charged.uio.no

Trond Myklebust wrote:
> 
> +int
> +nfs_readpages(struct file *filp, struct address_space *mapping,
> +               struct list_head *pages, unsigned nr_pages)
> +{
> +       LIST_HEAD(head);
> +       struct nfs_readdesc desc = {
> +               .filp           = filp,
> +               .head           = &head,
> +       };
> +       struct nfs_server *server = NFS_SERVER(mapping->host);
> +       int is_sync = server->rsize < PAGE_CACHE_SIZE;
> +       int ret;
> +
> +       ret = read_cache_pages(mapping, pages,
> +                              is_sync ? readpage_sync_filler :
> +                                        readpage_async_filler,
> +                              &desc);
> +       if (!list_empty(pages)) {
> +               struct page *page = list_entry(pages->prev, struct page, list);
> +               list_del(&page->list);
> +               page_cache_release(page);
> +       }

What are the above few lines doing?  Looks odd.

Or should it be

	while (!list_empty(...))

?

> +       if (!list_empty(&head)) {
> +               int err = nfs_pagein_list(&head, server->rpages);
> +               if (!ret)
> +                       ret = err;
> +       }
> +       return ret;
> +}
> +

  reply	other threads:[~2002-11-06  9:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-06  2:25 [PATCH] Convert NFS client to use ->readpages() Trond Myklebust
2002-11-06  9:34 ` Andrew Morton [this message]
2002-11-06 17:42   ` Trond Myklebust

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=3DC8E23A.2578323F@digeo.com \
    --to=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    --cc=trond.myklebust@fys.uio.no \
    /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