linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Ahltorp <map@stacken.kth.se>
To: linux-mm@kvack.org
Subject: MM question
Date: 21 Feb 1999 20:53:37 +0100	[thread overview]
Message-ID: <ixdpv73a5z2.fsf@turbot.pdc.kth.se> (raw)

I'm working on a Linux port of Arla, a free AFS (a distributed file
system) client. Arla caches whole files, which means that the read and
write file system calls are tunneled through to the cache file system
(usually ext2).

I implement the inode operation readpage for reads and the file
operation write for writes. readpage gets tunneled by creating a new
struct file and filling in the cache inode. write gets tunneled in
much the same way. Though, I have been seeing problems when a file
gets written to. The written data weren't always seen when doing
reads. Someone then suggested that the folloing code be added to
write:

	page = get_free_page(GFP_KERNEL);
	if (!page)
	    invalidate_inode_pages(inode);
	else {
	    int pos = file->f_pos;
	    int cnt = count;
	    int blk;
	    char *data=(char *)page;

	    while (cnt > 0) {
		blk = cnt;
		if (blk > PAGE_SIZE)
		    blk = PAGE_SIZE;
		copy_from_user(data, buf, blk);
		update_vm_cache(inode, pos, data, blk);
		pos += blk;
		cnt -= blk;
	    }
	    free_page(page);
	}

I inserted this piece of code, and things worked quite well. After a
while, I was seeing new problems. Writes were not propagating properly
to the cache file.

Does anyone have any suggestions on how this really should be done?

/Magnus
map@stacken.kth.se
--
To unsubscribe, send a message with 'unsubscribe linux-mm my@address'
in the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/

             reply	other threads:[~1999-02-21 19:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-21 19:53 Magnus Ahltorp [this message]
1999-02-21 21:34 ` Benjamin C.R. LaHaise
1999-02-22 21:13   ` Magnus Ahltorp
1999-02-24 17:36     ` Benjamin C.R. LaHaise
1999-02-24 17:55       ` Magnus Ahltorp
1999-03-15 18:05     ` Stephen C. Tweedie
  -- strict thread matches above, loose matches on Subject: below --
1999-02-16  2:30 Jason Titus
1999-02-18 15:06 ` Stephen C. Tweedie

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=ixdpv73a5z2.fsf@turbot.pdc.kth.se \
    --to=map@stacken.kth.se \
    --cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox