From: Wu Fengguang <fengguang.wu@intel.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH -next] fs: fix fs/fs-writeback.c build error
Date: Sat, 7 Jan 2012 21:30:09 +0800 [thread overview]
Message-ID: <20120107133008.GA21128@localhost> (raw)
In-Reply-To: <CA+55aFx7vzez6C5M6EmZPDmkHig-mY=p64vZWWmWWe-nmxH4=w@mail.gmail.com>
On Fri, Jan 06, 2012 at 03:01:09PM -0800, Linus Torvalds wrote:
> On Thu, Jan 5, 2012 at 4:18 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> >
> > In linux-next, fs/fs-writeback.c no longer #includes <linux/buffer_head.h>,
> > which #included <linux/pagemap.h>, so add that latter header file to
> > <linux/writeback.h> to fix the build error:
> >
> > fs/fs-writeback.c:510:11: error: 'PAGE_CACHE_SHIFT' undeclared (first use in this function)
>
> I would actually suggest:
>
> - move the whole MIN_WRITEBACK_PAGES #define from the header file to
> fs/writeback.c
Done.
> (why expose such a random #define to outside users that
> have nothing to do with it?)
Yeah, there were some early patches that reference MIN_WRITEBACK_PAGES
from other files, which are dropped later..
> - make sure that fs/fs-writeback.c has that pagemap.h #include.
Done. (otherwise it won't compile)
> There's no reason why <linux/writeback.h> should include filemap.h per
> se, and there is no reason why it should expose some internal chunking
> #define to anybody else.
Good point. I'll queue this patch to writeback-for-next:
Subject: writeback: move MIN_WRITEBACK_PAGES to fs-writeback.c
Date: Sat Jan 07 20:41:55 CST 2012
Fix compile error
fs/fs-writeback.c:515:33: error: ‘PAGE_CACHE_SHIFT’ undeclared (first use in this function)
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
fs/fs-writeback.c | 6 ++++++
include/linux/writeback.h | 5 -----
2 files changed, 6 insertions(+), 5 deletions(-)
--- next.orig/fs/fs-writeback.c 2012-01-07 21:01:34.552000061 +0800
+++ next/fs/fs-writeback.c 2012-01-07 21:22:45.504000051 +0800
@@ -20,6 +20,7 @@
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/mm.h>
+#include <linux/pagemap.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <linux/writeback.h>
@@ -29,6 +30,11 @@
#include "internal.h"
/*
+ * 4MB minimal write chunk size
+ */
+#define MIN_WRITEBACK_PAGES (4096UL >> (PAGE_CACHE_SHIFT - 10))
+
+/*
* Passed into wb_writeback(), essentially a subset of writeback_control
*/
struct wb_writeback_work {
--- next.orig/include/linux/writeback.h 2012-01-07 21:01:34.544000059 +0800
+++ next/include/linux/writeback.h 2012-01-07 21:13:09.008000026 +0800
@@ -25,11 +25,6 @@ DECLARE_PER_CPU(int, dirty_throttle_leak
#define DIRTY_SCOPE 8
#define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2)
-/*
- * 4MB minimal write chunk size
- */
-#define MIN_WRITEBACK_PAGES (4096UL >> (PAGE_CACHE_SHIFT - 10))
-
struct backing_dev_info;
/*
next prev parent reply other threads:[~2012-01-07 13:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-05 8:12 linux-next: Tree for Jan 5 Stephen Rothwell
2012-01-06 0:18 ` [PATCH -next] fs: fix fs/fs-writeback.c build error Randy Dunlap
2012-01-06 23:01 ` Linus Torvalds
2012-01-07 13:30 ` Wu Fengguang [this message]
2012-01-07 18:17 ` Randy Dunlap
2012-01-06 0:48 ` linux-next: Tree for Jan 5 (exofs or nfs ?) Randy Dunlap
[not found] ` <4F0644C1.6000405-/UHa2rfvQTnk1uMJSBkQmQ@public.gmane.org>
2012-01-08 8:36 ` Boaz Harrosh
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=20120107133008.GA21128@localhost \
--to=fengguang.wu@intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=rdunlap@xenotime.net \
--cc=sfr@canb.auug.org.au \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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).