diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-06-23 12:30:43 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-07-05 18:45:16 +0300 |
commit | 0b335b9d7d5f0b832e90ac469480789c07be80ad (patch) | |
tree | 5001522f18092e1cafb538a74eedae3087c17145 /fs/ubifs/super.c | |
parent | 70aee2f153972f70fad5f7025134fec063f9efbe (diff) | |
download | linux-0b335b9d7d5f0b832e90ac469480789c07be80ad.tar.gz linux-0b335b9d7d5f0b832e90ac469480789c07be80ad.tar.bz2 linux-0b335b9d7d5f0b832e90ac469480789c07be80ad.zip |
UBIFS: slightly optimize write-buffer timer usage
This patch adds the following minor optimization:
1. If write-buffer does not use the timer, indicate it with the
wbuf->no_timer variable, instead of using the wbuf->softlimit
variable. This is better because wbuf->softlimit is of ktime_t
type, and the ktime_to_ns function contains 64-bit multiplication.
2. Do not call the 'hrtimer_cancel()' function for write-buffers
which do not use timers.
3. Do not cancel the timer in 'ubifs_put_super()' because the
synchronization function does this.
This patch also removes a confusing comment.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/super.c')
-rw-r--r-- | fs/ubifs/super.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 79fad43f3c57..5bb272c56a9b 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c @@ -797,7 +797,7 @@ static int alloc_wbufs(struct ubifs_info *c) * does not need to be synchronized by timer. */ c->jheads[GCHD].wbuf.dtype = UBI_LONGTERM; - c->jheads[GCHD].wbuf.softlimit = ktime_set(0, 0); + c->jheads[GCHD].wbuf.no_timer = 1; return 0; } @@ -1754,10 +1754,8 @@ static void ubifs_put_super(struct super_block *sb) /* Synchronize write-buffers */ if (c->jheads) - for (i = 0; i < c->jhead_cnt; i++) { + for (i = 0; i < c->jhead_cnt; i++) ubifs_wbuf_sync(&c->jheads[i].wbuf); - hrtimer_cancel(&c->jheads[i].wbuf.timer); - } /* * On fatal errors c->ro_media is set to 1, in which case we do |