From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Righi Subject: Re: [PATCH v5 3/3] fadvise: implement POSIX_FADV_NOREUSE Date: Thu, 16 Feb 2012 01:56:08 +0100 Message-ID: <20120216005608.GC21685@thinkpad> References: <1329006098-5454-1-git-send-email-andrea@betterlinux.com> <1329006098-5454-4-git-send-email-andrea@betterlinux.com> <20120215233537.GA20724@dev3310.snc6.facebook.com> <20120215234724.GA21685@thinkpad> <4F3C467B.1@fb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Andrew Morton , Minchan Kim , Peter Zijlstra , Johannes Weiner , KAMEZAWA Hiroyuki , KOSAKI Motohiro , Rik van Riel , Hugh Dickins , Alexander Viro , Shaohua Li , =?iso-8859-1?Q?P=E1draig?= Brady , John Stultz , Jerry James , Julius Plenz , linux-mm , linux-fsdevel@vger.kernel.org, LKML To: Arun Sharma Return-path: Content-Disposition: inline In-Reply-To: <4F3C467B.1@fb.com> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org On Wed, Feb 15, 2012 at 03:57:47PM -0800, Arun Sharma wrote: >=20 >=20 > On 2/15/12 3:47 PM, Andrea Righi wrote: > >>index 74b6a97..b4e45e6 100644 > >>--- a/include/linux/fs.h > >>+++ b/include/linux/fs.h > >>@@ -9,7 +9,6 @@ > >> #include > >> #include > >> #include > >>-#include > >> #include > >> > >> /* > >>@@ -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 tha= n > >this? > > >=20 > Forward declaration works if the type was struct rb_root *. But the > type in your patch was a struct and the compiler can't figure out > its size. >=20 > include/linux/fs.h:659:17: error: field =E2=80=98nocache_tree=E2=80=99 = has incomplete type >=20 > Did you mean forward declaring struct rb_node instead of rb_root? >=20 > If we go down this path, a few more places need fixups (I ignored > the compiler warnings about casting void * to struct rb_root *). >=20 > -Arun Oh sorry, you're right! nocache_tree is not a pointer inside address_space, so the compiler must know the size. mmh... move the definition of the rb_root struct in linux/types.h? or simply use a rb_root pointer. The (void *) looks a bit scary and too bug prone. -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: email@kvack.org