static ssize_t ub_diag_show(struct device *dev, char *page) 
static ssize_t ub_diag_show(struct device *dev, struct device_attribute *attr, char *page) 
static ssize_t ub_diag_show(struct device *dev, char *page){	struct usb_interface *intf;	struct ub_dev *sc;	struct list_head *p;	struct ub_lun *lun;	int cnt;	unsigned long flags;	int nc, nh;	int i, j;	struct ub_scsi_cmd_trace *t;	intf = to_usb_interface(dev);	sc = usb_get_intfdata(intf);	if (sc == NULL)		return 0;	cnt = 0;	spin_lock_irqsave(&sc->lock, flags);	cnt += sprintf(page + cnt,	    "qlen %d qmax %d\n",	    sc->cmd_queue.qlen, sc->cmd_queue.qmax);	list_for_each (p, &sc->luns) {		lun = list_entry(p, struct ub_lun, link);		cnt += sprintf(page + cnt,		    "lun %u changed %d removable %d readonly %d\n",		    lun->num, lun->changed, lun->removable, lun->readonly);	}	if ((nc = sc->tr.cur + 1) == SCMD_TRACE_SZ) nc = 0;	for (j = 0; j < SCMD_TRACE_SZ; j++) {		t = &sc->tr.vec[nc];		cnt += sprintf(page + cnt, "%08x %02x", t->tag, t->op);		if (t->op == REQUEST_SENSE) {			cnt += sprintf(page + cnt, " [sense %x %02x %02x]",					t->key, t->asc, t->ascq);		} else {			cnt += sprintf(page + cnt, " %c", UB_DIR_CHAR(t->dir));			cnt += sprintf(page + cnt, " [%5d %5d]",					t->req_size, t->act_size);		}		if ((nh = t->hcur + 1) == SCMD_ST_HIST_SZ) nh = 0;		for (i = 0; i < SCMD_ST_HIST_SZ; i++) {			cnt += sprintf(page + cnt, " %s",					ub_scsi_cmd_stname[(int)t->st_hst[nh]]);			if (++nh == SCMD_ST_HIST_SZ) nh = 0;		}		cnt += sprintf(page + cnt, "\n");		if (++nc == SCMD_TRACE_SZ) nc = 0;	}	spin_unlock_irqrestore(&sc->lock, flags);	return cnt;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/74880c063b06efd103c924abfe19d9d8fa4864c4/ub.c/clean/drivers/block/ub.c