- block_truncate_page(inode->i_mapping, inode->i_size, xfs_get_blocks);
-}
-
-STATIC int
-xfs_vn_sync_flags(struct inode *inode)
-{
- unsigned int oldflags, newflags;
- vattr_t vattr;
- int flags = 0;
- int error;
- vnode_t *vp = vn_from_inode(inode);
-
- memset(&vattr, 0, sizeof(vattr_t));
-
- vattr.va_mask = XFS_AT_XFLAGS;
- VOP_GETATTR(vp, &vattr, 0, NULL, error);
- if (error)
- return error;
- oldflags = vattr.va_xflags;
- newflags = oldflags & ~(XFS_XFLAG_IMMUTABLE |
- XFS_XFLAG_IUNLINK | XFS_XFLAG_BARRIER);
-
- if (IS_IMMUTABLE(inode))
- newflags |= XFS_XFLAG_IMMUTABLE;
- if (IS_IUNLINK(inode))
- newflags |= XFS_XFLAG_IUNLINK;
- if (IS_BARRIER(inode))
- newflags |= XFS_XFLAG_BARRIER;
-
- if (oldflags ^ newflags) {
- vattr.va_xflags = newflags;
- vattr.va_mask |= XFS_AT_XFLAGS;
- VOP_SETATTR(vp, &vattr, flags, NULL, error);
- }
- vn_revalidate(vp);
- return error;