fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / coda / sysctl.c
index 7c8a136..1c82e9a 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/config.h>
 #include <linux/time.h>
 #include <linux/mm.h>
 #include <linux/sysctl.h>
@@ -19,7 +18,7 @@
 #include <linux/slab.h>
 #include <linux/stat.h>
 #include <linux/ctype.h>
-#include <asm/bitops.h>
+#include <linux/bitops.h>
 #include <asm/uaccess.h>
 #include <linux/utsname.h>
 #include <linux/module.h>
@@ -41,40 +40,27 @@ static struct ctl_table_header *fs_table_header;
 #define CODA_CACHE_INV          9       /* cache invalidation statistics */
 #define CODA_FAKE_STATFS 10     /* don't query venus for actual cache usage */
 
-static ctl_table coda_table[] = {
-       {CODA_TIMEOUT, "timeout", &coda_timeout, sizeof(int), 0644, NULL, &proc_dointvec},
-       {CODA_HARD, "hard", &coda_hard, sizeof(int), 0644, NULL, &proc_dointvec},
-       {CODA_VFS, "vfs_stats", NULL, 0, 0644, NULL, &do_reset_coda_vfs_stats},
-       {CODA_CACHE_INV, "cache_inv_stats", NULL, 0, 0644, NULL, &do_reset_coda_cache_inv_stats},
-       {CODA_FAKE_STATFS, "fake_statfs", &coda_fake_statfs, sizeof(int), 0600, NULL, &proc_dointvec},
-       { 0 }
-};
-
-static ctl_table fs_table[] = {
-       {FS_CODA, "coda",    NULL, 0, 0555, coda_table},
-       {0}
-};
-
 struct coda_vfs_stats          coda_vfs_stat;
-struct coda_cache_inv_stats    coda_cache_inv_stat;
+static struct coda_cache_inv_stats     coda_cache_inv_stat;
 
-void reset_coda_vfs_stats( void )
+static void reset_coda_vfs_stats( void )
 {
        memset( &coda_vfs_stat, 0, sizeof( coda_vfs_stat ) );
 }
 
-void reset_coda_cache_inv_stats( void )
+static void reset_coda_cache_inv_stats( void )
 {
        memset( &coda_cache_inv_stat, 0, sizeof( coda_cache_inv_stat ) );
 }
 
-int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
-                            void * buffer, size_t * lenp )
+static int do_reset_coda_vfs_stats( ctl_table * table, int write,
+                                   struct file * filp, void __user * buffer,
+                                   size_t * lenp, loff_t * ppos )
 {
        if ( write ) {
                reset_coda_vfs_stats();
 
-               filp->f_pos += *lenp;
+               *ppos += *lenp;
        } else {
                *lenp = 0;
        }
@@ -82,14 +68,15 @@ int do_reset_coda_vfs_stats( ctl_table * table, int write, struct file * filp,
        return 0;
 }
 
-int do_reset_coda_cache_inv_stats( ctl_table * table, int write, 
-                                  struct file * filp, void * buffer, 
-                                  size_t * lenp )
+static int do_reset_coda_cache_inv_stats( ctl_table * table, int write,
+                                         struct file * filp,
+                                         void __user * buffer,
+                                         size_t * lenp, loff_t * ppos )
 {
        if ( write ) {
                reset_coda_cache_inv_stats();
 
-               filp->f_pos += *lenp;
+               *ppos += *lenp;
        } else {
                *lenp = 0;
        }
@@ -97,8 +84,8 @@ int do_reset_coda_cache_inv_stats( ctl_table * table, int write,
        return 0;
 }
 
-int coda_vfs_stats_get_info( char * buffer, char ** start, off_t offset,
-                            int length)
+static int coda_vfs_stats_get_info( char * buffer, char ** start,
+                                   off_t offset, int length)
 {
        int len=0;
        off_t begin;
@@ -158,8 +145,8 @@ int coda_vfs_stats_get_info( char * buffer, char ** start, off_t offset,
        return len;
 }
 
-int coda_cache_inv_stats_get_info( char * buffer, char ** start, off_t offset,
-                                  int length)
+static int coda_cache_inv_stats_get_info( char * buffer, char ** start,
+                                         off_t offset, int length)
 {
        int len=0;
        off_t begin;
@@ -196,6 +183,20 @@ int coda_cache_inv_stats_get_info( char * buffer, char ** start, off_t offset,
        return len;
 }
 
+static ctl_table coda_table[] = {
+       {CODA_TIMEOUT, "timeout", &coda_timeout, sizeof(int), 0644, NULL, &proc_dointvec},
+       {CODA_HARD, "hard", &coda_hard, sizeof(int), 0644, NULL, &proc_dointvec},
+       {CODA_VFS, "vfs_stats", NULL, 0, 0644, NULL, &do_reset_coda_vfs_stats},
+       {CODA_CACHE_INV, "cache_inv_stats", NULL, 0, 0644, NULL, &do_reset_coda_cache_inv_stats},
+       {CODA_FAKE_STATFS, "fake_statfs", &coda_fake_statfs, sizeof(int), 0600, NULL, &proc_dointvec},
+       { 0 }
+};
+
+static ctl_table fs_table[] = {
+       {FS_CODA, "coda",    NULL, 0, 0555, coda_table},
+       {0}
+};
+
 
 #ifdef CONFIG_PROC_FS
 
@@ -207,14 +208,14 @@ int coda_cache_inv_stats_get_info( char * buffer, char ** start, off_t offset,
 
 */
 
-struct proc_dir_entry* proc_fs_coda;
+static struct proc_dir_entry* proc_fs_coda;
 
 #endif
 
 #define coda_proc_create(name,get_info) \
        create_proc_info_entry(name, 0, proc_fs_coda, get_info)
 
-void coda_sysctl_init()
+void coda_sysctl_init(void)
 {
        reset_coda_vfs_stats();
        reset_coda_cache_inv_stats();
@@ -234,13 +235,13 @@ void coda_sysctl_init()
 #endif 
 }
 
-void coda_sysctl_clean() 
+void coda_sysctl_clean(void
 {
 
 #ifdef CONFIG_SYSCTL
        if ( fs_table_header ) {
                unregister_sysctl_table(fs_table_header);
-               fs_table_header = 0;
+               fs_table_header = NULL;
        }
 #endif