mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
venti: handle FS block size > MaxIo
http://codereview.appspot.com/110071
This commit is contained in:
parent
e066b12927
commit
bf93068686
1 changed files with 5 additions and 2 deletions
|
@ -94,6 +94,8 @@ parsepart(char *name, char **file, char **subpart, u64int *lo, u64int *hi)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef min
|
||||||
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||||
Part*
|
Part*
|
||||||
initpart(char *name, int mode)
|
initpart(char *name, int mode)
|
||||||
{
|
{
|
||||||
|
@ -166,6 +168,9 @@ initpart(char *name, int mode)
|
||||||
part->fsblocksize = sfs.f_bsize;
|
part->fsblocksize = sfs.f_bsize;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
part->fsblocksize = min(part->fsblocksize, MaxIo);
|
||||||
|
|
||||||
if(subname && findsubpart(part, subname) < 0){
|
if(subname && findsubpart(part, subname) < 0){
|
||||||
werrstr("cannot find subpartition %s", subname);
|
werrstr("cannot find subpartition %s", subname);
|
||||||
freepart(part);
|
freepart(part);
|
||||||
|
@ -224,8 +229,6 @@ partblocksize(Part *part, u32int blocksize)
|
||||||
* body of the loop: up to MaxIo bytes at a time. If everything isn't aligned properly,
|
* body of the loop: up to MaxIo bytes at a time. If everything isn't aligned properly,
|
||||||
* we work one block at a time.
|
* we work one block at a time.
|
||||||
*/
|
*/
|
||||||
#undef min
|
|
||||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
|
||||||
int
|
int
|
||||||
prwb(char *name, int fd, int isread, u64int offset, void *vbuf, u32int count, u32int blocksize)
|
prwb(char *name, int fd, int isread, u64int offset, void *vbuf, u32int count, u32int blocksize)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue