Skip to contentSkip to conversation

reiser4: port for linux-4.6

PATCH In review Mathieu Belanger 2 participants 6 messages Mar 31, 2016 – Apr 25, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): S1755885AbcCaQ3L/[email protected]

#1 lore raw

PATCH 1/1 reiser4: port for linux-4.6

* New kernel use tmp_wb instead of wb for that part of generic_writeback_sb_inodes

* Migration doesn't clear page->mem_cgroup of live pages
anymore and so account_page_dirtied do not take a mem_cgroup third argument anymore.

reiser4-for-4.6.0.patch renamed from reiser4-for-4.5.0.patch +7 -8
@@ -220,8 +220,8 @@
  		spin_lock(&inode->i_lock);
  		if (!(inode->i_state & I_DIRTY_ALL))
  			wrote++;
--		requeue_inode(inode, wb, &wbc);
-+		requeue_inode(inode, wb, wbc);
+-		requeue_inode(inode, tmp_wb, &wbc);
++		requeue_inode(inode, tmp_wb, wbc);
  		inode_sync_complete(inode);
  		spin_unlock(&inode->i_lock);
  
@@ -81041,7 +81041,7 @@
 diff -urN linux-4.5.orig/mm/page-writeback.c linux-4.5/mm/page-writeback.c
 --- linux-4.5.orig/mm/page-writeback.c	2016-03-14 05:28:54.000000000 +0100
 +++ linux-4.5/mm/page-writeback.c	2016-03-24 16:58:16.396833377 +0100
-@@ -2526,6 +2526,36 @@
+@@ -2526,6 +2526,35 @@
  EXPORT_SYMBOL(account_page_redirty);
  
  /*
@@ -81055,21 +81055,20 @@
 + */
 +int set_page_dirty_notag(struct page *page)
 +{
-+	struct mem_cgroup *memcg;
 +	struct address_space *mapping = page->mapping;
 +
-+	memcg = mem_cgroup_begin_page_stat(page);
++	lock_page_memcg(page);
 +	if (!TestSetPageDirty(page)) {
 +		unsigned long flags;
 +		WARN_ON_ONCE(!PagePrivate(page) && !PageUptodate(page));
 +		local_irq_save(flags);
-+		account_page_dirtied(page, mapping, memcg);
++		account_page_dirtied(page, mapping);
 +		local_irq_restore(flags);
-+		mem_cgroup_end_page_stat(memcg);
++		unlock_page_memcg(page);
 +		__mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
 +		return 1;
 +	}
-+	mem_cgroup_end_page_stat(memcg);
++	unlock_page_memcg(page);
 +	return 0;
 +}
 +EXPORT_SYMBOL(set_page_dirty_notag);
#2 lore raw

Thanks a lot!

Edward.

Quoted 4 lines · Mathieu Belanger

* New kernel use tmp_wb instead of wb for that part of generic_writeback_sb_inodes

* Migration doesn't clear page->mem_cgroup of live pages
anymore and so account_page_dirtied do not take a mem_cgroup third argument anymore.

#3 lore raw
In reply to Mathieu Belanger

I made the patch to support kernel 4.6-rc3+. They made change that was not in the initial rc.

kernel function rename:
page_cache_release -> put_page
page_cache_get -> get_page
PAGE_CACHE_* -> PAGE_*

The attached patch just contain these page_cache change. I will release a unified patch later today for ppl wanting to test it.

Note : this patch apply directly to the kernel, after you applied the initial reiser4 patch generated by my other patch.

Quoted 4 lines · On Thu, 31 Mar 2016 10:44:45 -0600 Mathieu Belanger <[email protected]> wrote:

* New kernel use tmp_wb instead of wb for that part of generic_writeback_sb_inodes

* Migration doesn't clear page->mem_cgroup of live pages
anymore and so account_page_dirtied do not take a mem_cgroup third argument anymore.

