HomeFreeBSD

ufs_direnter: directory truncation does not need special case for rename

Description

ufs_direnter: directory truncation does not need special case for rename

In ufs_rename case, tdvp is locked from the place where ufs_direnter()
is done till VOP_VPUT_PAIR(), which means that we no longer need to specially
handle rename in ufs_direnter(). Truncation, if possible, is done in the
same way in ffs_vput_pair() both for rename and other VOPs calling
ufs_direnter(). Remove isrename argument and set IN_ENDOFF if
ufs_direnter() succeeded and directory needs truncation.

In ffs_vput_pair(), stop verifying the condition that directory needs
truncation when IN_ENDOFF is set, instead assert that the condition is
true.

Suggested by: mckusick
Reviewed by: chs, mckusick
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

Details

Provenance
kibAuthored on Jan 29 2021, 12:31 PM
Parents
rG038fe6e089f0: ufs_rename: use VOP_VPUT_PAIR and rely on directory sync/truncation there
Branches
Unknown
Tags
Unknown