From 384d4f62159443e7ef6a96bc954c7df968524430 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Tue, 23 Jun 2009 20:26:33 +0300 Subject: [PATCH] --- yaml --- r: 155295 b: refs/heads/master c: 2a35a3a8ab3e94afd631ed4b45878ceb98f7ab28 h: refs/heads/master i: 155293: aebd48a7fe2bfde7b304b1784faeaa76e59ed41f 155291: 8b427cb56763fd37750bdf3ad198be5eae5c74cc 155287: 826b790247cc983e7dd1fa6689551bbc99bb2db9 155279: 2a5118c904236a0f2da2d134e0a415c19ae85d32 155263: 3da52288f5954d79c4d4329cfb7c40b2d05f9ec0 v: v3 --- [refs] | 2 +- trunk/fs/ubifs/io.c | 17 ++++------------- trunk/fs/ubifs/ubifs.h | 5 +++-- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index 91f8c11e7738..cc9464aa5cc7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0b335b9d7d5f0b832e90ac469480789c07be80ad +refs/heads/master: 2a35a3a8ab3e94afd631ed4b45878ceb98f7ab28 diff --git a/trunk/fs/ubifs/io.c b/trunk/fs/ubifs/io.c index 9fcf6c38c1bc..48d0af94b26a 100644 --- a/trunk/fs/ubifs/io.c +++ b/trunk/fs/ubifs/io.c @@ -828,7 +828,6 @@ int ubifs_read_node(const struct ubifs_info *c, void *buf, int type, int len, int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf) { size_t size; - ktime_t hardlimit; wbuf->buf = kmalloc(c->min_io_size, GFP_KERNEL); if (!wbuf->buf) @@ -854,18 +853,10 @@ int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf) hrtimer_init(&wbuf->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); wbuf->timer.function = wbuf_timer_callback_nolock; - /* - * Make write-buffer soft limit to be 20% of the hard limit. The - * write-buffer timer is allowed to expire any time between the soft - * and hard limits. - */ - hardlimit = ktime_set(DEFAULT_WBUF_TIMEOUT_SECS, 0); - wbuf->delta = DEFAULT_WBUF_TIMEOUT_SECS * 1000000000ULL * 2 / 10; - if (wbuf->delta > ULONG_MAX) - wbuf->delta = ULONG_MAX; - wbuf->softlimit = ktime_sub_ns(hardlimit, wbuf->delta); - hrtimer_set_expires_range_ns(&wbuf->timer, wbuf->softlimit, - wbuf->delta); + wbuf->softlimit = ktime_set(WBUF_TIMEOUT_SOFTLIMIT, 0); + wbuf->delta = WBUF_TIMEOUT_HARDLIMIT - WBUF_TIMEOUT_SOFTLIMIT; + wbuf->delta *= 1000000000ULL; + ubifs_assert(wbuf->delta <= ULONG_MAX); return 0; } diff --git a/trunk/fs/ubifs/ubifs.h b/trunk/fs/ubifs/ubifs.h index 97bc9d09d54b..c3a707d458a1 100644 --- a/trunk/fs/ubifs/ubifs.h +++ b/trunk/fs/ubifs/ubifs.h @@ -95,8 +95,9 @@ */ #define BGT_NAME_PATTERN "ubifs_bgt%d_%d" -/* Default write-buffer synchronization timeout in seconds */ -#define DEFAULT_WBUF_TIMEOUT_SECS 5 +/* Write-buffer synchronization timeout interval in seconds */ +#define WBUF_TIMEOUT_SOFTLIMIT 3 +#define WBUF_TIMEOUT_HARDLIMIT 5 /* Maximum possible inode number (only 32-bit inodes are supported now) */ #define MAX_INUM 0xFFFFFFFF