All of lore.kernel.org
 help / color / mirror / Atom feed
From: torvalds@transmeta.com (Linus Torvalds)
To: linux-kernel@vger.kernel.org
Subject: Re: tmpfs + sendfile bug ?
Date: 21 May 2001 15:01:05 -0700	[thread overview]
Message-ID: <9ec371$gqn$1@penguin.transmeta.com> (raw)
In-Reply-To: <XFMail.20010521183553.petchema@concept-micro.com> <m3bsomwsgs.fsf@linux.local>

In article <m3bsomwsgs.fsf@linux.local>, Christoph Rohland  <cr@sap.com> wrote:
>
>tmpfs does not provide the necessary functions for sendfile and lo:
>readpage, prepare_write and commitwrite.
>
>And I do not see a way how to provide readpage in tmpfs :-(

Why not just do it the same way ramfs does?

If you don't have any backing store, you know that the page is empty. If
you _do_ have backing store, a readpage() won't be called. Ergo:

	static int ramfs_readpage(struct file *file, struct page * page)
	{
		if (!Page_Uptodate(page)) {
			memset(kmap(page), 0, PAGE_CACHE_SIZE);
			kunmap(page);
			flush_dcache_page(page);   
			SetPageUptodate(page);
		}
		UnlockPage(page);
		return 0;
	}

while the writepage ones just do a "SetPageDirty(page)" (with
prepare_write() needing to do the same "Page_Uptodate()" checks to see
if we need to clear stuff first).

		Linus

  reply	other threads:[~2001-05-21 22:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-21 16:35 tmpfs + sendfile bug ? Pierre Etchemaite
2001-05-21 16:57 ` Christoph Rohland
2001-05-21 22:01   ` Linus Torvalds [this message]
     [not found]   ` <200105212201.PAA17247@penguin.transmeta.com>
2001-05-22  6:50     ` Christoph Rohland
2001-05-21 18:49 ` David Schwartz
2001-05-21 22:44   ` Pierre Etchemaite

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='9ec371$gqn$1@penguin.transmeta.com' \
    --to=torvalds@transmeta.com \
    --cc=linux-kernel@vger.kernel.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.