tacme: add comment for aligned writes - plan9port - [fork] Plan 9 from user spa… | |
git clone git://src.adamsgaard.dk/plan9port | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 833216fef8b946895956737d205bcad7031bf06f | |
parent 1d2c3c3945a229f896640b615b84f3d9a78e8b5a | |
Author: Russ Cox <[email protected]> | |
Date: Sat, 19 Apr 2014 13:44:06 -0400 | |
acme: add comment for aligned writes | |
TBR=r | |
https://codereview.appspot.com/89510044 | |
Diffstat: | |
M src/cmd/acme/exec.c | 5 +++++ | |
1 file changed, 5 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c | |
t@@ -662,6 +662,11 @@ putfile(File *f, int q0, int q1, Rune *namer, int nname) | |
warning(nil, "can't create file %s: %r\n", name); | |
goto Rescue1; | |
} | |
+ // Use bio in order to force the writes to be large and | |
+ // block-aligned (bio's default is 8K). This is not strictly | |
+ // necessary; it works around some buggy underlying | |
+ // file systems that mishandle unaligned writes. | |
+ // https://codereview.appspot.com/89550043/ | |
b = emalloc(sizeof *b); | |
Binit(b, fd, OWRITE); | |
r = fbufalloc(); |