Signature · 1 line
Mathieu Belanger <[email protected]>
fs/reiser4/as_ops.c +1 -1
diff -Naur linux-4.6-rc5/fs/reiser4/as_ops.c final/fs/reiser4/as_ops.c
@@ -94,7 +94,7 @@
 void reiser4_invalidatepage(struct page *page, unsigned int offset, unsigned int length)
 {
 	int ret = 0;
-	int partial_page = (offset || length < PAGE_CACHE_SIZE);
+	int partial_page = (offset || length < PAGE_SIZE);
 	reiser4_context *ctx;
 	struct inode *inode;
 	jnode *node;
fs/reiser4/carry_ops.c +1 -1
diff -Naur linux-4.6-rc5/fs/reiser4/carry_ops.c final/fs/reiser4/carry_ops.c
@@ -1994,7 +1994,7 @@
 /* return number of pages required to store given number of bytes */
 static int bytes_to_pages(int bytes)
 {
-	return (bytes + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+	return (bytes + PAGE_SIZE - 1) >> PAGE_SHIFT;
 }
 
 /* how many pages are required to allocate znodes during item insertion. */
fs/reiser4/entd.c +1 -1
diff -Naur linux-4.6-rc5/fs/reiser4/entd.c final/fs/reiser4/entd.c
@@ -233,7 +233,7 @@
 
 	rq->wbc->range_start = page_offset(rq->page);
 	rq->wbc->range_end = rq->wbc->range_start +
-		(ENTD_CAPTURE_APAGE_BURST << PAGE_CACHE_SHIFT);
+		(ENTD_CAPTURE_APAGE_BURST << PAGE_SHIFT);
 
 
 	rq->mapping->a_ops->writepages(rq->mapping, rq->wbc);
fs/reiser4/flush_queue.c +1 -1
diff -Naur linux-4.6-rc5/fs/reiser4/flush_queue.c final/fs/reiser4/flush_queue.c
@@ -429,7 +429,7 @@
 		}
 
 		end_page_writeback(pg);
-		page_cache_release(pg);
+		put_page(pg);
 	}
 
 	if (fq) {
fs/reiser4/init_super.c +1 -1
diff -Naur linux-4.6-rc5/fs/reiser4/init_super.c final/fs/reiser4/init_super.c
@@ -615,7 +615,7 @@
 		/* reiser4 master super block contains filesystem blocksize */
 		blocksize = le16_to_cpu(get_unaligned(&master_sb->blocksize));
 
-		if (blocksize != PAGE_CACHE_SIZE) {
+		if (blocksize != PAGE_SIZE) {
 			/*
 			 * currenly reiser4's blocksize must be equal to
 			 * pagesize
fs/reiser4/jnode.c +12 -12
diff -Naur linux-4.6-rc5/fs/reiser4/jnode.c final/fs/reiser4/jnode.c
@@ -674,7 +674,7 @@
 	assert("nikita-2396", PageLocked(pg));
 	assert_spin_locked(&(node->guard));
 
-	page_cache_get(pg);
+	get_page(pg);
 	set_page_private(pg, (unsigned long)node);
 	node->pg = pg;
 	SetPagePrivate(pg);
@@ -695,7 +695,7 @@
 	set_page_private(page, 0ul);
 	ClearPagePrivate(page);
 	node->pg = NULL;
-	page_cache_release(page);
+	put_page(page);
 }
 
 #if 0
@@ -741,7 +741,7 @@
 		if (page == NULL)
 			break;
 
-		/* no need to page_cache_get( page ) here, because page cannot
+		/* no need to get_page( page ) here, because page cannot
 		   be evicted from memory without detaching it from jnode and
 		   this requires spin lock on jnode that we already hold.
 		 */
@@ -751,7 +751,7 @@
 		}
 
 		/* Page is locked by someone else. */
-		page_cache_get(page);
+		get_page(page);
 		spin_unlock_jnode(node);
 		wait_on_page_locked(page);
 		/* it is possible that page was detached from jnode and
@@ -759,7 +759,7 @@
 		   waiting on locked bit. This will be rechecked on the next
 		   loop iteration.
 		 */
-		page_cache_release(page);
+		put_page(page);
 
 		/* try again */
 	}
@@ -807,7 +807,7 @@
 			spin_unlock_jnode(node);
 			return page;
 		}
-		page_cache_get(page);
+		get_page(page);
 		spin_unlock_jnode(node);
 		lock_page(page);
 		assert("nikita-3134", page->mapping == jnode_get_mapping(node));
@@ -818,7 +818,7 @@
 		jnode_attach_page(node, page);
 	spin_unlock_jnode(node);
 
-	page_cache_release(page);
+	put_page(page);
 	assert("zam-894", jnode_page(node) == page);
 	return page;
 }
@@ -1038,10 +1038,10 @@
 	spin_lock_jnode(node);
 	page = jnode_page(node);
 	if (page != NULL) {
-		page_cache_get(page);
+		get_page(page);
 		spin_unlock_jnode(node);
 		wait_on_page_writeback(page);
-		page_cache_release(page);
+		put_page(page);
 	} else
 		spin_unlock_jnode(node);
 }
@@ -1255,7 +1255,7 @@
 	assert("nikita-3093", key != NULL);
 	assert("nikita-3094", jnode_is_unformatted(node));
 
-	off = ((loff_t) index_jnode(node)) << PAGE_CACHE_SHIFT;
+	off = ((loff_t) index_jnode(node)) << PAGE_SHIFT;
 	inode = mapping_jnode(node)->host;
 
 	if (node->parent_item_id != 0)
@@ -1753,14 +1753,14 @@
 void pin_jnode_data(jnode * node)
 {
 	assert("zam-671", jnode_page(node) != NULL);
-	page_cache_get(jnode_page(node));
+	get_page(jnode_page(node));
 }
 
 /* make jnode data free-able again */
 void unpin_jnode_data(jnode * node)
 {
 	assert("zam-672", jnode_page(node) != NULL);
-	page_cache_release(jnode_page(node));
+	put_page(jnode_page(node));
 }
 
 struct address_space *jnode_get_mapping(const jnode * node)
fs/reiser4/page_cache.c +3 -3
diff -Naur linux-4.6-rc5/fs/reiser4/page_cache.c final/fs/reiser4/page_cache.c
@@ -430,7 +430,7 @@
 		super = page->mapping->host->i_sb;
 		assert("nikita-2029", super != NULL);
 		blksz = super->s_blocksize;
-		assert("nikita-2028", blksz == (int)PAGE_CACHE_SIZE);
+		assert("nikita-2028", blksz == (int)PAGE_SIZE);
 
 		spin_lock_jnode(node);
 		blocknr = *jnode_get_io_block(node);
@@ -672,8 +672,8 @@
 
 	if (count == 0)
 		return;
-	from_bytes = ((loff_t) from) << PAGE_CACHE_SHIFT;
-	count_bytes = ((loff_t) count) << PAGE_CACHE_SHIFT;
+	from_bytes = ((loff_t) from) << PAGE_SHIFT;
+	count_bytes = ((loff_t) count) << PAGE_SHIFT;
 
 	unmap_mapping_range(mapping, from_bytes, count_bytes, even_cows);
 	truncate_inode_pages_range(mapping, from_bytes,
fs/reiser4/plugin/cluster.h +7 -7
diff -Naur linux-4.6-rc5/fs/reiser4/plugin/cluster.h final/fs/reiser4/plugin/cluster.h
@@ -18,7 +18,7 @@
 
 static inline unsigned cluster_nrpages_shift(struct inode *inode)
 {
-	return inode_cluster_shift(inode) - PAGE_CACHE_SHIFT;
+	return inode_cluster_shift(inode) - PAGE_SHIFT;
 }
 
 /* cluster size in page units */
@@ -51,12 +51,12 @@
 
 static inline pgoff_t off_to_pg(loff_t off)
 {
-	return (off >> PAGE_CACHE_SHIFT);
+	return (off >> PAGE_SHIFT);
 }
 
 static inline loff_t pg_to_off(pgoff_t idx)
 {
-	return ((loff_t) (idx) << PAGE_CACHE_SHIFT);
+	return ((loff_t) (idx) << PAGE_SHIFT);
 }
 
 static inline cloff_t off_to_clust(loff_t off, struct inode *inode)
@@ -81,7 +81,7 @@
 
 static inline unsigned off_to_pgoff(loff_t off)
 {
-	return off & (PAGE_CACHE_SIZE - 1);
+	return off & (PAGE_SIZE - 1);
 }
 
 static inline unsigned off_to_cloff(loff_t off, struct inode *inode)
@@ -129,7 +129,7 @@
 /* size in pages */
 static inline pgoff_t size_in_pages(loff_t size)
 {
-	return size_in_blocks(size, PAGE_CACHE_SHIFT);
+	return size_in_blocks(size, PAGE_SHIFT);
 }
 
 /* size in logical clusters */
@@ -173,7 +173,7 @@
 /* the same as above, but block size is page size */
 static inline unsigned __mbp(loff_t size, pgoff_t pos)
 {
-	return __mbb(size, pos, PAGE_CACHE_SHIFT);
+	return __mbb(size, pos, PAGE_SHIFT);
 }
 
 /* number of file's bytes in the nominated logical cluster */
@@ -196,7 +196,7 @@
 static inline pgoff_t win_count_to_nrpages(struct reiser4_slide * win)
 {
 	return ((win->off + win->count +
-		 (1UL << PAGE_CACHE_SHIFT) - 1) >> PAGE_CACHE_SHIFT) -
+		 (1UL << PAGE_SHIFT) - 1) >> PAGE_SHIFT) -
 		off_to_pg(win->off);
 }
 
fs/reiser4/plugin/disk_format/disk_format40.h +4 -4
diff -Naur linux-4.6-rc5/fs/reiser4/plugin/disk_format/disk_format40.h final/fs/reiser4/plugin/disk_format/disk_format40.h
@@ -14,7 +14,7 @@
 
 /* magic for default reiser4 layout */
 #define FORMAT40_MAGIC "ReIsEr40FoRmAt"
