kernels/linux-2.4.0/mm/shmem.c
/*
 * The VFS layer already does all the dentry stuff for rename,
 * we just have to decrement the usage count for the target if
 * it exists so that the VFS layer correctly free's it when it
 * gets overwritten.
 */
The VFS layer already does all the dentry stuff for rename,
we just have to decrement the usage count for the target if
it exists so that the VFS layer correctly free's it when it
gets overwritten.
The VFS layer already does all the dentry stuff for rename we just have to decrement the usage count for the target if it exists so that the VFS layer correctly free ' s it when it gets overwritten .
static int shmem_rename(struct inode * old_dir, struct dentry *old_dentry, struct inode * new_dir,struct dentry *new_dentry)
{
	int error = -ENOTEMPTY;
	if (shmem_empty(new_dentry)) {
		struct inode *inode = new_dentry->d_inode;
		if (inode) {
			inode->i_nlink--;
			dput(new_dentry);
		}
		error = 0;
	}
	return error;
}
static int shmem_rename ( struct inode * old_dir , struct dentry * old_dentry , struct inode * new_dir , struct dentry * new_dentry ) { int error = - ENOTEMPTY ; if ( shmem_empty ( new_dentry ) ) { struct inode * inode = new_dentry -> d_inode ; if ( inode ) { inode -> i_nlink -- ; dput ( new_dentry ) ; } error = 0 ; } return error ; }
The VFS layer already does all the dentry stuff for rename,
 we just have to decrement the usage count for the target if
 it exists so that the VFS layer correctly free's it when it
 gets overwritten.
The VFS layer already does all the dentry stuff for rename we just have to decrement the usage count for the target if it exists so that the VFS layer correctly free ' s it when it gets overwritten .