commit 486afb754b80503aaa139ed98bc733baa79fb8b0
Author: Josef 'Jeff' Sipek <[EMAIL PROTECTED]>
Date:   Fri Jun 8 10:58:22 2007 -0400

    Unionfs: Change free_dentry_private_info to take a struct dentry
    
    This makes it more symmetric with new_dentry_private_info.
    
    Signed-off-by: Josef 'Jeff' Sipek <[EMAIL PROTECTED]>

diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c
index 
364881c95a40c67fe63008f12ee80c6175725506..6310c32b74be4b517061d678ff9956078971ede2
 100644
--- a/fs/unionfs/dentry.c
+++ b/fs/unionfs/dentry.c
@@ -456,8 +456,7 @@ static void unionfs_d_release(struct den
 
 out_free:
        /* No need to unlock it, because it is disappeared. */
-       free_dentry_private_data(UNIONFS_D(dentry));
-       dentry->d_fsdata = NULL;        /* just to be safe */
+       free_dentry_private_data(dentry);
 
 out:
        return;
diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
index 
93b92988c05455f74553be772ebc9fcf36de0127..4e89a3c4b87b9d9476f0845072e1bac18b4320bb
 100644
--- a/fs/unionfs/lookup.c
+++ b/fs/unionfs/lookup.c
@@ -478,11 +478,12 @@ void unionfs_destroy_dentry_cache(void)
                kmem_cache_destroy(unionfs_dentry_cachep);
 }
 
-void free_dentry_private_data(struct unionfs_dentry_info *udi)
+void free_dentry_private_data(struct dentry *dentry)
 {
-       if (!udi)
+       if (!dentry || !dentry->d_fsdata)
                return;
-       kmem_cache_free(unionfs_dentry_cachep, udi);
+       kmem_cache_free(unionfs_dentry_cachep, dentry->d_fsdata);
+       dentry->d_fsdata = NULL;
 }
 
 static inline int __realloc_dentry_private_data(struct dentry *dentry)
@@ -519,8 +520,7 @@ int realloc_dentry_private_data(struct d
                return 0;
 
        kfree(UNIONFS_D(dentry)->lower_paths);
-       free_dentry_private_data(UNIONFS_D(dentry));
-       dentry->d_fsdata = NULL;
+       free_dentry_private_data(dentry);
        return -ENOMEM;
 }
 
diff --git a/fs/unionfs/main.c b/fs/unionfs/main.c
index 
1ad790fd3478b3db3d843ab137d428a5b9728c05..2f884abc3077de274cb519496769545144e6ef1e
 100644
--- a/fs/unionfs/main.c
+++ b/fs/unionfs/main.c
@@ -665,7 +665,7 @@ static int unionfs_read_super(struct sup
 out_freedpd:
        if (UNIONFS_D(sb->s_root)) {
                kfree(UNIONFS_D(sb->s_root)->lower_paths);
-               free_dentry_private_data(UNIONFS_D(sb->s_root));
+               free_dentry_private_data(sb->s_root);
        }
        dput(sb->s_root);
 
diff --git a/fs/unionfs/union.h b/fs/unionfs/union.h
index 
325a45167aa48a41899ceb4c4537bb0531998caa..b66ff60df6f581d441f188532b70742019592265
 100644
--- a/fs/unionfs/union.h
+++ b/fs/unionfs/union.h
@@ -241,7 +241,7 @@ static inline void unionfs_double_lock_d
 
 extern int realloc_dentry_private_data(struct dentry *dentry);
 extern int new_dentry_private_data(struct dentry *dentry);
-extern void free_dentry_private_data(struct unionfs_dentry_info *udi);
+extern void free_dentry_private_data(struct dentry *dentry);
 extern void update_bstart(struct dentry *dentry);
 
 /*
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to