-#define FORMAT40_OFFSET (REISER4_MASTER_OFFSET + PAGE_CACHE_SIZE)
+#define FORMAT40_OFFSET (REISER4_MASTER_OFFSET + PAGE_SIZE)
 
 #include "../../dformat.h"
 
@@ -73,13 +73,13 @@
 
 /* Defines for journal header and footer respectively. */
 #define FORMAT40_JOURNAL_HEADER_BLOCKNR \
-	((REISER4_MASTER_OFFSET / PAGE_CACHE_SIZE) + 3)
+	((REISER4_MASTER_OFFSET / PAGE_SIZE) + 3)
 
 #define FORMAT40_JOURNAL_FOOTER_BLOCKNR \
-	((REISER4_MASTER_OFFSET / PAGE_CACHE_SIZE) + 4)
+	((REISER4_MASTER_OFFSET / PAGE_SIZE) + 4)
 
 #define FORMAT40_STATUS_BLOCKNR \
-	((REISER4_MASTER_OFFSET / PAGE_CACHE_SIZE) + 5)
+	((REISER4_MASTER_OFFSET / PAGE_SIZE) + 5)
 
 /* Diskmap declarations */
 #define FORMAT40_PLUGIN_DISKMAP_ID ((REISER4_FORMAT_PLUGIN_TYPE<<16) | (FORMAT40_ID))
fs/reiser4/plugin/file/cryptcompress.c +11 -11
diff -Naur linux-4.6-rc5/fs/reiser4/plugin/file/cryptcompress.c final/fs/reiser4/plugin/file/cryptcompress.c
@@ -452,7 +452,7 @@
 {
 	assert("edward-696", object != NULL);
 
-	if (unlikely(inode_cluster_size(object) < PAGE_CACHE_SIZE)) {
+	if (unlikely(inode_cluster_size(object) < PAGE_SIZE)) {
 		warning("edward-1320", "Can not support '%s' "
 			"logical clusters (less then page size)",
 			inode_cluster_plugin(object)->h.label);
@@ -1951,7 +1951,7 @@
 
 		unlock_page(clust->pages[i]);
 
-		if (in_page < PAGE_CACHE_SIZE)
+		if (in_page < PAGE_SIZE)
 			/* end of the file */
 			break;
 	}
@@ -2113,7 +2113,7 @@
 
 		assert("edward-284", page != NULL);
 
-		to_pg = min((typeof(pg_off))PAGE_CACHE_SIZE - pg_off, cl_count);
+		to_pg = min((typeof(pg_off))PAGE_SIZE - pg_off, cl_count);
 		lock_page(page);
 		zero_user(page, pg_off, to_pg);
 		SetPageUptodate(page);
@@ -2354,7 +2354,7 @@
 			off = off_to_pgoff(win->off+win->count+win->delta);
 			if (off) {
 				lock_page(pg);
-				zero_user_segment(pg, off, PAGE_CACHE_SIZE);
+				zero_user_segment(pg, off, PAGE_SIZE);
 				unlock_page(pg);
 			}
 		}
@@ -2401,7 +2401,7 @@
 
 			offset =
 			    off_to_pgoff(win->off + win->count + win->delta);
-			zero_user_segment(pg, offset, PAGE_CACHE_SIZE);
+			zero_user_segment(pg, offset, PAGE_SIZE);
 			unlock_page(pg);
 			/* still not uptodate */
 			break;
@@ -2752,7 +2752,7 @@
 	assert("edward-154", buf != NULL);
 	assert("edward-161", reiser4_schedulable());
 	assert("edward-748", cryptcompress_inode_ok(inode));
-	assert("edward-159", current_blocksize == PAGE_CACHE_SIZE);
+	assert("edward-159", current_blocksize == PAGE_SIZE);
 	assert("edward-1274", get_current_context()->grabbed_blocks == 0);
 
 	hint = kmalloc(sizeof(*hint), reiser4_ctx_gfp_mask_get());
@@ -2825,7 +2825,7 @@
 		     i++, src += to_page) {
 			to_page = __mbp(win.off + win.count, i) - page_off;
 			assert("edward-1039",
-			       page_off + to_page <= PAGE_CACHE_SIZE);
+			       page_off + to_page <= PAGE_SIZE);
 			assert("edward-287", clust.pages[i] != NULL);
 
 			fault_in_pages_readable(src, to_page);
@@ -3148,7 +3148,7 @@
 	assert("edward-1133", inode->i_size < new_size);
 	assert("edward-1134", reiser4_schedulable());
 	assert("edward-1135", cryptcompress_inode_ok(inode));
