Unified · Split
| @@ -40,7 +40,7 @@ struct Ufsinfo · 39 unmodified lines | ||
| 40 | 40 | |
| 41 | 41 | char *base = "/"; |
| 42 | 42 | |
| 43 | −static Qid fsqid(char*, struct stat *); | |
| 43 | +static Qid fsqid(struct stat *); | |
| 44 | 44 | static void fspath(Chan*, char*, char*); |
| 45 | 45 | static ulong fsdirread(Chan*, uchar*, int, ulong); |
| 46 | 46 | static int fsomode(int); |
| @@ -130,7 +130,7 @@ fswalk1(Chan *c, char *name) · 83 unmodified lines | ||
| 130 | 130 | uif->uid = stbuf.st_uid; |
| 131 | 131 | uif->gid = stbuf.st_gid; |
| 132 | 132 | |
| 133 | − c->qid = fsqid(path, &stbuf); | |
| 133 | + c->qid = fsqid(&stbuf); | |
| 134 | 134 | |
| 135 | 135 | return 1; |
| 136 | 136 | } |
| @@ -302,7 +302,7 @@ fscreate(Chan *c, char *name, int mode, ulong perm) · 165 unmodified lines | ||
| 302 | 302 | |
| 303 | 303 | if(stat(path, &stbuf) < 0) |
| 304 | 304 | error(strerror(errno)); |
| 305 | − c->qid = fsqid(path, &stbuf); | |
| 305 | + c->qid = fsqid(&stbuf); | |
| 306 | 306 | c->offset = 0; |
| 307 | 307 | c->flag |= COPEN; |
| 308 | 308 | c->mode = openmode(mode); |
| @@ -458,31 +458,15 @@ fswstat(Chan *c, uchar *buf, int n) · 149 unmodified lines | ||
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | static Qid |
| 461 | −fsqid(char *p, struct stat *st) | |
| 461 | +fsqid(struct stat *st) | |
| 462 | 462 | { |
| 463 | 463 | Qid q; |
| 464 | − int dev; | |
| 465 | − ulong h; | |
| 466 | − static int nqdev; | |
| 467 | − static uchar *qdev; | |
| 468 | − | |
| 469 | − if(qdev == 0) | |
| 470 | − qdev = mallocz(65536U, 1); | |
| 471 | 464 | |
| 472 | 465 | q.type = 0; |
| 473 | 466 | if((st->st_mode&S_IFMT) == S_IFDIR) |
| 474 | 467 | q.type = QTDIR; |
| 475 | 468 | |
| 476 | − dev = st->st_dev & 0xFFFFUL; | |
| 477 | − if(qdev[dev] == 0) | |
| 478 | − qdev[dev] = ++nqdev; | |
| 479 | − | |
| 480 | − h = 0; | |
| 481 | − while(*p != '\0') | |
| 482 | − h += *p++ * 13; | |
| 483 | − | |
| 484 | − q.path = (vlong)qdev[dev]<<32; | |
| 485 | − q.path |= h; | |
| 469 | + q.path = (uvlong)st->st_dev<<32 | st->st_ino; | |
| 486 | 470 | q.vers = st->st_mtime; |
| 487 | 471 | |
| 488 | 472 | return q; |
| @@ -579,7 +563,7 @@ fsdirread(Chan *c, uchar *va, int count, ulong offset) · 90 unmodified lines | ||
| 579 | 563 | d.uid = "unknown"; |
| 580 | 564 | d.gid = "unknown"; |
| 581 | 565 | d.muid = "unknown"; |
| 582 | − d.qid = fsqid(path, &stbuf); | |
| 566 | + d.qid = fsqid(&stbuf); | |
| 583 | 567 | d.mode = (d.qid.type<<24)|(stbuf.st_mode&0777); |
| 584 | 568 | d.atime = stbuf.st_atime; |
| 585 | 569 | d.mtime = stbuf.st_mtime; |