* If old == new, we're done.
*/
if (old->p_base->pb_ino == new->p_base->pb_ino)
- goto out;
+ goto short_out;
if (new->p_base->pb_ino) {
/*
err = -EBUSY;
goto error1;
}
- err = old->p_base->pb_ino->i_ops.inop_rename(old, new);
+ /*
+ * Use the parent node operations to request the task in case the
+ * driver is implemented using differentiated inode operations based
+ * on file type, such as incore does.
+ */
+ err = old->p_parent->p_base->pb_ino->i_ops.inop_rename(old, new);
if (err)
goto error1;
/*
if (new->p_base->pb_ino)
I_GONE(new->p_base->pb_ino);
new->p_base->pb_ino = old->p_base->pb_ino;
- I_REF(new->p_base->pb_ino);
+ old->p_base->pb_ino = NULL;
+short_out:
error1:
P_RELE(new);
error2:
error3:
if (err)
goto out;
- _sysio_p_gone(old); /* kill it! */
out:
SYSIO_INTERFACE_RETURN(err ? -1 : 0, err);
}