-	assert("edward-1136", current_blocksize == PAGE_CACHE_SIZE);
+	assert("edward-1136", current_blocksize == PAGE_SIZE);
 	assert("edward-1333", off_to_cloff(inode->i_size, inode) != 0);
 
 	hint = kmalloc(sizeof(*hint), reiser4_ctx_gfp_mask_get());
@@ -3234,7 +3234,7 @@
 	assert("edward-1140", inode->i_size >= new_size);
 	assert("edward-1141", reiser4_schedulable());
 	assert("edward-1142", cryptcompress_inode_ok(inode));
-	assert("edward-1143", current_blocksize == PAGE_CACHE_SIZE);
+	assert("edward-1143", current_blocksize == PAGE_SIZE);
 
 	old_size = inode->i_size;
 
@@ -3292,7 +3292,7 @@
 
 	nr_zeros = off_to_pgoff(new_size);
 	if (nr_zeros)
-		nr_zeros = PAGE_CACHE_SIZE - nr_zeros;
+		nr_zeros = PAGE_SIZE - nr_zeros;
 
 	set_window(&clust, &win, inode, new_size, new_size + nr_zeros);
 	win.stat = HOLE_WINDOW;
@@ -3372,7 +3372,7 @@
 			break;
 
 		/* found */
-		page_cache_get(pages[i]);
+		get_page(pages[i]);
 		*index = pages[i]->index + 1;
 
 		radix_tree_tag_clear(&mapping->page_tree,
fs/reiser4/plugin/file/cryptcompress.h +3 -3
diff -Naur linux-4.6-rc5/fs/reiser4/plugin/file/cryptcompress.h final/fs/reiser4/plugin/file/cryptcompress.h
@@ -10,9 +10,9 @@
 
 #include <linux/pagemap.h>
 
-#define MIN_CLUSTER_SHIFT PAGE_CACHE_SHIFT
+#define MIN_CLUSTER_SHIFT PAGE_SHIFT
 #define MAX_CLUSTER_SHIFT 16
-#define MAX_CLUSTER_NRPAGES (1U << MAX_CLUSTER_SHIFT >> PAGE_CACHE_SHIFT)
+#define MAX_CLUSTER_NRPAGES (1U << MAX_CLUSTER_SHIFT >> PAGE_SHIFT)
 #define DC_CHECKSUM_SIZE 4
 
 #define MIN_LATTICE_FACTOR 1
@@ -602,7 +602,7 @@
 
 static inline void put_cluster_page(struct page * page)
 {
-	page_cache_release(page);
+	put_page(page);
 }
 
 #endif /* __FS_REISER4_CRYPTCOMPRESS_H__ */
fs/reiser4/plugin/file/file.c +23 -23

164 lines not on this page · raw message

fs/reiser4/plugin/file/file_conversion.c +4 -4
diff -Naur linux-4.6-rc5/fs/reiser4/plugin/file/file_conversion.c final/fs/reiser4/plugin/file/file_conversion.c
@@ -320,7 +320,7 @@
 			BUG_ON(!PageUptodate(clust->pages[i]));
 			data = kmap(clust->pages[i]);
 			memcpy(tfm_stream_data(tc, INPUT_STREAM) + pg_to_off(i),
-			       data, PAGE_CACHE_SIZE);
+			       data, PAGE_SIZE);
 			kunmap(clust->pages[i]);
 			unlock_page(clust->pages[i]);
 		}
@@ -673,7 +673,7 @@
 	reiser4_context *ctx;
 	struct inode * inode = file_inode(file);
 
-	index = pos >> PAGE_CACHE_SHIFT;
+	index = pos >> PAGE_SHIFT;
 	page = grab_cache_page_write_begin(mapping, index,
 					   flags & AOP_FLAG_NOFS);
 	*pagep = page;
@@ -701,7 +701,7 @@
 	reiser4_exit_context(ctx);
  err2:
 	unlock_page(page);
-	page_cache_release(page);
+	put_page(page);
 	return ret;
 }
 
@@ -727,7 +727,7 @@
 	set_page_dirty_notag(page);
 
 	ret = PROT_PASSIVE(int, write_end, (file, page, pos, copied, fsdata));
-	page_cache_release(page);
+	put_page(page);
 
 	/* don't commit transaction under inode semaphore */
 	context_set_commit_async(ctx);
fs/reiser4/plugin/file/tail_conversion.c +21 -21

140 lines not on this page · raw message

