diff options
author | Hugh Dickins <hugh@veritas.com> | 2007-03-05 03:30:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-05 10:57:51 -0500 |
commit | 759b9775c25f5e69aaea8a75c3914019e2dc5539 (patch) | |
tree | 14382471e5a23741711443b323199776a94a8c2a | |
parent | cc2cccaec88d422e628e6b588078e1dbdc241896 (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>
-rw-r--r-- | fs/libfs.c | 10 | ||||
-rw-r--r-- | mm/shmem.c | 4 |
2 files changed, 8 insertions, 6 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 | ||
193 | static 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 | ||
360 | int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files) | 363 | int 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); |
diff --git a/mm/shmem.c b/mm/shmem.c index fcb07882c8e0..b8c429a2d271 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -175,7 +175,7 @@ static inline void shmem_unacct_blocks(unsigned long flags, long pages) | |||
175 | vm_unacct_memory(pages * VM_ACCT(PAGE_CACHE_SIZE)); | 175 | vm_unacct_memory(pages * VM_ACCT(PAGE_CACHE_SIZE)); |
176 | } | 176 | } |
177 | 177 | ||
178 | static struct super_operations shmem_ops; | 178 | static const struct super_operations shmem_ops; |
179 | static const struct address_space_operations shmem_aops; | 179 | static const struct address_space_operations shmem_aops; |
180 | static const struct file_operations shmem_file_operations; | 180 | static const struct file_operations shmem_file_operations; |
181 | static const struct inode_operations shmem_inode_operations; | 181 | static const struct inode_operations shmem_inode_operations; |
@@ -2383,7 +2383,7 @@ static const struct inode_operations shmem_special_inode_operations = { | |||
2383 | #endif | 2383 | #endif |
2384 | }; | 2384 | }; |
2385 | 2385 | ||
2386 | static struct super_operations shmem_ops = { | 2386 | static const struct super_operations shmem_ops = { |
2387 | .alloc_inode = shmem_alloc_inode, | 2387 | .alloc_inode = shmem_alloc_inode, |
2388 | .destroy_inode = shmem_destroy_inode, | 2388 | .destroy_inode = shmem_destroy_inode, |
2389 | #ifdef CONFIG_TMPFS | 2389 | #ifdef CONFIG_TMPFS |