commit 3ae2fd8f5e4b4c45aa1bc2687e87c3fcd8897cc2
Author: Erez_Zadok <[EMAIL PROTECTED]>
Date: Sun Jun 10 17:45:53 2007 -0400
cleanup: rewrite new_dentry_private data more simply
Also remove unnecessary variables and statements.
Signed-off-by: Erez Zadok <[EMAIL PROTECTED]>
Conflicts:
fs/unionfs/lookup.c
diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
index 886f050..43bf510 100644
--- a/fs/unionfs/lookup.c
+++ b/fs/unionfs/lookup.c
@@ -428,24 +428,20 @@ int new_dentry_private_data(struct dentry *dentry)
int size;
struct unionfs_dentry_info *info = UNIONFS_D(dentry);
void *p;
- int unlock_on_err = 0;
- if (!info) {
- dentry->d_fsdata = kmem_cache_alloc(unionfs_dentry_cachep,
- GFP_ATOMIC);
- info = UNIONFS_D(dentry);
- if (!info)
- goto out;
+ BUG_ON(info);
- mutex_init(&info->lock);
- unionfs_lock_dentry(dentry);
- unlock_on_err = 1;
+ dentry->d_fsdata = kmem_cache_alloc(unionfs_dentry_cachep,
+ GFP_ATOMIC);
+ info = UNIONFS_D(dentry);
+ if (!info)
+ goto out;
- info->lower_paths = NULL;
- }
+ mutex_init(&info->lock);
+ info->lower_paths = NULL;
+ unionfs_lock_dentry(dentry);
- info->bstart = -1;
- info->bend = -1;
+ info->bstart = info->bend = -1;
info->bcount = sbmax(dentry->d_sb);
info->odf.dentry = NULL;
atomic_set(&info->generation,
@@ -463,10 +459,7 @@ int new_dentry_private_data(struct dentry *dentry)
return 0;
out_free:
- kfree(info->lower_paths);
- if (unlock_on_err)
- unionfs_unlock_dentry(dentry);
-
+ unionfs_unlock_dentry(dentry);
out:
free_dentry_private_data(info);
dentry->d_fsdata = NULL;
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs