commit 7cf1817cd7bce28d7d88010b25189880e12a3bd5
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date:   Sun Feb 4 15:23:40 2007 -0500

    mntput + mntget odf mount

diff --git a/fs/unionfs/main.c b/fs/unionfs/main.c
index ccd6ef6..7ebeff0 100644
--- a/fs/unionfs/main.c
+++ b/fs/unionfs/main.c
@@ -557,11 +557,11 @@ static int unionfs_read_super(struct super_block *sb, 
void *raw_data,
        }
 
        /* get the odf super block */
-       UNIONFS_SB(sb)->sbodf = odf_read_super(ODF_MOUNT);      
-       if ( IS_ERR(UNIONFS_SB(sb)->sbodf) ) {
+       UNIONFS_SB(sb)->odf_mnt = odf_read_super(ODF_MOUNT);    
+       if ( IS_ERR(UNIONFS_SB(sb)->odf_mnt) ) {
                printk(KERN_WARNING "unionfs_read_super: odf error\n");
-               err = PTR_ERR(UNIONFS_SB(sb)->sbodf);
-               UNIONFS_SB(sb)->sbodf = NULL;
+               err = PTR_ERR(UNIONFS_SB(sb)->odf_mnt);
+               UNIONFS_SB(sb)->odf_mnt = NULL;
                goto out_free;
        }
 
diff --git a/fs/unionfs/odf.c b/fs/unionfs/odf.c
index 6f7393b..745eada 100644
--- a/fs/unionfs/odf.c
+++ b/fs/unionfs/odf.c
@@ -4,31 +4,32 @@
 /*
        Initialize any odf data we might need
 */
-struct super_block * odf_read_super(char *odffile)
+struct vfsmount* odf_read_super(char *odffile)
 {
        struct nameidata nd;
-       struct super_block *odf = NULL;
+       struct vfsmount *odfmnt = NULL;
        int err = 0;
        
        if ( odffile == NULL ) {
                printk(KERN_WARNING "unionfs_odf: No odf mount specified\n");
-               odf = ERR_PTR(-EINVAL);
+               odfmnt = ERR_PTR(-EINVAL);
                goto out;
        }
        
        err = path_lookup(odffile, LOOKUP_FOLLOW, &nd); 
        if ( err ) {    
                printk(KERN_WARNING "unionfs_odf: Cannot access odf mount\n");
-               odf = ERR_PTR(err);
+               odfmnt = ERR_PTR(err);
                goto out;
        }
-       odf = nd.mnt->mnt_sb;
-       dget(odf->s_root);
-       /* mnt get */
+       
+       odfmnt = nd.mnt;
+       mntget(odfmnt);
+       dget(odfmnt->mnt_sb->s_root);
        path_release(&nd);      
 
 out:
-       return odf;
+       return odfmnt;
 
 }
 
@@ -37,8 +38,8 @@ out:
 */
 void odf_put_super(struct super_block *sb)
 {
-       /*putmnt*/
-       dput(sb->s_root);
+       dput(UNIONFS_SB(sb)->odf_mnt->mnt_sb->s_root);
+       mntput(UNIONFS_SB(sb)->odf_mnt);
 }
 
 /*
diff --git a/fs/unionfs/odf.h b/fs/unionfs/odf.h
index 4461fb7..066f9b4 100644
--- a/fs/unionfs/odf.h
+++ b/fs/unionfs/odf.h
@@ -8,7 +8,7 @@
 #define ODF_NS "/mnt/odf/ns/"
 #define ODF_NEWBIT ODF_SB "newbit"
 
-struct super_block * odf_read_super(char *odffile);
+struct vfsmount* odf_read_super(char *odffile);
 void odf_put_super(struct super_block *sb);
 int odf_is_new(int unset);
 char *odf_getoptions(void);
diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
index 4a39cfe..4b57b3c 100644
--- a/fs/unionfs/super.c
+++ b/fs/unionfs/super.c
@@ -103,7 +103,7 @@ static void unionfs_put_super(struct super_block *sb)
        if (!spd)
                return;
        
-       odf_put_super(UNIONFS_SB(sb)->sbodf);
+       odf_put_super(sb);
                
        bstart = sbstart(sb);
        bend = sbend(sb);
diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h
index 1d611ff..18d1c82 100644
--- a/fs/unionfs/union.h
+++ b/fs/unionfs/union.h
@@ -138,7 +138,7 @@ struct unionfs_sb_info {
        atomic_t generation;
        struct rw_semaphore rwsem; /* protects access to data+id fields */
        int high_branch_id;     /* last unique branch ID given */
-       struct super_block *sbodf;
+       struct vfsmount *odf_mnt;
        struct unionfs_data *data;
 };
 
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to