Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/ext2fs/ext2_inode.c
Show First 20 Lines • Show All 530 Lines • ▼ Show 20 Lines | ext2_ext_truncate(struct vnode *vp, off_t length, int flags, | ||||
} | } | ||||
oip->i_size = osize; | oip->i_size = osize; | ||||
error = vtruncbuf(ovp, length, (int)fs->e2fs_bsize); | error = vtruncbuf(ovp, length, (int)fs->e2fs_bsize); | ||||
if (error) | if (error) | ||||
return (error); | return (error); | ||||
vnode_pager_setsize(ovp, length); | vnode_pager_setsize(ovp, length); | ||||
cluster_init_vn(&oip->i_clusterw); | |||||
fsu: If you want to invalidate inode clustering information in all cases of truncation, you need to… | |||||
oip->i_size = length; | oip->i_size = length; | ||||
oip->i_flag |= IN_CHANGE | IN_UPDATE; | oip->i_flag |= IN_CHANGE | IN_UPDATE; | ||||
error = ext2_update(ovp, !DOINGASYNC(ovp)); | error = ext2_update(ovp, !DOINGASYNC(ovp)); | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |
If you want to invalidate inode clustering information in all cases of truncation, you need to place this cluster_init_vn() call in the end of ext2_truncate(), I think.
Currently clustering information will be invalidated only in case of extents (IN_E4EXTENTS inode flag).