Changeset View
Changeset View
Standalone View
Standalone View
sys/ufs/ffs/ffs_inode.c
Show First 20 Lines • Show All 336 Lines • ▼ Show 20 Lines | #endif | ||||
} | } | ||||
if ((flags & IO_NORMAL) == 0) | if ((flags & IO_NORMAL) == 0) | ||||
return (0); | return (0); | ||||
if (vp->v_type == VLNK && ip->i_size < ump->um_maxsymlinklen) { | if (vp->v_type == VLNK && ip->i_size < ump->um_maxsymlinklen) { | ||||
#ifdef INVARIANTS | #ifdef INVARIANTS | ||||
if (length != 0) | if (length != 0) | ||||
panic("ffs_truncate: partial truncate of symlink"); | panic("ffs_truncate: partial truncate of symlink"); | ||||
#endif | #endif | ||||
bzero(SHORTLINK(ip), (u_int)ip->i_size); | bzero(DIP(ip, i_shortlink), (u_int)ip->i_size); | ||||
ip->i_size = 0; | ip->i_size = 0; | ||||
DIP_SET(ip, i_size, 0); | DIP_SET(ip, i_size, 0); | ||||
UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); | UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); | ||||
if (needextclean) | if (needextclean) | ||||
goto extclean; | goto extclean; | ||||
return (ffs_update(vp, waitforupdate)); | return (ffs_update(vp, waitforupdate)); | ||||
} | } | ||||
if (ip->i_size == length) { | if (ip->i_size == length) { | ||||
▲ Show 20 Lines • Show All 470 Lines • Show Last 20 Lines |