log write() data
usertest for big write()s push begin_trans/commit_trans down into syscalls
This commit is contained in:
parent
bd71a45046
commit
2e59046362
7 changed files with 143 additions and 43 deletions
4
fs.c
4
fs.c
|
@ -437,13 +437,13 @@ writei(struct inode *ip, char *src, uint off, uint n)
|
|||
if(off > ip->size || off + n < off)
|
||||
return -1;
|
||||
if(off + n > MAXFILE*BSIZE)
|
||||
n = MAXFILE*BSIZE - off;
|
||||
return -1;
|
||||
|
||||
for(tot=0; tot<n; tot+=m, off+=m, src+=m){
|
||||
bp = bread(ip->dev, bmap(ip, off/BSIZE));
|
||||
m = min(n - tot, BSIZE - off%BSIZE);
|
||||
memmove(bp->data + off%BSIZE, src, m);
|
||||
bwrite(bp);
|
||||
log_write(bp);
|
||||
brelse(bp);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue