Merge to Fedora kernel-2.6.18-1.2255_FC5-vs2.0.2.2-rc9 patched with stable patch...
[linux-2.6.git] / fs / afs / super.c
index bcf81d3..67d1f5c 100644 (file)
@@ -38,9 +38,9 @@ struct afs_mount_params {
 static void afs_i_init_once(void *foo, kmem_cache_t *cachep,
                            unsigned long flags);
 
-static struct super_block *afs_get_sb(struct file_system_type *fs_type,
-                                     int flags, const char *dev_name,
-                                     void *data);
+static int afs_get_sb(struct file_system_type *fs_type,
+                     int flags, const char *dev_name,
+                     void *data, struct vfsmount *mnt);
 
 static struct inode *afs_alloc_inode(struct super_block *sb);
 
@@ -48,7 +48,7 @@ static void afs_put_super(struct super_block *sb);
 
 static void afs_destroy_inode(struct inode *inode);
 
-static struct file_system_type afs_fs_type = {
+struct file_system_type afs_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "afs",
        .get_sb         = afs_get_sb,
@@ -78,9 +78,7 @@ int __init afs_fs_init(void)
 
        _enter("");
 
-#ifdef AFS_AUTOMOUNT_SUPPORT
        afs_timer_init(&afs_mntpt_expiry_timer, &afs_mntpt_expiry_timer_ops);
-#endif
 
        /* create ourselves an inode cache */
        atomic_set(&afs_count_active_inodes, 0);
@@ -172,7 +170,7 @@ static int afs_super_parse_options(struct afs_mount_params *params,
        options[PAGE_SIZE - 1] = 0;
 
        ret = 0;
-       while ((key = strsep(&options, ",")))
+       while ((key = strsep(&options, ",")) != 0)
        {
                value = strchr(key, '=');
                if (value)
@@ -296,10 +294,11 @@ static int afs_fill_super(struct super_block *sb, void *data, int silent)
  * get an AFS superblock
  * - TODO: don't use get_sb_nodev(), but rather call sget() directly
  */
-static struct super_block *afs_get_sb(struct file_system_type *fs_type,
-                                     int flags,
-                                     const char *dev_name,
-                                     void *options)
+static int afs_get_sb(struct file_system_type *fs_type,
+                     int flags,
+                     const char *dev_name,
+                     void *options,
+                     struct vfsmount *mnt)
 {
        struct afs_mount_params params;
        struct super_block *sb;
@@ -313,7 +312,7 @@ static struct super_block *afs_get_sb(struct file_system_type *fs_type,
        ret = afscm_start();
        if (ret < 0) {
                _leave(" = %d", ret);
-               return ERR_PTR(ret);
+               return ret;
        }
 
        /* parse the options */
@@ -343,25 +342,26 @@ static struct super_block *afs_get_sb(struct file_system_type *fs_type,
 
        sb->s_flags = flags;
 
-       ret = afs_fill_super(sb, &params, flags & MS_VERBOSE ? 1 : 0);
+       ret = afs_fill_super(sb, &params, flags & MS_SILENT ? 1 : 0);
        if (ret < 0) {
                up_write(&sb->s_umount);
                deactivate_super(sb);
                goto error;
        }
        sb->s_flags |= MS_ACTIVE;
+       simple_set_mnt(mnt, sb);
 
        afs_put_volume(params.volume);
        afs_put_cell(params.default_cell);
-       _leave(" = %p", sb);
-       return sb;
+       _leave(" = 0 [%p]", 0, sb);
+       return 0;
 
  error:
        afs_put_volume(params.volume);
        afs_put_cell(params.default_cell);
        afscm_stop();
        _leave(" = %d", ret);
-       return ERR_PTR(ret);
+       return ret;
 } /* end afs_get_sb() */
 
 /*****************************************************************************/