GIT: unionfs2-2.6.27.y: cleanup: rewrite unionfs_partial_lookup more cleanly and add comments

Erez Zadok ezk at fsl.cs.sunysb.edu
Thu Aug 12 23:16:30 EDT 2010


commit fc9dc195a25d92c1809601447cb6eceec7a5d426
Author: Erez_Zadok <ezk at cs.sunysb.edu>
Date:   Mon May 28 19:39:44 2007 -0400

    cleanup: rewrite unionfs_partial_lookup more cleanly and add comments
    
    Signed-off-by: Erez Zadok <ezk at cs.sunysb.edu>

diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
index ead0c6a..5c2334e 100644
--- a/fs/unionfs/lookup.c
+++ b/fs/unionfs/lookup.c
@@ -422,20 +422,30 @@ out:
 	return ERR_PTR(err);
 }
 
-/* This is a utility function that fills in a unionfs dentry */
+/*
+ * This is a utility function that fills in a unionfs dentry.
+ *
+ * Returns: 0 (ok), or -ERRNO if an error occurred.
+ */
 int unionfs_partial_lookup(struct dentry *dentry)
 {
 	struct dentry *tmp;
 	struct nameidata nd = { .flags = 0 };
+	int err = -ENOSYS;
 
 	tmp = unionfs_lookup_backend(dentry, &nd, INTERPOSE_PARTIAL);
-	if (!tmp)
-		return 0;
-	if (IS_ERR(tmp))
-		return PTR_ERR(tmp);
+	if (!tmp) {
+		err = 0;
+		goto out;
+	}
+	if (IS_ERR(tmp)) {
+		err = PTR_ERR(tmp);
+		goto out;
+	}
 	/* need to change the interface */
 	BUG_ON(tmp != dentry);
-	return -ENOSYS;
+out:
+	return err;
 }
 
 /* The dentry cache is just so we have properly sized dentries. */


More information about the unionfs-cvs mailing list