Remove trailing white space with:
for f in *.{h,c}; do sed -i .sed 's/[[:blank:]]*$//' $f; done
(Thanks to Nicolás Wolovick)
This commit is contained in:
parent
6de6a3c952
commit
7894fcd217
32 changed files with 116 additions and 116 deletions
14
log.c
14
log.c
|
|
@ -31,7 +31,7 @@
|
|||
// Contents of the header block, used for both the on-disk header block
|
||||
// and to keep track in memory of logged block# before commit.
|
||||
struct logheader {
|
||||
int n;
|
||||
int n;
|
||||
int block[LOGSIZE];
|
||||
};
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ initlog(int dev)
|
|||
}
|
||||
|
||||
// Copy committed blocks from log to their home location
|
||||
static void
|
||||
static void
|
||||
install_trans(void)
|
||||
{
|
||||
int tail;
|
||||
|
|
@ -75,7 +75,7 @@ install_trans(void)
|
|||
struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
|
||||
memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst
|
||||
bwrite(dbuf); // write dst to disk
|
||||
brelse(lbuf);
|
||||
brelse(lbuf);
|
||||
brelse(dbuf);
|
||||
}
|
||||
}
|
||||
|
|
@ -114,7 +114,7 @@ write_head(void)
|
|||
static void
|
||||
recover_from_log(void)
|
||||
{
|
||||
read_head();
|
||||
read_head();
|
||||
install_trans(); // if committed, copy from log to disk
|
||||
log.lh.n = 0;
|
||||
write_head(); // clear the log
|
||||
|
|
@ -171,7 +171,7 @@ end_op(void)
|
|||
}
|
||||
|
||||
// Copy modified blocks from cache to log.
|
||||
static void
|
||||
static void
|
||||
write_log(void)
|
||||
{
|
||||
int tail;
|
||||
|
|
@ -181,7 +181,7 @@ write_log(void)
|
|||
struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
|
||||
memmove(to->data, from->data, BSIZE);
|
||||
bwrite(to); // write the log
|
||||
brelse(from);
|
||||
brelse(from);
|
||||
brelse(to);
|
||||
}
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ commit()
|
|||
write_log(); // Write modified blocks from cache to log
|
||||
write_head(); // Write header to disk -- the real commit
|
||||
install_trans(); // Now install writes to home locations
|
||||
log.lh.n = 0;
|
||||
log.lh.n = 0;
|
||||
write_head(); // Erase the transaction from the log
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue