Re: [PATCH] shmem and simple const super_operations

Previous thread: Someone please turn on the http protocol on git.kernel.org! by Timur Tabi on Thursday, March 1, 2007 - 12:14 pm. (5 messages)

Next thread: [PATCH] rcutorture: Mark rcu_torture_init as __init by Josh Triplett on Thursday, March 1, 2007 - 12:29 pm. (2 messages)
From: Hugh Dickins
Date: Thursday, March 1, 2007 - 12:22 pm

shmem's super_operations were missed from the recent const-ification;
and simple_fill_super()'s, which can share with get_sb_pseudo()'s.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---

 fs/libfs.c |   10 ++++++----
 mm/shmem.c |    4 ++--
 2 files changed, 8 insertions(+), 6 deletions(-)

--- 2.6.21-rc2/fs/libfs.c	2007-02-28 08:30:26.000000000 +0000
+++ linux/fs/libfs.c	2007-02-28 13:12:07.000000000 +0000
@@ -190,6 +190,10 @@ const struct inode_operations simple_dir
 	.lookup		= simple_lookup,
 };
 
+static const struct super_operations simple_super_operations = {
+	.statfs		= simple_statfs,
+};
+
 /*
  * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that
  * will never be mountable)
@@ -199,7 +203,6 @@ int get_sb_pseudo(struct file_system_typ
 	struct vfsmount *mnt)
 {
 	struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
-	static const struct super_operations default_ops = {.statfs = simple_statfs};
 	struct dentry *dentry;
 	struct inode *root;
 	struct qstr d_name = {.name = name, .len = strlen(name)};
@@ -212,7 +215,7 @@ int get_sb_pseudo(struct file_system_typ
 	s->s_blocksize = 1024;
 	s->s_blocksize_bits = 10;
 	s->s_magic = magic;
-	s->s_op = ops ? ops : &default_ops;
+	s->s_op = ops ? ops : &simple_super_operations;
 	s->s_time_gran = 1;
 	root = new_inode(s);
 	if (!root)
@@ -359,7 +362,6 @@ int simple_commit_write(struct file *fil
 
 int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files)
 {
-	static struct super_operations s_ops = {.statfs = simple_statfs};
 	struct inode *inode;
 	struct dentry *root;
 	struct dentry *dentry;
@@ -368,7 +370,7 @@ int simple_fill_super(struct super_block
 	s->s_blocksize = PAGE_CACHE_SIZE;
 	s->s_blocksize_bits = PAGE_CACHE_SHIFT;
 	s->s_magic = magic;
-	s->s_op = &s_ops;
+	s->s_op = &simple_super_operations;
 	s->s_time_gran = 1;
 
 	inode = new_inode(s);
--- 2.6.21-rc2/mm/shmem.c	2007-02-28 08:30:33.000000000 +0000
+++ ...
From: Josef Sipek
Date: Thursday, March 1, 2007 - 2:30 pm

Acked-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>

-- 
Hegh QaQ law'
quvHa'ghach QaQ puS
-

Previous thread: Someone please turn on the http protocol on git.kernel.org! by Timur Tabi on Thursday, March 1, 2007 - 12:14 pm. (5 messages)

Next thread: [PATCH] rcutorture: Mark rcu_torture_init as __init by Josh Triplett on Thursday, March 1, 2007 - 12:29 pm. (2 messages)