---
name: "d_splice_alias"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/d_splice_alias"
---

# d\_splice\_alias(9)

splice a disconnected dentry into the tree if one exists

## NAME

d\_splice\_alias - splice a disconnected dentry into the tree if one exists

## SYNOPSIS

**struct dentry \* d\_splice\_alias(struct inode \*** *inode***, struct dentry \*** *dentry***);**

## ARGUMENTS

*inode*

the inode which may have a disconnected dentry

*dentry*

a negative dentry which we want to point to the inode.

## DESCRIPTION

If inode is a directory and has an IS\_ROOT alias, then d\_move that in place of the given dentry and return it, else simply d\_add the inode to the dentry and return NULL.

If a non-IS\_ROOT directory is found, the filesystem is corrupt, and we should error out: directories can't have multiple aliases.

This is needed in the lookup routine of any filesystem that is exportable (via knfsd) so that we can build dcache paths to directories effectively.

If a dentry was found and moved, then it is returned. Otherwise NULL is returned. This matches the expected return value of -\>lookup.

Cluster filesystems may call this function with a negative, hashed dentry. In that case, we know that the inode will be a regular file, and also this will only occur during atomic\_open. So we need to check for the dentry being already hashed only in the final case.

## COPYRIGHT
