diff options
Diffstat (limited to 'fs/coda')
-rw-r--r-- | fs/coda/cnode.c | 2 | ||||
-rw-r--r-- | fs/coda/dir.c | 2 | ||||
-rw-r--r-- | fs/coda/inode.c | 4 | ||||
-rw-r--r-- | fs/coda/pioctl.c | 2 | ||||
-rw-r--r-- | fs/coda/sysctl.c | 76 |
5 files changed, 44 insertions, 42 deletions
diff --git a/fs/coda/cnode.c b/fs/coda/cnode.c index 4c9fecbfa91f..28c872747f81 100644 --- a/fs/coda/cnode.c +++ b/fs/coda/cnode.c | |||
@@ -16,7 +16,7 @@ static inline int coda_fideq(struct CodaFid *fid1, struct CodaFid *fid2) | |||
16 | return memcmp(fid1, fid2, sizeof(*fid1)) == 0; | 16 | return memcmp(fid1, fid2, sizeof(*fid1)) == 0; |
17 | } | 17 | } |
18 | 18 | ||
19 | static struct inode_operations coda_symlink_inode_operations = { | 19 | static const struct inode_operations coda_symlink_inode_operations = { |
20 | .readlink = generic_readlink, | 20 | .readlink = generic_readlink, |
21 | .follow_link = page_follow_link_light, | 21 | .follow_link = page_follow_link_light, |
22 | .put_link = page_put_link, | 22 | .put_link = page_put_link, |
diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 0c6f7f3b3dd7..9ddf5ed62162 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c | |||
@@ -66,7 +66,7 @@ static struct dentry_operations coda_dentry_operations = | |||
66 | .d_delete = coda_dentry_delete, | 66 | .d_delete = coda_dentry_delete, |
67 | }; | 67 | }; |
68 | 68 | ||
69 | struct inode_operations coda_dir_inode_operations = | 69 | const struct inode_operations coda_dir_inode_operations = |
70 | { | 70 | { |
71 | .create = coda_create, | 71 | .create = coda_create, |
72 | .lookup = coda_lookup, | 72 | .lookup = coda_lookup, |
diff --git a/fs/coda/inode.c b/fs/coda/inode.c index 01395defed85..614175a3b02e 100644 --- a/fs/coda/inode.c +++ b/fs/coda/inode.c | |||
@@ -90,7 +90,7 @@ static int coda_remount(struct super_block *sb, int *flags, char *data) | |||
90 | } | 90 | } |
91 | 91 | ||
92 | /* exported operations */ | 92 | /* exported operations */ |
93 | static struct super_operations coda_super_operations = | 93 | static const struct super_operations coda_super_operations = |
94 | { | 94 | { |
95 | .alloc_inode = coda_alloc_inode, | 95 | .alloc_inode = coda_alloc_inode, |
96 | .destroy_inode = coda_destroy_inode, | 96 | .destroy_inode = coda_destroy_inode, |
@@ -271,7 +271,7 @@ int coda_setattr(struct dentry *de, struct iattr *iattr) | |||
271 | return error; | 271 | return error; |
272 | } | 272 | } |
273 | 273 | ||
274 | struct inode_operations coda_file_inode_operations = { | 274 | const struct inode_operations coda_file_inode_operations = { |
275 | .permission = coda_permission, | 275 | .permission = coda_permission, |
276 | .getattr = coda_getattr, | 276 | .getattr = coda_getattr, |
277 | .setattr = coda_setattr, | 277 | .setattr = coda_setattr, |
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c index 214822be87bd..2bf3026adc80 100644 --- a/fs/coda/pioctl.c +++ b/fs/coda/pioctl.c | |||
@@ -30,7 +30,7 @@ static int coda_pioctl(struct inode * inode, struct file * filp, | |||
30 | unsigned int cmd, unsigned long user_data); | 30 | unsigned int cmd, unsigned long user_data); |
31 | 31 | ||
32 | /* exported from this file */ | 32 | /* exported from this file */ |
33 | struct inode_operations coda_ioctl_inode_operations = | 33 | const struct inode_operations coda_ioctl_inode_operations = |
34 | { | 34 | { |
35 | .permission = coda_ioctl_permission, | 35 | .permission = coda_ioctl_permission, |
36 | .setattr = coda_setattr, | 36 | .setattr = coda_setattr, |
diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c index 1c82e9a7d7c8..db3b1a9c9a5b 100644 --- a/fs/coda/sysctl.c +++ b/fs/coda/sysctl.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
16 | #include <linux/sysctl.h> | 16 | #include <linux/sysctl.h> |
17 | #include <linux/proc_fs.h> | 17 | #include <linux/proc_fs.h> |
18 | #include <linux/seq_file.h> | ||
18 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
19 | #include <linux/stat.h> | 20 | #include <linux/stat.h> |
20 | #include <linux/ctype.h> | 21 | #include <linux/ctype.h> |
@@ -84,15 +85,11 @@ static int do_reset_coda_cache_inv_stats( ctl_table * table, int write, | |||
84 | return 0; | 85 | return 0; |
85 | } | 86 | } |
86 | 87 | ||
87 | static int coda_vfs_stats_get_info( char * buffer, char ** start, | 88 | static int proc_vfs_stats_show(struct seq_file *m, void *v) |
88 | off_t offset, int length) | ||
89 | { | 89 | { |
90 | int len=0; | ||
91 | off_t begin; | ||
92 | struct coda_vfs_stats * ps = & coda_vfs_stat; | 90 | struct coda_vfs_stats * ps = & coda_vfs_stat; |
93 | 91 | ||
94 | /* this works as long as we are below 1024 characters! */ | 92 | seq_printf(m, |
95 | len += sprintf( buffer, | ||
96 | "Coda VFS statistics\n" | 93 | "Coda VFS statistics\n" |
97 | "===================\n\n" | 94 | "===================\n\n" |
98 | "File Operations:\n" | 95 | "File Operations:\n" |
@@ -132,28 +129,14 @@ static int coda_vfs_stats_get_info( char * buffer, char ** start, | |||
132 | ps->rmdir, | 129 | ps->rmdir, |
133 | ps->rename, | 130 | ps->rename, |
134 | ps->permission); | 131 | ps->permission); |
135 | 132 | return 0; | |
136 | begin = offset; | ||
137 | *start = buffer + begin; | ||
138 | len -= begin; | ||
139 | |||
140 | if ( len > length ) | ||
141 | len = length; | ||
142 | if ( len < 0 ) | ||
143 | len = 0; | ||
144 | |||
145 | return len; | ||
146 | } | 133 | } |
147 | 134 | ||
148 | static int coda_cache_inv_stats_get_info( char * buffer, char ** start, | 135 | static int proc_cache_inv_stats_show(struct seq_file *m, void *v) |
149 | off_t offset, int length) | ||
150 | { | 136 | { |
151 | int len=0; | ||
152 | off_t begin; | ||
153 | struct coda_cache_inv_stats * ps = & coda_cache_inv_stat; | 137 | struct coda_cache_inv_stats * ps = & coda_cache_inv_stat; |
154 | 138 | ||
155 | /* this works as long as we are below 1024 characters! */ | 139 | seq_printf(m, |
156 | len += sprintf( buffer, | ||
157 | "Coda cache invalidation statistics\n" | 140 | "Coda cache invalidation statistics\n" |
158 | "==================================\n\n" | 141 | "==================================\n\n" |
159 | "flush\t\t%9d\n" | 142 | "flush\t\t%9d\n" |
@@ -170,19 +153,35 @@ static int coda_cache_inv_stats_get_info( char * buffer, char ** start, | |||
170 | ps->zap_vnode, | 153 | ps->zap_vnode, |
171 | ps->purge_fid, | 154 | ps->purge_fid, |
172 | ps->replace ); | 155 | ps->replace ); |
173 | 156 | return 0; | |
174 | begin = offset; | 157 | } |
175 | *start = buffer + begin; | ||
176 | len -= begin; | ||
177 | 158 | ||
178 | if ( len > length ) | 159 | static int proc_vfs_stats_open(struct inode *inode, struct file *file) |
179 | len = length; | 160 | { |
180 | if ( len < 0 ) | 161 | return single_open(file, proc_vfs_stats_show, NULL); |
181 | len = 0; | 162 | } |
182 | 163 | ||
183 | return len; | 164 | static int proc_cache_inv_stats_open(struct inode *inode, struct file *file) |
165 | { | ||
166 | return single_open(file, proc_cache_inv_stats_show, NULL); | ||
184 | } | 167 | } |
185 | 168 | ||
169 | static const struct file_operations proc_vfs_stats_fops = { | ||
170 | .owner = THIS_MODULE, | ||
171 | .open = proc_vfs_stats_open, | ||
172 | .read = seq_read, | ||
173 | .llseek = seq_lseek, | ||
174 | .release = single_release, | ||
175 | }; | ||
176 | |||
177 | static const struct file_operations proc_cache_inv_stats_fops = { | ||
178 | .owner = THIS_MODULE, | ||
179 | .open = proc_cache_inv_stats_open, | ||
180 | .read = seq_read, | ||
181 | .llseek = seq_lseek, | ||
182 | .release = single_release, | ||
183 | }; | ||
184 | |||
186 | static ctl_table coda_table[] = { | 185 | static ctl_table coda_table[] = { |
187 | {CODA_TIMEOUT, "timeout", &coda_timeout, sizeof(int), 0644, NULL, &proc_dointvec}, | 186 | {CODA_TIMEOUT, "timeout", &coda_timeout, sizeof(int), 0644, NULL, &proc_dointvec}, |
188 | {CODA_HARD, "hard", &coda_hard, sizeof(int), 0644, NULL, &proc_dointvec}, | 187 | {CODA_HARD, "hard", &coda_hard, sizeof(int), 0644, NULL, &proc_dointvec}, |
@@ -212,9 +211,6 @@ static struct proc_dir_entry* proc_fs_coda; | |||
212 | 211 | ||
213 | #endif | 212 | #endif |
214 | 213 | ||
215 | #define coda_proc_create(name,get_info) \ | ||
216 | create_proc_info_entry(name, 0, proc_fs_coda, get_info) | ||
217 | |||
218 | void coda_sysctl_init(void) | 214 | void coda_sysctl_init(void) |
219 | { | 215 | { |
220 | reset_coda_vfs_stats(); | 216 | reset_coda_vfs_stats(); |
@@ -223,9 +219,15 @@ void coda_sysctl_init(void) | |||
223 | #ifdef CONFIG_PROC_FS | 219 | #ifdef CONFIG_PROC_FS |
224 | proc_fs_coda = proc_mkdir("coda", proc_root_fs); | 220 | proc_fs_coda = proc_mkdir("coda", proc_root_fs); |
225 | if (proc_fs_coda) { | 221 | if (proc_fs_coda) { |
222 | struct proc_dir_entry *pde; | ||
223 | |||
226 | proc_fs_coda->owner = THIS_MODULE; | 224 | proc_fs_coda->owner = THIS_MODULE; |
227 | coda_proc_create("vfs_stats", coda_vfs_stats_get_info); | 225 | pde = create_proc_entry("vfs_stats", 0, proc_fs_coda); |
228 | coda_proc_create("cache_inv_stats", coda_cache_inv_stats_get_info); | 226 | if (pde) |
227 | pde->proc_fops = &proc_vfs_stats_fops; | ||
228 | pde = create_proc_entry("cache_inv_stats", 0, proc_fs_coda); | ||
229 | if (pde) | ||
230 | pde->proc_fops = &proc_cache_inv_stats_fops; | ||
229 | } | 231 | } |
230 | #endif | 232 | #endif |
231 | 233 | ||