---
name: "debugfs_rename"
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/debugfs_rename"
---

# debugfs\_rename(9)

rename a file/directory in the debugfs filesystem

## NAME

debugfs\_rename - rename a file/directory in the debugfs filesystem

## SYNOPSIS

**struct dentry \* debugfs\_rename(struct dentry \*** *old\_dir***, struct dentry \*** *old\_dentry***, struct dentry \*** *new\_dir***, const char \*** *new\_name***);**

## ARGUMENTS

*old\_dir*

a pointer to the parent dentry for the renamed object. This should be a directory dentry.

*old\_dentry*

dentry of an object to be renamed.

*new\_dir*

a pointer to the parent dentry where the object should be moved. This should be a directory dentry.

*new\_name*

a pointer to a string containing the target name.

## DESCRIPTION

This function renames a file/directory in debugfs. The target must not exist for rename to succeed.

This function will return a pointer to old\_dentry (which is updated to reflect renaming) if it succeeds. If an error occurs, **NULL** will be returned.

If debugfs is not enabled in the kernel, the value -**ENODEV** will be returned.

## COPYRIGHT
