/* Find the thread state structure for the current thread.  */
struct gru_thread_state* gru_find_thread_state(struct vm_area_struct *vma, int tsid)
/* Find the thread state structure for the current thread.  */
struct gru_thread_state* gru_find_thread_state(struct vm_area_struct *vma, int tsid)
{
	struct gru_vma_data *vdata = vma->vm_private_data;
	struct gru_thread_state *gts;
	spin_lock(&vdata->vd_lock);
	gts = gru_find_current_gts_nolock(vdata, tsid);
	spin_unlock(&vdata->vd_lock);
	gru_dbg(grudev, "vma %p, gts %p\n", vma, gts);
	return gts;
}