/* Normally we invlidate everything, but if we are moving into LM_ST_DEFERRED from LM_ST_SHARED or LM_ST_EXCLUSIVE then we can keep hold of the metadata, since it won't have changed.  */
static void inode_go_inval(struct gfs2_glock *gl, int flags)
/* Normally we invlidate everything, but if we are moving into LM_ST_DEFERRED from LM_ST_SHARED or LM_ST_EXCLUSIVE then we can keep hold of the metadata, since it won't have changed.  */
static void inode_go_inval(struct gfs2_glock *gl, int flags)
{
	struct gfs2_inode *ip = gl->gl_object;
	gfs2_assert_withdraw(gl->gl_sbd, !atomic_read(&gl->gl_ail_count));
	if (flags & DIO_METADATA) {
		struct address_space *mapping = gl->gl_aspace->i_mapping;
		truncate_inode_pages(mapping, 0);
		if (ip) {
			set_bit(GIF_INVALID, &ip->i_flags);
			forget_all_cached_acls(&ip->i_inode);
		}
	}
	if (ip == GFS2_I(gl->gl_sbd->sd_rindex))
		gl->gl_sbd->sd_rindex_uptodate = 0;
	if (ip && S_ISREG(ip->i_inode.i_mode))
		truncate_inode_pages(ip->i_inode.i_mapping, 0);
}