Re: [patch 08/10] Introduce path_get()

From: Christoph Hellwig
Date: Fri Sep 28 2007 - 14:40:22 EST


On Thu, Sep 27, 2007 at 04:12:08PM +0200, jblunck@xxxxxxx wrote:
> This introduces the symmetric function to path_put() for getting a reference
> to the dentry and vfsmount of a struct path in the right order.

Looks good in general,

> /**
> + * path_get - get a reference to a path
> + * @path: path to get the reference to
> + *
> + * Given a path increment the reference count to the dentry and the vfsmount.
> + */
> +struct path *path_get(struct path *path)
> +{
> + mntget(path->mnt);
> + dget(path->dentry);
> + return path;
> +}

but the calling convention is rather odd, because the only thing callers
might do with this is to dereference and then assign it. Maybe this
should just return void to make it more clear what's going on?

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