]> git.hungrycats.org Git - linux/commitdiff
Fix compile warning in AFS by passing around "const" types properly.
authorLinus Torvalds <torvalds@home.osdl.org>
Mon, 18 Aug 2003 01:38:18 +0000 (18:38 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 18 Aug 2003 01:38:18 +0000 (18:38 -0700)
fs/afs/super.c
fs/afs/volume.c
fs/afs/volume.h

index f02009bf7bd6e02fadf1f5d0a7b35d42ea150158..d7fd182b9902b80990fa08abcdda4665472bba13 100644 (file)
@@ -240,7 +240,7 @@ static int want_ipaddr(char **_value, const char *option, struct in_addr *addr)
  * - this function has been shamelessly adapted from the ext3 fs which shamelessly adapted it from
  *   the msdos fs
  */
-static int afs_super_parse_options(struct afs_super_info *as, char *options, char **devname)
+static int afs_super_parse_options(struct afs_super_info *as, char *options, const char ** devname)
 {
        char *key, *value;
        int ret;
@@ -314,6 +314,11 @@ static int afs_super_parse_options(struct afs_super_info *as, char *options, cha
        return ret;
 } /* end afs_super_parse_options() */
 
+struct fill_super_options {
+       const char *dev_name;
+       void *options;
+};
+
 /*****************************************************************************/
 /*
  * fill in the superblock
@@ -324,8 +329,9 @@ static int afs_fill_super(struct super_block *sb, void *_data, int silent)
        struct dentry *root = NULL;
        struct inode *inode = NULL;
        afs_fid_t fid;
-       void **data = _data;
-       char *options, *devname;
+       struct fill_super_options *data = _data;
+       const char *devname;
+       char *options;
        int ret;
 
        _enter("");
@@ -334,8 +340,8 @@ static int afs_fill_super(struct super_block *sb, void *_data, int silent)
                _leave(" = -EINVAL");
                return -EINVAL;
        }
-       devname = data[0];
-       options = data[1];
+       devname = data->dev_name;
+       options = data->options;
        if (options)
                options[PAGE_SIZE-1] = 0;
 
@@ -413,7 +419,7 @@ afs_get_sb(struct file_system_type *fs_type, int flags,
           const char *dev_name, void *options)
 {
        struct super_block *sb;
-       void *data[2] = { dev_name, options };
+       struct fill_super_options data = { dev_name, options };
        int ret;
 
        _enter(",,%s,%p",dev_name,options);
@@ -426,7 +432,7 @@ afs_get_sb(struct file_system_type *fs_type, int flags,
        }
 
        /* allocate a deviceless superblock */
-       sb = get_sb_nodev(fs_type,flags,data,afs_fill_super);
+       sb = get_sb_nodev(fs_type, flags, &data, afs_fill_super);
        if (IS_ERR(sb)) {
                afscm_stop();
                return sb;
index 198c355c715ba5aa4dd54bea9936a86ff93f513f..283e8530fa33a1ec809ff1373d3b9c54ab2d5353 100644 (file)
@@ -43,7 +43,7 @@ const char *afs_voltypes[] = { "R/W", "R/O", "BAK" };
  * - Rule 2: If parent volume is R/O, then mount R/O volume by preference, R/W if not available
  * - Rule 3: If parent volume is R/W, then only mount R/W volume unless explicitly told otherwise
  */
-int afs_volume_lookup(char *name, int rwparent, afs_volume_t **_volume)
+int afs_volume_lookup(const char *name, int rwparent, afs_volume_t **_volume)
 {
        afs_vlocation_t *vlocation = NULL;
        afs_voltype_t type;
index 1842d983677fa2035837cc0fecb9f9aa10291eb9..b9dc6d1b5cdd5b6da8e45f58f873d5f8e02ccda4 100644 (file)
@@ -79,7 +79,7 @@ struct afs_volume
        struct rw_semaphore     server_sem;     /* lock for accessing current server */
 };
 
-extern int afs_volume_lookup(char *name, int ro, afs_volume_t **_volume);
+extern int afs_volume_lookup(const char *name, int ro, afs_volume_t **_volume);
 
 #define afs_get_volume(V) do { atomic_inc(&(V)->usage); } while(0)