linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Phillips <phillips@arcor.de>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Hugh Dickins <hugh@veritas.com>,
	David Howells <dhowells@redhat.com>
Subject: [RFC][PATCH] Rename PageChecked as PageMiscFS
Date: Thu, 11 Aug 2005 08:12:59 +1000	[thread overview]
Message-ID: <200508110812.59986.phillips@arcor.de> (raw)
In-Reply-To: <20050808145430.15394c3c.akpm@osdl.org>

This filesystem-specific flag needs to be prevented from escaping into other
subsystems that might interact, such as VM.  The current usage is mainly
for directories, except for Reiser4, which uses it for journalling, and NFS,
which presses it into service in a network cache coherency role.

Also resolves the collision between two different names for the same flag bit.

Signed-off-by: Daniel Phillips <phillips@istop.com>

diff -up --recursive 2.6.13-rc5-mm1.clean/fs/afs/dir.c 2.6.13-rc5-mm1/fs/afs/dir.c
--- 2.6.13-rc5-mm1.clean/fs/afs/dir.c	2005-06-17 15:48:29.000000000 -0400
+++ 2.6.13-rc5-mm1/fs/afs/dir.c	2005-08-09 18:59:49.000000000 -0400
@@ -155,11 +155,11 @@ static inline void afs_dir_check_page(st
 		}
 	}
 
-	SetPageChecked(page);
+	SetPageMiscFS(page);
 	return;
 
  error:
-	SetPageChecked(page);
+	SetPageMiscFS(page);
 	SetPageError(page);
 
 } /* end afs_dir_check_page() */
@@ -193,7 +193,7 @@ static struct page *afs_dir_get_page(str
 		kmap(page);
 		if (!PageUptodate(page))
 			goto fail;
-		if (!PageChecked(page))
+		if (!PageMiscFS(page))
 			afs_dir_check_page(dir, page);
 		if (PageError(page))
 			goto fail;
diff -up --recursive 2.6.13-rc5-mm1.clean/fs/ext2/dir.c 2.6.13-rc5-mm1/fs/ext2/dir.c
--- 2.6.13-rc5-mm1.clean/fs/ext2/dir.c	2005-06-17 15:48:29.000000000 -0400
+++ 2.6.13-rc5-mm1/fs/ext2/dir.c	2005-08-09 18:59:51.000000000 -0400
@@ -112,7 +112,7 @@ static void ext2_check_page(struct page 
 	if (offs != limit)
 		goto Eend;
 out:
-	SetPageChecked(page);
+	SetPageMiscFS(page);
 	return;
 
 	/* Too bad, we had an error */
@@ -152,7 +152,7 @@ Eend:
 		dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs,
 		(unsigned long) le32_to_cpu(p->inode));
 fail:
-	SetPageChecked(page);
+	SetPageMiscFS(page);
 	SetPageError(page);
 }
 
