From 49e749029652f9061ce74e28e4e5dc48ed8175c1 Mon Sep 17 00:00:00 2001 From: Erez_Zadok Date: Mon, 28 May 2007 19:39:44 -0400 Subject: [PATCH] cleanup: rewrite unionfs_partial_lookup more cleanly and add comments Signed-off-by: Erez Zadok --- fs/unionfs/lookup.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c index ead0c6ac806..5c2334e6e35 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. */ -- 2.43.0