From 7894fcd21732dd2ddfbb9beca52d037a62ed11f4 Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Thu, 25 Aug 2016 09:13:00 -0400 Subject: =?UTF-8?q?Remove=20trailing=20white=20space=20with:=20=20for=20f?= =?UTF-8?q?=20in=20*.{h,c};=20do=20sed=20-i=20.sed=20's/[[:blank:]]*$//'?= =?UTF-8?q?=20$f;=20done=20(Thanks=20to=20Nicol=C3=A1s=20Wolovick)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- log.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'log.c') diff --git a/log.c b/log.c index 12db8ca..a2f1b57 100644 --- a/log.c +++ b/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 } } -- cgit v1.2.3