fs/reiser4/plugin/item/ctail.c +5 -5
diff -Naur linux-4.6-rc5/fs/reiser4/plugin/item/ctail.c final/fs/reiser4/plugin/item/ctail.c
@@ -662,7 +662,7 @@
 		goto exit;
 	to_page = pbytes(page_index(page), inode);
 	if (to_page == 0) {
-		zero_user(page, 0, PAGE_CACHE_SIZE);
+		zero_user(page, 0, PAGE_SIZE);
 		SetPageUptodate(page);
 		goto exit;
 	}
@@ -679,7 +679,7 @@
 		/* refresh bytes */
 		to_page = pbytes(page_index(page), inode);
 		if (to_page == 0) {
-			zero_user(page, 0, PAGE_CACHE_SIZE);
+			zero_user(page, 0, PAGE_SIZE);
 			SetPageUptodate(page);
 			goto exit;
 		}
@@ -710,7 +710,7 @@
 		 */
 	case FAKE_DISK_CLUSTER:
 		/* fill the page by zeroes */
-		zero_user(page, 0, PAGE_CACHE_SIZE);
+		zero_user(page, 0, PAGE_SIZE);
 		SetPageUptodate(page);
 		break;
 	case PREP_DISK_CLUSTER:
@@ -723,7 +723,7 @@
 
 		data = kmap(page);
 		memcpy(data, tfm_stream_data(tc, OUTPUT_STREAM) + cloff, to_page);
-		memset(data + to_page, 0, (size_t) PAGE_CACHE_SIZE - to_page);
+		memset(data + to_page, 0, (size_t) PAGE_SIZE - to_page);
 		flush_dcache_page(page);
 		kunmap(page);
 		SetPageUptodate(page);
@@ -820,7 +820,7 @@
 		return 0;
 	}
 	if (pbytes(page_index(page), inode) == 0) {
-		zero_user(page, 0, PAGE_CACHE_SIZE);
+		zero_user(page, 0, PAGE_SIZE);
 		SetPageUptodate(page);
 		unlock_page(page);
 		return 0;
fs/reiser4/plugin/item/extent_file_ops.c +24 -24

165 lines not on this page · raw message

fs/reiser4/plugin/item/extent_flush_ops.c +2 -2
diff -Naur linux-4.6-rc5/fs/reiser4/plugin/item/extent_flush_ops.c final/fs/reiser4/plugin/item/extent_flush_ops.c
@@ -70,11 +70,11 @@
 		}
 
 		assert("vs-544",
-		       (get_key_offset(&key) >> PAGE_CACHE_SHIFT) < ~0ul);
+		       (get_key_offset(&key) >> PAGE_SHIFT) < ~0ul);
 		/* index of first or last (depending on @side) page addressed
 		   by the extent */
 		index =
-		    (unsigned long)(get_key_offset(&key) >> PAGE_CACHE_SHIFT);
+		    (unsigned long)(get_key_offset(&key) >> PAGE_SHIFT);
 		if (side == RIGHT_SIDE)
 			index--;
 
fs/reiser4/plugin/item/extent_item_ops.c +23 -23

129 lines not on this page · raw message

fs/reiser4/plugin/item/tail.c +9 -9
diff -Naur linux-4.6-rc5/fs/reiser4/plugin/item/tail.c final/fs/reiser4/plugin/item/tail.c
@@ -325,11 +325,11 @@
 		goto out_tap_done;
 
 	/* lookup until page is filled up. */
