From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: chris.mason@oracle.com, viro@zeniv.linux.org.uk,
akpm@linux-foundation.org, adilger@sun.com, tytso@mit.edu,
mfasheh@suse.com, joel.becker@oracle.com, matthew@wil.cx,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org,
ocfs2-devel@oss.oracle.com, linux-mm@kvack.org,
ngupta@vflare.org, jeremy@goop.org, JBeulich@novell.com,
kurt.hackel@oracle.com, npiggin@suse.de,
dave.mccracken@oracle.com, riel@redhat.com, avi@redhat.com,
konrad.wilk@oracle.com, dan.magenheimer@oracle.com
Subject: [PATCH V3 6/8] Cleancache: btrfs hooks for cleancache
Date: Mon, 21 Jun 2010 16:21:10 -0700 [thread overview]
Message-ID: <20100621232110.GA19651@ca-server1.us.oracle.com> (raw)
[PATCH V3 6/8] Cleancache: btrfs hooks for cleancache
Filesystems must explicitly enable cleancache by calling
cleancache_init_fs anytime a instance of the filesystem
is mounted and must save the returned poolid. Btrfs
uses its own readpage which must be hooked, but all other
cleancache hooks are in the VFS layer including
the matching cleancache_flush_fs hook which must be
called on unmount.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat:
extent_io.c | 9 +++++++++
super.c | 2 ++
2 files changed, 11 insertions(+)
--- linux-2.6.35-rc2/fs/btrfs/super.c 2010-06-05 21:43:24.000000000 -0600
+++ linux-2.6.35-rc2-cleancache/fs/btrfs/super.c 2010-06-11 09:01:37.000000000 -0600
@@ -39,6 +39,7 @@
#include <linux/miscdevice.h>
#include <linux/magic.h>
#include <linux/slab.h>
+#include <linux/cleancache.h>
#include "compat.h"
#include "ctree.h"
#include "disk-io.h"
@@ -477,6 +478,7 @@ static int btrfs_fill_super(struct super
sb->s_root = root_dentry;
save_mount_options(sb, data);
+ sb->cleancache_poolid = cleancache_init_fs(PAGE_SIZE);
return 0;
fail_close:
--- linux-2.6.35-rc2/fs/btrfs/extent_io.c 2010-06-05 21:43:24.000000000 -0600
+++ linux-2.6.35-rc2-cleancache/fs/btrfs/extent_io.c 2010-06-11 10:28:51.000000000 -0600
@@ -10,6 +10,7 @@
#include <linux/swap.h>
#include <linux/writeback.h>
#include <linux/pagevec.h>
+#include <linux/cleancache.h>
#include "extent_io.h"
#include "extent_map.h"
#include "compat.h"
@@ -2027,6 +2028,13 @@ static int __extent_read_full_page(struc
set_page_extent_mapped(page);
+ if (!PageUptodate(page)) {
+ if (cleancache_get_page(page) == 0) {
+ BUG_ON(blocksize != PAGE_SIZE);
+ goto out;
+ }
+ }
+
end = page_end;
while (1) {
lock_extent(tree, start, end, GFP_NOFS);
@@ -2151,6 +2159,7 @@ static int __extent_read_full_page(struc
cur = cur + iosize;
page_offset += iosize;
}
+out:
if (!nr) {
if (!PageError(page))
SetPageUptodate(page);
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
reply other threads:[~2010-06-21 23:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20100621232110.GA19651@ca-server1.us.oracle.com \
--to=dan.magenheimer@oracle.com \
--cc=JBeulich@novell.com \
--cc=adilger@sun.com \
--cc=akpm@linux-foundation.org \
--cc=avi@redhat.com \
--cc=chris.mason@oracle.com \
--cc=dave.mccracken@oracle.com \
--cc=jeremy@goop.org \
--cc=joel.becker@oracle.com \
--cc=konrad.wilk@oracle.com \
--cc=kurt.hackel@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew@wil.cx \
--cc=mfasheh@suse.com \
--cc=ngupta@vflare.org \
--cc=npiggin@suse.de \
--cc=ocfs2-devel@oss.oracle.com \
--cc=riel@redhat.com \
--cc=tytso@mit.edu \
--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).