diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2007-11-07 17:40:36 -0500 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2008-01-25 18:05:42 -0500 |
commit | d147b3d630edef1d34de6ea819787a1ac1b8603b (patch) | |
tree | bd417b27fd58fa3c44be6b8451d929f848981ffd /fs/ocfs2/journal.c | |
parent | 0957f00796157564281ea6ff2cea7ef4f897775a (diff) |
ocfs2: Support commit= mount option
Mostly taken from ext3. This allows the user to set the jbd commit interval,
in seconds. The default of 5 seconds stays the same, but now users can
easily increase the commit interval. Typically, this would be increased in
order to benefit performance at the expense of data-safety.
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/journal.c')
-rw-r--r-- | fs/ocfs2/journal.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 4f440a88bf53..8b9ce2a729ab 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -313,14 +313,18 @@ int ocfs2_journal_dirty_data(handle_t *handle, | |||
313 | return err; | 313 | return err; |
314 | } | 314 | } |
315 | 315 | ||
316 | #define OCFS2_DEFAULT_COMMIT_INTERVAL (HZ * 5) | 316 | #define OCFS2_DEFAULT_COMMIT_INTERVAL (HZ * JBD_DEFAULT_MAX_COMMIT_AGE) |
317 | 317 | ||
318 | void ocfs2_set_journal_params(struct ocfs2_super *osb) | 318 | void ocfs2_set_journal_params(struct ocfs2_super *osb) |
319 | { | 319 | { |
320 | journal_t *journal = osb->journal->j_journal; | 320 | journal_t *journal = osb->journal->j_journal; |
321 | unsigned long commit_interval = OCFS2_DEFAULT_COMMIT_INTERVAL; | ||
322 | |||
323 | if (osb->osb_commit_interval) | ||
324 | commit_interval = osb->osb_commit_interval; | ||
321 | 325 | ||
322 | spin_lock(&journal->j_state_lock); | 326 | spin_lock(&journal->j_state_lock); |
323 | journal->j_commit_interval = OCFS2_DEFAULT_COMMIT_INTERVAL; | 327 | journal->j_commit_interval = commit_interval; |
324 | if (osb->s_mount_opt & OCFS2_MOUNT_BARRIER) | 328 | if (osb->s_mount_opt & OCFS2_MOUNT_BARRIER) |
325 | journal->j_flags |= JFS_BARRIER; | 329 | journal->j_flags |= JFS_BARRIER; |
326 | else | 330 | else |