aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/io.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-06-23 13:26:33 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-07-05 11:45:17 -0400
commit2a35a3a8ab3e94afd631ed4b45878ceb98f7ab28 (patch)
treeff0c5dc8b420bfa4e4cf160b11e7d2902b7aed76 /fs/ubifs/io.c
parent0b335b9d7d5f0b832e90ac469480789c07be80ad (diff)
UBIFS: set write-buffer timout to 3-5 seconds
This patch cleans up write-buffer timeout initialization and sets it to 3-5 interval. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/io.c')
-rw-r--r--fs/ubifs/io.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c
index 9fcf6c38c1bc..48d0af94b26a 100644
--- a/fs/ubifs/io.c
+++ b/fs/ubifs/io.c
@@ -828,7 +828,6 @@ out:
828int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf) 828int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf)
829{ 829{
830 size_t size; 830 size_t size;
831 ktime_t hardlimit;
832 831
833 wbuf->buf = kmalloc(c->min_io_size, GFP_KERNEL); 832 wbuf->buf = kmalloc(c->min_io_size, GFP_KERNEL);
834 if (!wbuf->buf) 833 if (!wbuf->buf)
@@ -854,18 +853,10 @@ int ubifs_wbuf_init(struct ubifs_info *c, struct ubifs_wbuf *wbuf)
854 853
855 hrtimer_init(&wbuf->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 854 hrtimer_init(&wbuf->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
856 wbuf->timer.function = wbuf_timer_callback_nolock; 855 wbuf->timer.function = wbuf_timer_callback_nolock;
857 /* 856 wbuf->softlimit = ktime_set(WBUF_TIMEOUT_SOFTLIMIT, 0);
858 * Make write-buffer soft limit to be 20% of the hard limit. The 857 wbuf->delta = WBUF_TIMEOUT_HARDLIMIT - WBUF_TIMEOUT_SOFTLIMIT;
859 * write-buffer timer is allowed to expire any time between the soft 858 wbuf->delta *= 1000000000ULL;
860 * and hard limits. 859 ubifs_assert(wbuf->delta <= ULONG_MAX);
861 */
862 hardlimit = ktime_set(DEFAULT_WBUF_TIMEOUT_SECS, 0);
863 wbuf->delta = DEFAULT_WBUF_TIMEOUT_SECS * 1000000000ULL * 2 / 10;
864 if (wbuf->delta > ULONG_MAX)
865 wbuf->delta = ULONG_MAX;
866 wbuf->softlimit = ktime_sub_ns(hardlimit, wbuf->delta);
867 hrtimer_set_expires_range_ns(&wbuf->timer, wbuf->softlimit,
868 wbuf->delta);
869 return 0; 860 return 0;
870} 861}
871 862