Fsproto()

Fsproto()

概要

実装

 1207: int
 1208: Fsproto(Fs *f, Proto *p)
 1209: {
 1210:         if(f->np >= Maxproto)
 1211:                 return -1;
 1212: 
 1213:         p->f = f;
 1214: 
 1215:         if(p->ipproto > 0){
 1216:                 if(f->t2p[p->ipproto] != nil)
 1217:                         return -1;
 1218:                 f->t2p[p->ipproto] = p;
 1219:         }
 1220: 
 1221:         p->qid.type = QTDIR;
 1222:         p->qid.path = QID(f->np, 0, Qprotodir);
 1223:         p->conv = malloc(sizeof(Conv*)*(p->nc+1));
 1224:         if(p->conv == nil)
 1225:                 panic("Fsproto");
 1226: 
 1227:         p->x = f->np;
 1228:         p->nextport = 0;
 1229:         p->nextrport = 600;
 1230:         f->p[f->np++] = p;
 1231: 
 1232:         return 0;
 1233: }