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

Christoph Hellwig
2007-09-28T18:40:21Z

On Thu, Sep 27, 2007 at 04:12:08PM +0200, jblunck@suse.de 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?