Changeset View
Changeset View
Standalone View
Standalone View
sys/ufs/ffs/ffs_inode.c
Show First 20 Lines • Show All 348 Lines • ▼ Show 20 Lines | if (ip->i_size == length) { | ||||
if (needextclean) | if (needextclean) | ||||
goto extclean; | goto extclean; | ||||
return (ffs_update(vp, 0)); | return (ffs_update(vp, 0)); | ||||
} | } | ||||
if (fs->fs_ronly) | if (fs->fs_ronly) | ||||
panic("ffs_truncate: read-only filesystem"); | panic("ffs_truncate: read-only filesystem"); | ||||
if (IS_SNAPSHOT(ip)) | if (IS_SNAPSHOT(ip)) | ||||
ffs_snapremove(vp); | ffs_snapremove(vp); | ||||
vp->v_lasta = vp->v_clen = vp->v_cstart = vp->v_lastw = 0; | cluster_init_vn(&ip->i_clusterw); | ||||
osize = ip->i_size; | osize = ip->i_size; | ||||
/* | /* | ||||
* Lengthen the size of the file. We must ensure that the | * Lengthen the size of the file. We must ensure that the | ||||
* last byte of the file is allocated. Since the smallest | * last byte of the file is allocated. Since the smallest | ||||
* value of osize is 0, length will be at least 1. | * value of osize is 0, length will be at least 1. | ||||
*/ | */ | ||||
if (osize < length) { | if (osize < length) { | ||||
vnode_pager_setsize(vp, length); | vnode_pager_setsize(vp, length); | ||||
▲ Show 20 Lines • Show All 452 Lines • Show Last 20 Lines |