aboutsummaryrefslogtreecommitdiffstats
path: root/fs/libfs.c
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2007-03-05 03:30:28 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-05 10:57:51 -0500
commit759b9775c25f5e69aaea8a75c3914019e2dc5539 (patch)
tree14382471e5a23741711443b323199776a94a8c2a /fs/libfs.c
parentcc2cccaec88d422e628e6b588078e1dbdc241896 (diff)
[PATCH] shmem and simple const super_operations
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> Acked-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/libfs.c')
-rw-r--r--fs/libfs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/libfs.c b/fs/libfs.c
index cf79196535ec..d93842d3c0a0 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -190,6 +190,10 @@ const struct inode_operations simple_dir_inode_operations = {
190 .lookup = simple_lookup, 190 .lookup = simple_lookup,
191}; 191};
192 192
193static const struct super_operations simple_super_operations = {
194 .statfs = simple_statfs,
195};
196
193/* 197/*
194 * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that 198 * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that
195 * will never be mountable) 199 * will never be mountable)
@@ -199,7 +203,6 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
199 struct vfsmount *mnt) 203 struct vfsmount *mnt)
200{ 204{
201 struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL); 205 struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL);
202 static const struct super_operations default_ops = {.statfs = simple_statfs};
203 struct dentry *dentry; 206 struct dentry *dentry;
204 struct inode *root; 207 struct inode *root;
205 struct qstr d_name = {.name = name, .len = strlen(name)}; 208 struct qstr d_name = {.name = name, .len = strlen(name)};
@@ -212,7 +215,7 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
212 s->s_blocksize = 1024; 215 s->s_blocksize = 1024;
213 s->s_blocksize_bits = 10; 216 s->s_blocksize_bits = 10;
214 s->s_magic = magic; 217 s->s_magic = magic;
215 s->s_op = ops ? ops : &default_ops; 218 s->s_op = ops ? ops : &simple_super_operations;
216 s->s_time_gran = 1; 219 s->s_time_gran = 1;
217 root = new_inode(s); 220 root = new_inode(s);
218 if (!root) 221 if (!root)
@@ -359,7 +362,6 @@ int simple_commit_write(struct file *file, struct page *page,
359 362
360int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files) 363int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files)
361{ 364{
362 static struct super_operations s_ops = {.statfs = simple_statfs};
363 struct inode *inode; 365 struct inode *inode;
364 struct dentry *root; 366 struct dentry *root;
365 struct dentry *dentry; 367 struct dentry *dentry;
@@ -368,7 +370,7 @@ int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files
368 s->s_blocksize = PAGE_CACHE_SIZE; 370 s->s_blocksize = PAGE_CACHE_SIZE;
369 s->s_blocksize_bits = PAGE_CACHE_SHIFT; 371 s->s_blocksize_bits = PAGE_CACHE_SHIFT;
370 s->s_magic = magic; 372 s->s_magic = magic;
371 s->s_op = &s_ops; 373 s->s_op = &simple_super_operations;
372 s->s_time_gran = 1; 374 s->s_time_gran = 1;
373 375
374 inode = new_inode(s); 376 inode = new_inode(s);