diff options
author | Venkatesh Srinivas <extrudedaluminiu@gmail.com> | 2009-08-23 17:35:22 -0400 |
---|---|---|
committer | Venkatesh Srinivas <extrudedaluminiu@gmail.com> | 2009-08-23 17:35:22 -0400 |
commit | bf930686861b74414bc6abb8a0455605d32743d7 (patch) | |
tree | 92d91a5e2d4c6da2e3c9c23c7133252b0d6cc580 /src/cmd/venti | |
parent | e066b12927b496c9f3b442a5928bacfb48e6334e (diff) | |
download | plan9port-bf930686861b74414bc6abb8a0455605d32743d7.tar.gz plan9port-bf930686861b74414bc6abb8a0455605d32743d7.tar.bz2 plan9port-bf930686861b74414bc6abb8a0455605d32743d7.zip |
venti: handle FS block size > MaxIo
http://codereview.appspot.com/110071
Diffstat (limited to 'src/cmd/venti')
-rw-r--r-- | src/cmd/venti/srv/part.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/venti/srv/part.c b/src/cmd/venti/srv/part.c index 98439b32..ae044814 100644 --- a/src/cmd/venti/srv/part.c +++ b/src/cmd/venti/srv/part.c @@ -94,6 +94,8 @@ parsepart(char *name, char **file, char **subpart, u64int *lo, u64int *hi) return 0; } +#undef min +#define min(a, b) ((a) < (b) ? (a) : (b)) Part* initpart(char *name, int mode) { @@ -166,6 +168,9 @@ initpart(char *name, int mode) part->fsblocksize = sfs.f_bsize; } #endif + + part->fsblocksize = min(part->fsblocksize, MaxIo); + if(subname && findsubpart(part, subname) < 0){ werrstr("cannot find subpartition %s", subname); 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, * we work one block at a time. */ -#undef min -#define min(a, b) ((a) < (b) ? (a) : (b)) int prwb(char *name, int fd, int isread, u64int offset, void *vbuf, u32int count, u32int blocksize) { |