All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Juan J. Quintela" <quintela@fi.udc.es>
To: trond.myklebust@fys.uio.no
Cc: lkml <linux-kernel@vger.rutgers.edu>,
	linux-mm@kvack.org, Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: PATCH: Rewrite of truncate_inode_pages (WIP)
Date: 31 May 2000 17:03:26 +0200	[thread overview]
Message-ID: <yttem6iahj5.fsf@serpe.mitica> (raw)
In-Reply-To: Trond Myklebust's message of "Wed, 31 May 2000 14:30:38 +0200 (CEST)"

>>>>> "trond" == Trond Myklebust <trond.myklebust@fys.uio.no> writes:

>>>>> " " == Juan J Quintela <quintela@fi.udc.es> writes:
>> OK, the problem here is that __remove_inode_pages needs to be
>> called with page->buffers==NULL.  What do you suggest to obtain
>> that?

>> Ok, tell me *the* correct way of doing that.  We need to make
>> sere that __remove_inode_page is called with page->buffers ==
>> NULL.  It is ok for you:
>> if(page->buffers)
>> BUG();

trond> That's good. It won't affect NFS or smbfs, and it will catch any block 
trond> devices that try to use that function.

Here is the patch, alan, please apply.

Later, Juan.

diff -urN --exclude-from=/home/lfcia/quintela/work/kernel/exclude ac7/mm/filemap.c working/mm/filemap.c
--- ac7/mm/filemap.c	Wed May 31 15:52:30 2000
+++ working/mm/filemap.c	Wed May 31 16:55:59 2000
@@ -119,7 +119,9 @@
  * @inode: the inode which pages we want to invalidate
  *
  * This function only removes the unlocked pages, if you want to
- * remove all the pages of one inode, you must call truncate_inode_pages.
+ * remove all the pages of one inode, you must call
+ * truncate_inode_pages.  This function is not supposed to be called
+ * by block based filesystems.
  */
 void invalidate_inode_pages(struct inode * inode)
 {
@@ -127,7 +129,6 @@
 	struct page * page;
 
 	head = &inode->i_mapping->pages;
-repeat:
 	spin_lock(&pagecache_lock);
 	spin_lock(&pagemap_lru_lock);
 	curr = head->next;
@@ -139,18 +140,10 @@
 		/* We cannot invalidate a locked page */
 		if (TryLockPage(page))
 			continue;
-		if (page->buffers) {
-			page_cache_get(page);
-			spin_unlock(&pagemap_lru_lock);
-			spin_unlock(&pagecache_lock);			
-			block_destroy_buffers(page);
-			remove_inode_page(page);
-			lru_cache_del(page);
-			page_cache_release(page);
-			UnlockPage(page);
-			page_cache_release(page);
-			goto repeat;
-		}
+		/* We _should not be called_ by block based filesystems */
+		if (page->buffers) 
+			BUG();
+
 		__remove_inode_page(page);
 		__lru_cache_del(page);
 		UnlockPage(page);




-- 
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/

      reply	other threads:[~2000-05-31 15:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-30  1:29 PATCH: Rewrite of truncate_inode_pages (WIP) Juan J. Quintela
2000-05-30  1:52 ` Juan J. Quintela
2000-05-31  8:58 ` Trond Myklebust
2000-05-31 12:13   ` Juan J. Quintela
2000-05-31 12:30     ` Trond Myklebust
2000-05-31 15:03       ` Juan J. Quintela [this message]

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=yttem6iahj5.fsf@serpe.mitica \
    --to=quintela@fi.udc.es \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=linux-mm@kvack.org \
    --cc=trond.myklebust@fys.uio.no \
    /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.