Rev 3530 | Rev 3533 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3530 | Rev 3532 | ||
---|---|---|---|
Line 536... | Line 536... | ||
536 | /* |
536 | /* |
537 | * Our strategy for regular file reads is to read one block at |
537 | * Our strategy for regular file reads is to read one block at |
538 | * most and make use of the possibility to return less data than |
538 | * most and make use of the possibility to return less data than |
539 | * requested. This keeps the code very simple. |
539 | * requested. This keeps the code very simple. |
540 | */ |
540 | */ |
- | 541 | if (pos >= nodep->size) { |
|
- | 542 | bytes = 0; /* reading beyond the EOF */ |
|
- | 543 | (void) ipc_data_read_finalize(callid, NULL, 0); |
|
- | 544 | } else { |
|
541 | bytes = min(len, bps - pos % bps); |
545 | bytes = min(len, bps - pos % bps); |
- | 546 | bytes = min(bytes, nodep->size - pos); |
|
542 | b = fat_block_get(bs, nodep, pos / bps); |
547 | b = fat_block_get(bs, nodep, pos / bps); |
543 | (void) ipc_data_read_finalize(callid, b->data + pos % bps, |
548 | (void) ipc_data_read_finalize(callid, b->data + pos % bps, |
544 | bytes); |
549 | bytes); |
545 | block_put(b); |
550 | block_put(b); |
- | 551 | } |
|
546 | } else { |
552 | } else { |
547 | unsigned bnum; |
553 | unsigned bnum; |
548 | off_t spos = pos; |
554 | off_t spos = pos; |
549 | char name[FAT_NAME_LEN + 1 + FAT_EXT_LEN + 1]; |
555 | char name[FAT_NAME_LEN + 1 + FAT_EXT_LEN + 1]; |
550 | fat_dentry_t *d; |
556 | fat_dentry_t *d; |