diff options
Diffstat (limited to 'ext2fs')
-rw-r--r-- | ext2fs/pokel.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/ext2fs/pokel.c b/ext2fs/pokel.c index 88fa57da..a6d1c65a 100644 --- a/ext2fs/pokel.c +++ b/ext2fs/pokel.c @@ -82,9 +82,10 @@ pokel_add (struct pokel *pokel, void *loc, vm_size_t length) spin_unlock (&pokel->lock); } -/* Sync all the modified pieces of disk */ +/* Move all pending pokes from POKEL into its free list. If SYNC is true, + otherwise do nothing. */ void -pokel_sync (struct pokel *pokel, int wait) +_pokel_exec (struct pokel *pokel, int sync, int wait) { struct poke *pl, *pokes, *last = NULL; @@ -94,10 +95,11 @@ pokel_sync (struct pokel *pokel, int wait) spin_unlock (&pokel->lock); for (pl = pokes; pl; last = pl, pl = pl->next) - { - ext2_debug ("syncing 0x%x[%ul]", pl->offset, pl->length); - pager_sync_some (pokel->pager, pl->offset, pl->length, wait); - } + if (sync) + { + ext2_debug ("syncing 0x%x[%ul]", pl->offset, pl->length); + pager_sync_some (pokel->pager, pl->offset, pl->length, wait); + } if (last) { @@ -107,3 +109,17 @@ pokel_sync (struct pokel *pokel, int wait) spin_unlock (&pokel->lock); } } + +/* Sync all the modified pieces of disk */ +void +pokel_sync (struct pokel *pokel, int wait) +{ + _pokel_exec (pokel, 1, wait); +} + +/* Flush (that is, drop on the ground) all pending pokes in POKEL. */ +void +pokel_flush (struct pokel *pokel) +{ + _pokel_exec (pokel, 0, 0); +} |