Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155294
b: refs/heads/master
c: 0b335b9
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jul 5, 2009
1 parent aebd48a commit ce06486
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 70aee2f153972f70fad5f7025134fec063f9efbe
refs/heads/master: 0b335b9d7d5f0b832e90ac469480789c07be80ad
9 changes: 3 additions & 6 deletions trunk/fs/ubifs/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static void new_wbuf_timer_nolock(struct ubifs_wbuf *wbuf)
{
ubifs_assert(!hrtimer_active(&wbuf->timer));

if (!ktime_to_ns(wbuf->softlimit))
if (wbuf->no_timer)
return;
dbg_io("set timer for jhead %d, %llu-%llu millisecs", wbuf->jhead,
ktime_to_ns(wbuf->softlimit)/USEC_PER_SEC,
Expand All @@ -327,11 +327,8 @@ static void new_wbuf_timer_nolock(struct ubifs_wbuf *wbuf)
*/
static void cancel_wbuf_timer_nolock(struct ubifs_wbuf *wbuf)
{
/*
* If the syncer is waiting for the lock (from the background thread's
* context) and another task is changing write-buffer then the syncing
* should be canceled.
*/
if (wbuf->no_timer)
return;
wbuf->need_sync = 0;
hrtimer_cancel(&wbuf->timer);
}
Expand Down
6 changes: 2 additions & 4 deletions trunk/fs/ubifs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions trunk/fs/ubifs/ubifs.h
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,8 @@ typedef int (*ubifs_lpt_scan_callback)(struct ubifs_info *c,
* @delta: hard and soft timeouts delta (the timer expire inteval is @softlimit
* and @softlimit + @delta)
* @timer: write-buffer timer
* @need_sync: it is set if its timer expired and needs sync
* @no_timer: non-zero if this write-buffer does not timer
* @need_sync: non-zero if its timer expired and needs sync
* @next_ino: points to the next position of the following inode number
* @inodes: stores the inode numbers of the nodes which are in wbuf
*
Expand Down Expand Up @@ -683,7 +684,8 @@ struct ubifs_wbuf {
ktime_t softlimit;
unsigned long long delta;
struct hrtimer timer;
int need_sync;
unsigned int no_timer:1;
unsigned int need_sync:1;
int next_ino;
ino_t *inodes;
};
Expand Down

0 comments on commit ce06486

Please sign in to comment.