[PATCH] Cleanup LOOKUP_PARENT handling in fs/namei.c

From: Paul Menage (pmenage@ensim.com)
Date: Wed Oct 03 2001 - 21:17:20 EST


The attached patch (against 2.4.10) adds a user_path_walk_parent() macro
in fs.h, and uses it to clean up some repetitive code in fs/namei.c.
Basically, variations on the sequence:

tmp = getname(path)
if(!IS_ERR(tmp)) {
        if(!path_init(tmp, LOOKUP_PARENT, &nd))
                error = path_walk(tmp, &nd);
        if(!error) {
                error = do_stuff_with_parentdir();
                path_release(&nd);
        }
        putname(tmp);
}

are replaced with:

error = user_path_walk_parent(path, &nd);
if(!error) {
        error = do_stuff_with_parentdir();
        path_release(&nd);
}

Paul



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Oct 07 2001 - 21:00:30 EST