netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: 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 20:26:59 +0200	[thread overview]
Message-ID: <20070711182659.GD4587@kernel.dk> (raw)
In-Reply-To: <20070711181758.GX1011@tasint.org>

On Wed, Jul 11 2007, Joel Becker wrote:
> 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++]);

Certainly possible, I think it's cleaner with it always being set
though. If it grows other out-of-splice.c users, then your change may be
a good idea though.

-- 
Jens Axboe


  reply	other threads:[~2007-07-11 18:26 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
2007-07-11 18:26   ` Jens Axboe [this message]
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=20070711182659.GD4587@kernel.dk \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).