[Ocfs2-tools-devel]
[PATCH 3/7] Add io_cache in tunefs.ocfs2, take 3
Tao Ma
tao.ma at oracle.com
Sun Nov 4 23:42:35 PST 2007
We use io_cache in tunefs when the cluster is locked or
the volume is mount-local.
Signed-off-by: Tao Ma <tao.ma at oracle.com>
---
tunefs.ocfs2/tunefs.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/tunefs.ocfs2/tunefs.c b/tunefs.ocfs2/tunefs.c
index ed0a18f..5e8dff9 100644
--- a/tunefs.ocfs2/tunefs.c
+++ b/tunefs.ocfs2/tunefs.c
@@ -1370,6 +1370,14 @@ int main(int argc, char **argv)
block_signals(SIG_UNBLOCK);
}
+ /*
+ * We will use block cache in io. Now whether the cluster is locked or
+ * the volume is mount local, in both situation we can safely use cache.
+ * If io_init_cache failed, we will go on the tunefs work without
+ * the io_cache, so there is no check here.
+ */
+ io_init_cache(fs->fs_io, ocfs2_extent_recs_per_eb(fs->fs_blocksize));
+
ret = journal_check(fs, &dirty, &def_jrnl_size);
if (ret || dirty)
goto unlock;
@@ -1664,6 +1672,7 @@ unlock:
block_signals(SIG_UNBLOCK);
close:
+ io_destroy_cache(fs->fs_io);
block_signals(SIG_BLOCK);
if (fs && fs->fs_dlm_ctxt)
ocfs2_shutdown_dlm(fs);
--
1.5.3.2.g4f337
More information about the Ocfs2-tools-devel
mailing list