Re: [PATCH 2/4] new helper: d_obtain_alias

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 11 Aug 2008, Christoph Hellwig wrote:
> +/**
> + * d_obtain_alias - find or allocate a dentry for a given inode
> + * @inode: inode to allocate the dentry for
> + *
> + * Obtain a dentry for an inode resulting from NFS filehandle conversion or
> + * similar open by handle operations.  The returned dentry may be anonymous,
> + * or may have a full name (if the inode was already in the cache).
> + *
> + * When called on a directory inode, we must ensure that the inode only ever
> + * has one dentry.  If a dentry is found, that is returned instead of
> + * allocating a new one.
> + *
> + * On successful return, the reference to the inode has been transferred
> + * to the dentry.  If %NULL is returned (indicating kmalloc failure),
                         ^^^^^
                              ERR_PTR(-ENOMEM)

> + * the reference on the inode has been released.

That's useful.

>   To make it easier
> + * to use in export operations a NULL or IS_ERR inode may be passed in
> + * and will be casted to the corresponding NULL or IS_ERR dentry.
> + */

Mixing NULL with ERR_PTR() seems like a bad idea.  It should be either
one or the other but not both.

Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux