Changeset View
Changeset View
Standalone View
Standalone View
sys/netsmb/smb_trantcp.c
Show First 20 Lines • Show All 540 Lines • ▼ Show 20 Lines | if (snb == NULL) | ||||
return ENOMEM; | return ENOMEM; | ||||
nbp->nbp_paddr = snb; | nbp->nbp_paddr = snb; | ||||
sin = snb->snb_addrin; | sin = snb->snb_addrin; | ||||
getnanotime(&ts1); | getnanotime(&ts1); | ||||
error = nb_connect_in(nbp, &sin, td); | error = nb_connect_in(nbp, &sin, td); | ||||
if (error) | if (error) | ||||
return error; | return error; | ||||
getnanotime(&ts2); | getnanotime(&ts2); | ||||
timespecsub(&ts2, &ts1); | timespecsub(&ts2, &ts1, &ts2); | ||||
if (ts2.tv_sec == 0) { | if (ts2.tv_sec == 0) { | ||||
ts2.tv_sec = 1; | ts2.tv_sec = 1; | ||||
ts2.tv_nsec = 0; | ts2.tv_nsec = 0; | ||||
} | } | ||||
nbp->nbp_timo = ts2; | timespecadd(&ts2, &ts2, &nbp->nbp_timo); | ||||
timespecadd(&nbp->nbp_timo, &ts2); | timespecadd(&nbp->nbp_timo, &ts2, &nbp->nbp_timo); | ||||
timespecadd(&nbp->nbp_timo, &ts2); | timespecadd(&nbp->nbp_timo, &ts2, &nbp->nbp_timo); /* * 4 */ | ||||
jilles: The last two calls could be replaced by one call `timespecadd(&nbp->nbp_timo, &nbp->nbp_timo… | |||||
timespecadd(&nbp->nbp_timo, &ts2); /* * 4 */ | |||||
error = nbssn_rq_request(nbp, td); | error = nbssn_rq_request(nbp, td); | ||||
if (error) | if (error) | ||||
smb_nbst_disconnect(vcp, td); | smb_nbst_disconnect(vcp, td); | ||||
return error; | return error; | ||||
} | } | ||||
static int | static int | ||||
smb_nbst_disconnect(struct smb_vc *vcp, struct thread *td) | smb_nbst_disconnect(struct smb_vc *vcp, struct thread *td) | ||||
▲ Show 20 Lines • Show All 131 Lines • Show Last 20 Lines |
The last two calls could be replaced by one call timespecadd(&nbp->nbp_timo, &nbp->nbp_timo, &nbp->nbp_timo);