comparison src/fs.c @ 31:96a5833d0d82

fix
author mir3636
date Fri, 18 Jan 2019 18:20:02 +0900
parents 1a64b5645cdd
children 96af12a50fdb
comparison
equal deleted inserted replaced
30:6a7ab1d7001c 31:96a5833d0d82
451 st->type = ip->type; 451 st->type = ip->type;
452 st->nlink = ip->nlink; 452 st->nlink = ip->nlink;
453 st->size = ip->size; 453 st->size = ip->size;
454 } 454 }
455 455
456 __code cbc_readi (struct inode *ip, char *dst, uint off, uint n, __code (*next)(int ret)) 456 __code cbc_readi (struct inode *ip, char *dst, uint off, uint n, struct file *f, __code (*next)(int ret))
457 { 457 {
458 uint tot, m; 458 uint tot, m;
459 struct buf *bp; 459 struct buf *bp;
460 460
461 if (ip->type == T_DEV) { 461 if (ip->type == T_DEV) {
462 if (ip->major < 0 || ip->major >= NDEV || !cbc_devsw[ip->major].read) { 462 if (ip->major < 0 || ip->major >= NDEV || !cbc_devsw[ip->major].read) {
463 goto next(-1); 463 goto next(-1);
464 } 464 }
465 465
466 goto cbc_devsw[ip->major].read(ip, dst, n, next); 466 goto cbc_devsw[ip->major].read(ip, dst, n, f, next);
467 } 467 }
468 468
469 if (off > ip->size || off + n < off) { 469 if (off > ip->size || off + n < off) {
470 goto next(-1); 470 goto next(-1);
471 } 471 }