@@ -166,7 +166,7 @@ static struct page * ext2_get_page(struc
 		kmap(page);
 		if (!PageUptodate(page))
 			goto fail;
-		if (!PageChecked(page))
+		if (!PageMiscFS(page))
 			ext2_check_page(page);
 		if (PageError(page))
 			goto fail;
diff -up --recursive 2.6.13-rc5-mm1.clean/fs/ext3/inode.c 2.6.13-rc5-mm1/fs/ext3/inode.c
--- 2.6.13-rc5-mm1.clean/fs/ext3/inode.c	2005-08-09 18:23:30.000000000 -0400
+++ 2.6.13-rc5-mm1/fs/ext3/inode.c	2005-08-09 18:59:53.000000000 -0400
@@ -1369,12 +1369,12 @@ static int ext3_journalled_writepage(str
 		goto no_write;
 	}
 
-	if (!page_has_buffers(page) || PageChecked(page)) {
+	if (!page_has_buffers(page) || PageMiscFS(page)) {
 		/*
 		 * It's mmapped pagecache.  Add buffers and journal it.  There
 		 * doesn't seem much point in redirtying the page here.
 		 */
-		ClearPageChecked(page);
+		ClearPageMiscFS(page);
 		ret = block_prepare_write(page, 0, PAGE_CACHE_SIZE,
 					ext3_get_block);
 		if (ret != 0)
@@ -1429,7 +1429,7 @@ static int ext3_invalidatepage(struct pa
 	 * If it's a full truncate we just forget about the pending dirtying
 	 */
 	if (offset == 0)
-		ClearPageChecked(page);
+		ClearPageMiscFS(page);
 
 	return journal_invalidatepage(journal, page, offset);
 }
@@ -1438,7 +1438,7 @@ static int ext3_releasepage(struct page 
 {
 	journal_t *journal = EXT3_JOURNAL(page->mapping->host);
 
-	WARN_ON(PageChecked(page));
+	WARN_ON(PageMiscFS(page));
 	if (!page_has_buffers(page))
 		return 0;
 	return journal_try_to_free_buffers(journal, page, wait);
@@ -1535,7 +1535,7 @@ out:
  */
 static int ext3_journalled_set_page_dirty(struct page *page)
 {
-	SetPageChecked(page);
+	SetPageMiscFS(page);
 	return __set_page_dirty_nobuffers(page);
 }
 
diff -up --recursive 2.6.13-rc5-mm1.clean/fs/freevxfs/vxfs_subr.c 2.6.13-rc5-mm1/fs/freevxfs/vxfs_subr.c
--- 2.6.13-rc5-mm1.clean/fs/freevxfs/vxfs_subr.c	2005-08-09 18:23:11.000000000 -0400
+++ 2.6.13-rc5-mm1/fs/freevxfs/vxfs_subr.c	2005-08-09 18:59:54.000000000 -0400
@@ -79,7 +79,7 @@ vxfs_get_page(struct address_space *mapp
 		kmap(pp);
 		if (!PageUptodate(pp))
 			goto fail;
-		/** if (!PageChecked(pp)) **/
+		/** if (!PageMiscFS(pp)) **/
 			/** vxfs_check_page(pp); **/
 		if (PageError(pp))
 			goto fail;
diff -up --recursive 2.6.13-rc5-mm1.clean/fs/reiser4/page_cache.c 2.6.13-rc5-mm1/fs/reiser4/page_cache.c
--- 2.6.13-rc5-mm1.clean/fs/reiser4/page_cache.c	2005-08-09 18:23:30.000000000 -0400
+++ 2.6.13-rc5-mm1/fs/reiser4/page_cache.c	2005-08-09 18:59:58.000000000 -0400
@@ -754,7 +754,7 @@ print_page(const char *prefix, struct pa
 	       page_flag_name(page, PG_lru),
 	       page_flag_name(page, PG_slab),
 
-	       page_flag_name(page, PG_checked),
+	       page_flag_name(page, PG_miscfs),
 	       page_flag_name(page, PG_reserved),
 	       page_flag_name(page, PG_private), page_flag_name(page, PG_writeback), page_flag_name(page, PG_nosave));
 	if (jprivate(page) != NULL) {
diff -up --recursive 2.6.13-rc5-mm1.clean/fs/reiserfs/inode.c 2.6.13-rc5-mm1/fs/reiserfs/inode.c
--- 2.6.13-rc5-mm1.clean/fs/reiserfs/inode.c	2005-08-09 18:23:31.000000000 -0400
+++ 2.6.13-rc5-mm1/fs/reiserfs/inode.c	2005-08-09 19:00:02.000000000 -0400
@@ -2347,7 +2347,7 @@ static int reiserfs_write_full_page(stru
 	struct buffer_head *head, *bh;
 	int partial = 0;
 	int nr = 0;
-	int checked = PageChecked(page);
+	int checked = PageMiscFS(page);
 	struct reiserfs_transaction_handle th;
 	struct super_block *s = inode->i_sb;
 	int bh_per_page = PAGE_CACHE_SIZE / s->s_blocksize;
@@ -2409,7 +2409,7 @@ static int reiserfs_write_full_page(stru
 	 * blocks we're going to log
 	 */
 	if (checked) {
-		ClearPageChecked(page);
+		ClearPageMiscFS(page);
 		reiserfs_write_lock(s);
 		error = journal_begin(&th, s, bh_per_page + 1);
 		if (error) {
@@ -2790,7 +2790,7 @@ static int reiserfs_invalidatepage(struc
 	BUG_ON(!PageLocked(page));
 
 	if (offset == 0)
-		ClearPageChecked(page);
+		ClearPageMiscFS(page);
 
 	if (!page_has_buffers(page))
 		goto out;
@@ -2829,7 +2829,7 @@ static int reiserfs_set_page_dirty(struc
 {
 	struct inode *inode = page->mapping->host;
 	if (reiserfs_file_data_log(inode)) {
-		SetPageChecked(page);
+		SetPageMiscFS(page);
 		return __set_page_dirty_nobuffers(page);
 	}
 	return __set_page_dirty_buffers(page);
@@ -2852,7 +2852,7 @@ static int reiserfs_releasepage(struct p
 	struct buffer_head *bh;
 	int ret = 1;
 
-	WARN_ON(PageChecked(page));
+	WARN_ON(PageMiscFS(page));
 	spin_lock(&j->j_dirty_buffers_lock);
 	head = page_buffers(page);
 	bh = head;
diff -up --recursive 2.6.13-rc5-mm1.clean/include/linux/page-flags.h 2.6.13-rc5-mm1/include/linux/page-flags.h
--- 2.6.13-rc5-mm1.clean/include/linux/page-flags.h	2005-08-09 18:23:31.000000000 -0400
+++ 2.6.13-rc5-mm1/include/linux/page-flags.h	2005-08-10 17:41:32.000000000 -0400
@@ -61,8 +61,7 @@
 #define PG_active		 6
 #define PG_slab			 7	/* slab debug (Suparna wants this) */
 
-#define PG_checked		 8	/* kill me in 2.5.<early>. */
-#define PG_fs_misc		 8
+#define PG_fs_misc		 8	/* don't let me spread */
 #define PG_arch_1		 9
 #define PG_reserved		10
 #define PG_private		11	/* Has something at ->private */
@@ -227,9 +226,11 @@ extern void __mod_page_state(unsigned lo
 #define PageHighMem(page)	0 /* needed to optimize away at compile time */
 #endif
 
-#define PageChecked(page)	test_bit(PG_checked, &(page)->flags)
-#define SetPageChecked(page)	set_bit(PG_checked, &(page)->flags)
-#define ClearPageChecked(page)	clear_bit(PG_checked, &(page)->flags)
+#define PageMiscFS(page)	test_bit(PG_fs_misc, &(page)->flags)
+#define SetPageMiscFS(page)	set_bit(PG_fs_misc, &(page)->flags)
+#define ClearPageMiscFS(page)	clear_bit(PG_fs_misc, &(page)->flags)
+#define TestSetPageMiscFS(page)		test_and_set_bit(PG_fs_misc, &(page)->flags)
+#define TestClearPageMiscFS(page)	test_and_clear_bit(PG_fs_misc, &(page)->flags)
 
 #define PageReserved(page)	test_bit(PG_reserved, &(page)->flags)
 #define SetPageReserved(page)	set_bit(PG_reserved, &(page)->flags)
@@ -313,7 +314,7 @@ extern void __mod_page_state(unsigned lo
 #define SetPageUncached(page)	set_bit(PG_uncached, &(page)->flags)
 #define ClearPageUncached(page)	clear_bit(PG_uncached, &(page)->flags)
 
-struct page;	/* forward declaration */
+struct page; /* What am I doing in this file? */
 
 int test_clear_page_dirty(struct page *page);
 int test_clear_page_writeback(struct page *page);
@@ -329,13 +330,4 @@ static inline void set_page_writeback(st
 	test_set_page_writeback(page);
 }
 
-/*
- * Filesystem-specific page bit testing
- */
-#define PageFsMisc(page)		test_bit(PG_fs_misc, &(page)->flags)
-#define SetPageFsMisc(page)		set_bit(PG_fs_misc, &(page)->flags)
-#define TestSetPageFsMisc(page)		test_and_set_bit(PG_fs_misc, &(page)->flags)
-#define ClearPageFsMisc(page)		clear_bit(PG_fs_misc, &(page)->flags)
-#define TestClearPageFsMisc(page)	test_and_clear_bit(PG_fs_misc, &(page)->flags)
-
 #endif	/* PAGE_FLAGS_H */
diff -up --recursive 2.6.13-rc5-mm1.clean/include/linux/pagemap.h 2.6.13-rc5-mm1/include/linux/pagemap.h
--- 2.6.13-rc5-mm1.clean/include/linux/pagemap.h	2005-08-09 18:23:31.000000000 -0400
+++ 2.6.13-rc5-mm1/include/linux/pagemap.h	2005-08-10 17:18:18.000000000 -0400
@@ -204,7 +204,7 @@ extern void end_page_writeback(struct pa
  */
 static inline void wait_on_page_fs_misc(struct page *page)
 {
-	if (PageFsMisc(page))
+	if (PageMiscFS(page))
 		wait_on_page_bit(page, PG_fs_misc);
 }
 
diff -up --recursive 2.6.13-rc5-mm1.clean/mm/filemap.c 2.6.13-rc5-mm1/mm/filemap.c
--- 2.6.13-rc5-mm1.clean/mm/filemap.c	2005-08-09 18:23:31.000000000 -0400
+++ 2.6.13-rc5-mm1/mm/filemap.c	2005-08-10 17:15:45.000000000 -0400
@@ -509,7 +509,7 @@ EXPORT_SYMBOL(__lock_page);
 void fastcall end_page_fs_misc(struct page *page)
 {
 	smp_mb__before_clear_bit();
-	if (!TestClearPageFsMisc(page))
+	if (!TestClearPageMiscFS(page))
 		BUG();
 	smp_mb__after_clear_bit();
 	__wake_up_bit(page_waitqueue(page), &page->flags, PG_fs_misc);
diff -up --recursive 2.6.13-rc5-mm1.clean/mm/page_alloc.c 2.6.13-rc5-mm1/mm/page_alloc.c
--- 2.6.13-rc5-mm1.clean/mm/page_alloc.c	2005-08-09 18:23:31.000000000 -0400
+++ 2.6.13-rc5-mm1/mm/page_alloc.c	2005-08-10 17:19:30.000000000 -0400
@@ -458,7 +458,7 @@ static void prep_new_page(struct page *p
 
 	page->flags &= ~(1 << PG_uptodate | 1 << PG_error |
 			1 << PG_referenced | 1 << PG_arch_1 |
-			1 << PG_checked | 1 << PG_mappedtodisk);
+			1 << PG_fs_misc | 1 << PG_mappedtodisk);
 	page->private = 0;
 	set_page_refs(page, order);
 	kernel_map_pages(page, 1 << order, 1);

  parent reply	other threads:[~2005-08-10 22:12 UTC|newest]

Thread overview: 92+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-07  3:28 [RFC][patch 0/2] mm: remove PageReserved Nick Piggin
2005-08-07  3:29 ` [patch 1/2] mm: remap ZERO_PAGE mappings Nick Piggin
2005-08-07  3:30   ` [patch 2/2] mm: core remove PageReserved Nick Piggin
2005-08-08 21:09 ` [RFC][patch 0/2] mm: " Daniel Phillips
2005-08-08 21:24   ` Daniel Phillips
2005-08-08 21:54     ` Andrew Morton
2005-08-09 23:23       ` [RFC][PATCH] Rename PageChecked as PageMiscFS Daniel Phillips
2005-08-10  7:48         ` Hugh Dickins
2005-08-10  8:06           ` Daniel Phillips
2005-08-10 22:12       ` Daniel Phillips [this message]
2005-08-10 22:23         ` Daniel Phillips
2005-08-10 22:34           ` Trond Myklebust
2005-08-10 22:57             ` Daniel Phillips
2005-08-10 23:23               ` Trond Myklebust
2005-08-11  9:42               ` David Howells
2005-08-10 23:42           ` Adrian Bunk
2005-08-11  9:46           ` David Howells
2005-08-12  2:34             ` Daniel Phillips
2005-08-12 12:32             ` David Howells
2005-08-11  9:31         ` David Howells
2005-08-11  9:26       ` David Howells
2005-08-12  3:29         ` Daniel Phillips
2005-08-12 12:41         ` David Howells
2005-08-12 13:28           ` Hugh Dickins
2005-08-16 13:59           ` Pavel Machek
2005-08-18 14:33           ` David Howells
2005-08-18 22:27             ` Pavel Machek
2005-08-19 10:04             ` David Howells
2005-08-19 16:31               ` Daniel Phillips
2005-08-20 10:45               ` David Howells
2005-08-20 20:21                 ` Daniel Phillips
2005-08-10 13:13     ` [RFC][patch 0/2] mm: remove PageReserved David Howells
2005-08-10 13:34       ` Daniel Phillips
2005-08-10 14:27       ` David Howells
2005-08-10 23:19         ` Daniel Phillips
2005-08-11 10:49         ` David Howells
2005-08-12 19:34           ` Daniel Phillips
2005-08-15 13:15           ` David Howells
2005-08-16  1:53             ` Daniel Phillips
2005-08-16 10:28             ` David Howells
2005-08-09  0:15   ` Nick Piggin
2005-08-09  8:51     ` Benjamin Herrenschmidt
2005-08-09  9:49       ` Nick Piggin
2005-08-09 19:19         ` Daniel Phillips
2005-08-09 19:22         ` Daniel Phillips
2005-08-10 21:50           ` Pavel Machek
2005-08-10 21:56             ` Martin J. Bligh
2005-08-11 10:36               ` Rafael J. Wysocki
2005-08-12 19:56                 ` Daniel Phillips
2005-08-12 22:20                   ` Rafael J. Wysocki
2005-08-12 23:04                     ` Daniel Phillips
2005-08-13  7:06                       ` Rafael J. Wysocki
2005-08-11 10:26             ` Rafael J. Wysocki
2005-08-09 11:25       ` Hugh Dickins
2005-08-09 14:31         ` Benjamin Herrenschmidt
2005-08-09 14:50           ` Hugh Dickins
2005-08-09 14:49             ` Benjamin Herrenschmidt
2005-08-09 15:36               ` Hugh Dickins
2005-08-09 21:27                 ` Daniel Phillips
2005-08-09 19:14     ` Daniel Phillips
2005-08-09 20:17       ` Hugh Dickins
2005-08-09 20:52         ` Daniel Phillips
2005-08-09  4:39   ` Nigel Cunningham
2005-08-09  4:59     ` Nick Piggin
2005-08-09  5:11       ` Nigel Cunningham
2005-08-09  5:20         ` Nick Piggin
2005-08-09  5:30           ` Nigel Cunningham
2005-08-09  7:08       ` Russell King
2005-08-09  8:38         ` Arjan van de Ven
2005-08-09  9:31           ` Nick Piggin
2005-08-09  9:49             ` Arjan van de Ven
2005-08-09  9:57               ` Nick Piggin
2005-08-09 10:24             ` Rafael J. Wysocki
2005-08-09  8:53         ` Benjamin Herrenschmidt
2005-08-09  9:15         ` Hugh Dickins
2005-08-09 10:27           ` Nick Piggin
2005-08-09 11:15             ` Hugh Dickins
2005-08-09 13:15               ` Nick Piggin
2005-08-09 13:26                 ` Arjan van de Ven
2005-08-09 14:28               ` Benjamin Herrenschmidt
2005-08-09 14:47                 ` Hugh Dickins
2005-08-09 19:49           ` Roman Zippel
2005-08-09  9:29         ` Nick Piggin
2005-08-09 19:40           ` Russell King
2005-08-09 14:38         ` Martin J. Bligh
2005-08-09 19:41           ` Russell King
2005-08-09 20:51             ` Linus Torvalds
2005-08-09 21:16             ` Martin J. Bligh
2005-08-09 21:51               ` Martin J. Bligh
2005-08-10  9:27             ` Benjamin Herrenschmidt
2005-08-11  9:09               ` Nick Piggin
2005-08-09 22:14 ` Daniel Phillips

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=200508110812.59986.phillips@arcor.de \
    --to=phillips@arcor.de \
    --cc=akpm@osdl.org \
    --cc=dhowells@redhat.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).