Thread (26 messages) flat view 26 messages, 7 authors, 2014-01-02

Re: [PATCH v5 3/3] fadvise: implement POSIX_FADV_NOREUSE

From: Andrea Righi <hidden>
Date: 2012-02-15 23:47:24
Also in: linux-fsdevel, lkml

On Wed, Feb 15, 2012 at 03:35:37PM -0800, Arun Sharma wrote:
quoted hunk ↗ jump to hunk
On Sun, Feb 12, 2012 at 01:21:38AM +0100, Andrea Righi wrote:
quoted
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 386da09..624a73e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,6 +9,7 @@
 #include <linux/limits.h>
 #include <linux/ioctl.h>
 #include <linux/blk_types.h>
+#include <linux/kinterval.h>
 #include <linux/types.h>
fs.h is an exported header file, whereas kinterval.h is not. So this
fails scripts/header_check.pl.

I used the workaround below.

 -Arun
diff --git a/fs/inode.c b/fs/inode.c
index d27dbee..1335a5f 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -26,6 +26,7 @@
 #include <linux/ima.h>
 #include <linux/cred.h>
 #include <linux/buffer_head.h> /* for inode_has_buffers */
+#include <linux/kinterval.h>
 #include "internal.h"
 
 /*
@@ -279,7 +280,7 @@ void address_space_init_once(struct address_space *mapping)
 	spin_lock_init(&mapping->private_lock);
 	INIT_RAW_PRIO_TREE_ROOT(&mapping->i_mmap);
 	INIT_LIST_HEAD(&mapping->i_mmap_nonlinear);
-	INIT_KINTERVAL_TREE_ROOT(&mapping->nocache_tree);
+	INIT_KINTERVAL_TREE_ROOT((struct rb_root *) &mapping->nocache_tree);
 	rwlock_init(&mapping->nocache_lock);
 }
 EXPORT_SYMBOL(address_space_init_once);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 74b6a97..b4e45e6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -9,7 +9,6 @@
 #include <linux/limits.h>
 #include <linux/ioctl.h>
 #include <linux/blk_types.h>
-#include <linux/kinterval.h>
 #include <linux/types.h>
 
 /*
@@ -656,7 +655,7 @@ struct address_space {
 	spinlock_t		private_lock;	/* for use by the address_space */
 	struct list_head	private_list;	/* ditto */
 	struct address_space	*assoc_mapping;	/* ditto */
-	struct rb_root		nocache_tree;	/* noreuse cache range tree */
+	void			*nocache_tree;	/* noreuse cache range tree */
 	rwlock_t		nocache_lock;	/* protect the nocache_tree */
 } __attribute__((aligned(sizeof(long))));
 	/*
mmh.. a forward declaration of rb_root in fs.h shouldn't be better than
this?

Thanks,
-Andrea

--
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-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help