All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joel Becker <Joel.Becker@oracle.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	olaf.kirch@oracle.com, johnpol@2ka.mipt.ru
Subject: Re: [PATCH][RFC] network splice receive v3
Date: Wed, 11 Jul 2007 11:17:58 -0700	[thread overview]
Message-ID: <20070711181758.GX1011@tasint.org> (raw)
In-Reply-To: <20070711091927.GQ4587@kernel.dk>

On Wed, Jul 11, 2007 at 11:19:27AM +0200, Jens Axboe wrote:
> Subject: [PATCH] splice: don't assume regular pages in splice_to_pipe()
> 
> Allow caller to pass in a release function, there might be
> other resources that need releasing as well. Needed for
> network receive.
> 
> diff --git a/fs/splice.c b/fs/splice.c
> index 3160951..4b4b501 100644
> --- a/fs/splice.c
> +++ b/fs/splice.c
> @@ -254,11 +254,16 @@ ssize_t splice_to_pipe(struct pipe_inode_info *pipe,
>  	}
>  
>  	while (page_nr < spd_pages)
> -		page_cache_release(spd->pages[page_nr++]);
> +		spd->spd_release(spd, page_nr++);

	Rather than requiring the caller set this, shouldn't we just
allow it?  Especially given there is only one non-page user?

  	while (page_nr < spd_pages)
 -		page_cache_release(spd->pages[page_nr++]);
 +		if (spd->spd_release)
 +			spd->spd_release(spd, page_nr++);
 +		else
 +			page_cache_release(spd->pages[page_nr++]);

Joel

-- 

"Any man who is under 30, and is not a liberal, has not heart;
 and any man who is over 30, and is not a conservative, has no brains."
         - Sir Winston Churchill 

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

  reply	other threads:[~2007-07-11 18:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-11  9:19 [PATCH][RFC] network splice receive v3 Jens Axboe
2007-07-11 18:17 ` Joel Becker [this message]
2007-07-11 18:26   ` Jens Axboe
2007-07-12 17:02 ` Evgeniy Polyakov
2007-07-13 12:21   ` Jens Axboe
2007-07-19  8:44     ` Evgeniy Polyakov
2007-07-19  9:05 ` YOSHIFUJI Hideaki / 吉藤英明
2007-07-19  9:07   ` Jens Axboe

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=20070711181758.GX1011@tasint.org \
    --to=joel.becker@oracle.com \
    --cc=jens.axboe@oracle.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olaf.kirch@oracle.com \
    /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.