Re: dentry question

Bill Hawes (whawes@star.net)
Mon, 13 Oct 1997 09:37:32 -0400


Hans-Joachim Widmaier wrote:
> I'm currently updating the affs for the dentry stuff. While
> testing, I came across some problems with (hard) links and
> decided to rework this part. Most of it is done and looks
> ok, but there's one thing left: When a file which has hard
> links to it is deleted, one of the links must be turned
> into a file. I therefor have to change the inode of the
> dentry which describes the former link. May I safely call
> lookup() and change dentry->d_inode of the returned dentry?

In general changing d_inode of an existing dentry is not an allowed
operation -- another user might have a reference to it. If the dentry
d_count was 1 you could probably get away with it, but then your code
would have a potential failure.

Is there some other way to handle the problem?

Regards,
Bill