Skip to contentSkip to conversation

Cleancache: ext3 hook for cleancache

PATCH Superseded Dan Magenheimer 2 participants 3 messages Aug 30, 2010 – Aug 31, 2010

Subsystems (4)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 5/8 Cleancache: ext3 hook for cleancache

[PATCH V4 5/8] Cleancache: ext3 hook 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. For ext3, all other cleancache hooks are in the VFS layer including the matching cleancache_flush_fs hook which must be called on unmount.

Diffstat:

 super.c                                  |    2 ++
 1 file changed, 2 insertions(+)
fs/ext3/super.c +2 -0
@@ -37,6 +37,7 @@
 #include <linux/quotaops.h>
 #include <linux/seq_file.h>
 #include <linux/log2.h>
+#include <linux/cleancache.h>
 
 #include <asm/uaccess.h>
 
@@ -1349,6 +1350,7 @@ static int ext3_setup_super(struct super
 	} else {
 		ext3_msg(sb, KERN_INFO, "using internal journal");
 	}
+	sb->cleancache_poolid = cleancache_init_fs(PAGE_SIZE);
 	return res;
 }
 
#1 lore raw
Quoted 27 lines · Dan Magenheimer

[PATCH V4 5/8] Cleancache: ext3 hook 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. For ext3, all other cleancache hooks are in the VFS layer including the matching cleancache_flush_fs hook which must be called on unmount.

Diffstat:

 super.c                                  |    2 ++
 1 file changed, 2 insertions(+)
fs/ext3/super.c +1 -0
@@ -37,6 +37,7 @@
 #include <linux/quotaops.h>
 #include <linux/seq_file.h>
 #include <linux/log2.h>
+#include <linux/cleancache.h>
 
 #include <asm/uaccess.h>
 

fs/ext3/super.c static int ext3_setup_super(struct super · line 1353

Quoted 4 lines
fs/ext3/super.c +1 -0
@@ -1349,6 +1350,7 @@ static int ext3_setup_super(struct super
 	} else {
 		ext3_msg(sb, KERN_INFO, "using internal journal");
 	}
+	sb->cleancache_poolid = cleancache_init_fs(PAGE_SIZE);

Do you really need to pass in the page size? What about just "cleancache_init_fs(sb)" rather than exposing the "sb->cleancache_poolid"? In other words, what if you want to do more/other per-filesystem init at some point?

J

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw
Quoted 10 lines

Review static int ext3_setup_super(struct super · line 1353

Quoted 5 lines
(quoted diff) +1 -0
@@ -1349,6 +1350,7 @@ static int ext3_setup_super(struct super
 =09} else {
 =09=09ext3_msg(sb, KERN_INFO, "using internal journal");
 =09}
+=09sb->cleancache_poolid =3D cleancache_init_fs(PAGE_SIZE);

=20
Do you really need to pass in the page size? What about just "cleancache_init_fs(sb)" rather than exposing the "sb->cleancache_poolid"? In other words, what if you want to do more/other per-filesystem init at some point?

IIRC, I think I was trying to stay away from including fs.h in cleancache.h (or one of its predecessors). I agree that that no longer makes sense and it is cleaner as you suggest. Will change.

Thanks,
Dan

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>