/* Returns 0 if access is permitted, an error code otherwise  */
static int smack_inode_rename(struct inode *old_inode, struct dentry *old_dentry, struct inode *new_inode, struct dentry *new_dentry)
/* Returns 0 if access is permitted, an error code otherwise  */
static int smack_inode_rename(struct inode *old_inode, struct dentry *old_dentry, struct inode *new_inode, struct dentry *new_dentry)
{
	int rc;
	char *isp;
	struct smk_audit_info ad;
	smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_FS);
	smk_ad_setfield_u_fs_path_dentry(&ad, old_dentry);
	isp = smk_of_inode(old_dentry->d_inode);
	rc = smk_curacc(isp, MAY_READWRITE, &ad);
	if (rc == 0 && new_dentry->d_inode != NULL) {
		isp = smk_of_inode(new_dentry->d_inode);
		smk_ad_setfield_u_fs_path_dentry(&ad, new_dentry);
		rc = smk_curacc(isp, MAY_READWRITE, &ad);
	}
	return rc;
}