All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>,
	NFS list <linux-nfs@vger.kernel.org>,
	open-osd <osd-dev@open-osd.org>
Subject: Re: [PATCH 7/8] SQUASHME: Move a check from nfs_pageio_do_add_request to nfs_generic_pg_test
Date: Sun, 29 May 2011 20:30:04 +0300	[thread overview]
Message-ID: <4DE2829C.3080208@panasas.com> (raw)
In-Reply-To: <1306665090-1155-1-git-send-email-bharrosh@panasas.com>

On 2011-05-29 13:31, Boaz Harrosh wrote:
> desc->pg_bsize is negotiated with the MDS. But if we are doing
> pnfs-IO it is not relevent.
> 
> While at it cleanup nfs_pageio_do_add_request() in light of the
> less things it needs to do.
> 
> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
> ---
>  fs/nfs/pagelist.c |   27 +++++++++++++--------------
>  1 files changed, 13 insertions(+), 14 deletions(-)
> 
> diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
> index 36bb67f..624ec2c 100644
> --- a/fs/nfs/pagelist.c
> +++ b/fs/nfs/pagelist.c
> @@ -206,6 +206,16 @@ nfs_wait_on_request(struct nfs_page *req)
>  
>  static bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc, struct nfs_page *prev, struct nfs_page *req)
>  {
> +	/*
> +	* FIXME: ideally we should be able to coalesce all requests
> +	* that are not block boundary aligned, but currently this
> +	* is problematic for the case of bsize < PAGE_CACHE_SIZE,
> +	* since nfs_flush_multi and nfs_pagein_multi assume you
> +	* can have only one struct nfs_page.
> +	*/

nit: comment indent (will fix)

> +	if (desc->pg_bsize < PAGE_SIZE)
> +		return 0;
> +
>  	return desc->pg_count + req->wb_bytes <= desc->pg_bsize;
>  }
>  
> @@ -279,29 +289,18 @@ static bool nfs_can_coalesce_requests(struct nfs_page *prev,
>  static int nfs_pageio_do_add_request(struct nfs_pageio_descriptor *desc,
>  				     struct nfs_page *req)
>  {
> -	size_t newlen = req->wb_bytes;
> -
>  	if (desc->pg_count != 0) {
>  		struct nfs_page *prev;
>  
> -		/*
> -		 * FIXME: ideally we should be able to coalesce all requests
> -		 * that are not block boundary aligned, but currently this
> -		 * is problematic for the case of bsize < PAGE_CACHE_SIZE,
> -		 * since nfs_flush_multi and nfs_pagein_multi assume you
> -		 * can have only one struct nfs_page.
> -		 */
> -		if (desc->pg_bsize < PAGE_SIZE)
> -			return 0;
> -		newlen += desc->pg_count;
>  		prev = nfs_list_entry(desc->pg_list.prev);
>  		if (!nfs_can_coalesce_requests(prev, req, desc))
>  			return 0;
> -	} else
> +	} else {
>  		desc->pg_base = req->wb_pgbase;
> +	}

nit: no need to add the braces here (will remove)

>  	nfs_list_remove_request(req);
>  	nfs_list_add_request(req, &desc->pg_list);
> -	desc->pg_count = newlen;
> +	desc->pg_count += req->wb_bytes;

Thanks!

Benny

>  	return 1;
>  }
>  


  reply	other threads:[~2011-05-29 17:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-29 10:15 [PACHSET 0/8] FIXES for pnfs for 2.6.40 - version 9 Boaz Harrosh
2011-05-29 10:29 ` [PATCH 1/8] SQUASHME: into NFSv4.1: purge deviceid cache - let ver < 4.1 compile Boaz Harrosh
2011-05-29 10:30 ` [PATCH 2/8] SQUASHME V2: objio alloc/free lseg Bugs fixes Boaz Harrosh
2011-05-29 10:30 ` [PATCH 3/8] SQUASHME: objio read/write patch: " Boaz Harrosh
2011-05-29 10:30 ` [PATCH 4/8] NEWVERSION: pnfs-obj: report errors and .encode_layoutreturn Implementation Boaz Harrosh
2011-05-29 10:31 ` [PATCH 5/8] SQUASHME: Fix BUG in: NFSv4.1: unify pnfs_pageio_init functions Boaz Harrosh
2011-05-29 10:31 ` [PATCH 6/8] NFSv4.1: define nfs_generic_pg_test Boaz Harrosh
2011-05-29 10:31 ` [PATCH 7/8] SQUASHME: Move a check from nfs_pageio_do_add_request to nfs_generic_pg_test Boaz Harrosh
2011-05-29 17:30   ` Benny Halevy [this message]
2011-05-29 10:31 ` [PATCH 8/8] SQUASHME: pnfs-obj: objio_pg_test some checkpatch love Boaz Harrosh

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=4DE2829C.3080208@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bharrosh@panasas.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=osd-dev@open-osd.org \
    /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.