-	for (mapped = 0; mapped < PAGE_CACHE_SIZE; ) {
+	for (mapped = 0; mapped < PAGE_SIZE; ) {
 		/* number of bytes to be copied to page */
 		count = item_length_by_coord(&coord) - coord.unit_pos;
-		if (count > PAGE_CACHE_SIZE - mapped)
-			count = PAGE_CACHE_SIZE - mapped;
+		if (count > PAGE_SIZE - mapped)
+			count = PAGE_SIZE - mapped;
 
 		/* attach @page to address space and get data address */
 		pagedata = kmap_atomic(page);
@@ -346,7 +346,7 @@
 		kunmap_atomic(pagedata);
 
 		/* Getting next tail item. */
-		if (mapped < PAGE_CACHE_SIZE) {
+		if (mapped < PAGE_SIZE) {
 			/*
 			 * unlock page in order to avoid keep it locked
 			 * during tree lookup, which takes long term locks
@@ -390,8 +390,8 @@
 	}
 
  done:
-	if (mapped != PAGE_CACHE_SIZE)
-		zero_user_segment(page, mapped, PAGE_CACHE_SIZE);
+	if (mapped != PAGE_SIZE)
+		zero_user_segment(page, mapped, PAGE_SIZE);
 	SetPageUptodate(page);
  out_unlock_page:
 	unlock_page(page);
@@ -605,11 +605,11 @@
 	loff_t faulted;
 	int to_fault;
 
-	if (count > PAGE_PER_FLOW * PAGE_CACHE_SIZE)
-		count = PAGE_PER_FLOW * PAGE_CACHE_SIZE;
+	if (count > PAGE_PER_FLOW * PAGE_SIZE)
+		count = PAGE_PER_FLOW * PAGE_SIZE;
 	faulted = 0;
 	while (count > 0) {
-		to_fault = PAGE_CACHE_SIZE;
+		to_fault = PAGE_SIZE;
 		if (count < to_fault)
 			to_fault = count;
 		fault_in_pages_readable(buf + faulted, to_fault);
fs/reiser4/plugin/space/bitmap.c +1 -1
diff -Naur linux-4.6-rc5/fs/reiser4/plugin/space/bitmap.c final/fs/reiser4/plugin/space/bitmap.c
@@ -659,7 +659,7 @@
  * affected.  */
 
 #define REISER4_FIRST_BITMAP_BLOCK \
-	((REISER4_MASTER_OFFSET / PAGE_CACHE_SIZE) + 2)
+	((REISER4_MASTER_OFFSET / PAGE_SIZE) + 2)
 
 /* Audited by: green(2002.06.12) */
 static void
fs/reiser4/tree.c +5 -5
diff -Naur linux-4.6-rc5/fs/reiser4/tree.c final/fs/reiser4/tree.c
@@ -721,12 +721,12 @@
 		 * that znode is pinned in memory, which we are, because
 		 * forget_znode() is only called from longterm_unlock_znode().
 		 */
-		page_cache_get(page);
+		get_page(page);
 		spin_unlock_znode(node);
 		lock_page(page);
 		reiser4_uncapture_page(page);
 		unlock_page(page);
-		page_cache_release(page);
+		put_page(page);
 	} else {
 		txn_atom *atom;
 
@@ -1390,10 +1390,10 @@
 	if (reiser4_inode_get_flag(inode, REISER4_HAS_MMAP)) {
 		pgoff_t start_pg, end_pg;
 
-		start_pg = start >> PAGE_CACHE_SHIFT;
-		end_pg = (end - 1) >> PAGE_CACHE_SHIFT;
+		start_pg = start >> PAGE_SHIFT;
+		end_pg = (end - 1) >> PAGE_SHIFT;
 
-		if ((start & (PAGE_CACHE_SIZE - 1)) == 0) {
+		if ((start & (PAGE_SIZE - 1)) == 0) {
 			/*
 			 * kill up to the page boundary.
 			 */
fs/reiser4/txnmgr.c +6 -6
diff -Naur linux-4.6-rc5/fs/reiser4/txnmgr.c final/fs/reiser4/txnmgr.c
@@ -858,7 +858,7 @@
 	assert("nikita-3309", atom != NULL);
 
 	captured = (unsigned)atom->capture_count;
-	pinnedpages = (captured >> PAGE_CACHE_SHIFT) * sizeof(znode);
+	pinnedpages = (captured >> PAGE_SHIFT) * sizeof(znode);
 
 	return (pinnedpages > (totalram_pages >> 3)) || (atom->flushed > 100);
 }
@@ -2231,10 +2231,10 @@
 		 * until @node can be removed from flush queue. But
 		 * reiser4_atom_wait_event() cannot be called with page locked,
 		 * because it deadlocks with jnode_extent_write(). Unlock page,
-		 * after making sure (through page_cache_get()) that it cannot
+		 * after making sure (through get_page()) that it cannot
 		 * be released from memory.
 		 */
-		page_cache_get(pg);
+		get_page(pg);
 		unlock_page(pg);
 		reiser4_atom_wait_event(atom);
 		lock_page(pg);
@@ -2243,7 +2243,7 @@
 		 */
 		reiser4_wait_page_writeback(pg);
 		spin_lock_jnode(node);
-		page_cache_release(pg);
+		put_page(pg);
 		atom = jnode_get_atom(node);
 /* VS-FIXME-HANS: improve the commenting in this function */
 		if (atom == NULL) {
@@ -2423,7 +2423,7 @@
 		 * bit. */
 		/* assert("nikita-3292",
 		   !PageWriteback(page) || ZF_ISSET(z, JNODE_WRITEBACK)); */
-		page_cache_get(page);
+		get_page(page);
 
 		/* jnode lock is not needed for the rest of
 		 * znode_set_dirty(). */
@@ -2431,7 +2431,7 @@
 		/* reiser4 file write code calls set_page_dirty for
 		 * unformatted nodes, for formatted nodes we do it here. */
 		set_page_dirty_notag(page);
-		page_cache_release(page);
+		put_page(page);
 		/* bump version counter in znode */
 		z->version = znode_build_version(jnode_get_tree(node));
 	} else {
fs/reiser4/wander.c +2 -2
diff -Naur linux-4.6-rc5/fs/reiser4/wander.c final/fs/reiser4/wander.c
@@ -736,7 +736,7 @@
 			pg = jnode_page(cur);
 			assert("zam-573", pg != NULL);
 
-			page_cache_get(pg);
+			get_page(pg);
 
 			lock_and_wait_page_writeback(pg);
 
@@ -746,7 +746,7 @@
 				 * pages to the bio.
 				 */
 				unlock_page(pg);
-				page_cache_release(pg);
+				put_page(pg);
 				break;
 			}
 
fs/reiser4/znode.h +1 -1
diff -Naur linux-4.6-rc5/fs/reiser4/znode.h final/fs/reiser4/znode.h
@@ -179,7 +179,7 @@
 znode_size(const znode * node UNUSED_ARG /* znode to query */ )
 {
 	assert("nikita-1416", node != NULL);
-	return PAGE_CACHE_SIZE;
+	return PAGE_SIZE;
 }
 
 extern void parent_coord_to_coord(const parent_coord_t * pcoord,
#4 lore raw

Complete patch to apply directly on the kernel is here : https://korinar.com/reiser4/reiser4-for-4.6-rc3.patch.bz2

It contain my initial patch, the Edward barrier patch and my last page_cache renaming patch.

Mathieu

Quoted 22 lines · On Mon, 25 Apr 2016 11:06:20 -0500 Mathieu Belanger <[email protected]> wrote:

I made the patch to support kernel 4.6-rc3+. They made change that was not in the initial rc.

kernel function rename:
page_cache_release -> put_page
page_cache_get -> get_page
PAGE_CACHE_* -> PAGE_*

The attached patch just contain these page_cache change. I will release a unified patch later today for ppl wanting to test it.

Note : this patch apply directly to the kernel, after you applied the initial reiser4 patch generated by my other patch.

Quoted 4 lines · On Thu, 31 Mar 2016 10:44:45 -0600 Mathieu Belanger <[email protected]> wrote:

* New kernel use tmp_wb instead of wb for that part of generic_writeback_sb_inodes

* Migration doesn't clear page->mem_cgroup of live pages
anymore and so account_page_dirtied do not take a mem_cgroup third argument anymore.

Signature · 1 line
Mathieu Belanger <[email protected]>
Signature · 1 line
Mathieu Belanger <[email protected]>
#5 lore raw
In reply to Mathieu Belanger

Thanks Mathieu,

How your sda2 doing?
Has it survived any crashes since then?

Edward.

Quoted 19 lines · Mathieu Belanger

I made the patch to support kernel 4.6-rc3+. They made change that was not in the initial rc.

kernel function rename:
page_cache_release -> put_page
page_cache_get -> get_page
PAGE_CACHE_* -> PAGE_*

The attached patch just contain these page_cache change. I will release a unified patch later today for ppl wanting to test it.

Note : this patch apply directly to the kernel, after you applied the initial reiser4 patch generated by my other patch.

Quoted 4 lines · On Thu, 31 Mar 2016 10:44:45 -0600 Mathieu Belanger <[email protected]> wrote:

* New kernel use tmp_wb instead of wb for that part of generic_writeback_sb_inodes

* Migration doesn't clear page->mem_cgroup of live pages
anymore and so account_page_dirtied do not take a mem_cgroup third argument anymore.

#6 lore raw

Hi Edward,

My sda2 is fine since I did the fsck & RW mount on systemrescuecd. All files came back and since them I did not have any issue (or crash).

Mathieu

Quoted 29 lines · On Mon, 25 Apr 2016 19:14:05 +0200 Edward Shishkin <[email protected]>…

Thanks Mathieu,

How your sda2 doing?
Has it survived any crashes since then?

Edward.

Quoted 19 lines · Mathieu Belanger

I made the patch to support kernel 4.6-rc3+. They made change that was not in the initial rc.

kernel function rename:
page_cache_release -> put_page
page_cache_get -> get_page
PAGE_CACHE_* -> PAGE_*

The attached patch just contain these page_cache change. I will release a unified patch later today for ppl wanting to test it.

Note : this patch apply directly to the kernel, after you applied the initial reiser4 patch generated by my other patch.

Quoted 4 lines · On Thu, 31 Mar 2016 10:44:45 -0600 Mathieu Belanger <[email protected]> wrote:

* New kernel use tmp_wb instead of wb for that part of generic_writeback_sb_inodes

* Migration doesn't clear page->mem_cgroup of live pages
anymore and so account_page_dirtied do not take a mem_cgroup third argument anymore.

Signature · 1 line
Mathieu Belanger <[email protected]>