diff -urNp x-ref/fs/buffer.c x/fs/buffer.c --- x-ref/fs/buffer.c Mon Oct 7 02:59:46 2002 +++ x/fs/buffer.c Mon Oct 7 02:59:50 2002 @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -91,37 +92,11 @@ static void __refile_buffer(struct buffe /* This is used by some architectures to estimate available memory. */ atomic_t buffermem_pages = ATOMIC_INIT(0); -/* Here is the parameter block for the bdflush process. If you add or - * remove any of the parameters, make sure to update kernel/sysctl.c - * and the documentation at linux/Documentation/sysctl/vm.txt. - */ - -#define N_PARAM 9 - -/* The dummy values in this structure are left in there for compatibility - * with old programs that play with the /proc entries. - */ -union bdflush_param { - struct { - int nfract; /* Percentage of buffer cache dirty to - activate bdflush */ - int ndirty; /* Maximum number of dirty blocks to write out per - wake-cycle */ - int dummy2; /* old "nrefill" */ - int dummy3; /* unused */ - int interval; /* jiffies delay between kupdate flushes */ - int age_buffer; /* Time for normal buffer to age before we flush it */ - int nfract_sync;/* Percentage of buffer cache dirty to - activate bdflush synchronously */ - int nfract_stop_bdflush; /* Percetange of buffer cache dirty to stop bdflush */ - int dummy5; /* unused */ - } b_un; - unsigned int data[N_PARAM]; -} bdf_prm = {{50, 500, 0, 0, 5*HZ, 30*HZ, 60, 20, 0}}; +union bdflush_param bdf_prm = {{50, 500, 0, 0, 5*HZ, 30*HZ, 60, 20, 0}}; /* These are the min and max parameter values that we will allow to be assigned */ -int bdflush_min[N_PARAM] = { 0, 1, 0, 0, 0, 1*HZ, 0, 0, 0}; -int bdflush_max[N_PARAM] = {100,50000, 20000, 20000,10000*HZ, 10000*HZ, 100, 100, 0}; +int bdflush_min[BDFLUSH_NR_PARAM] = { 0, 1, 0, 0, 0, 1*HZ, 0, 0, 0}; +int bdflush_max[BDFLUSH_NR_PARAM] = {100,50000, 20000, 20000,10000*HZ, 10000*HZ, 100, 100, 0}; static inline int write_buffer_delay(struct buffer_head *bh) { @@ -2957,7 +2932,7 @@ asmlinkage long sys_bdflush(int func, lo /* Basically func 1 means read param 1, 2 means write param 1, etc */ if (func >= 2) { int i = (func-2) >> 1; - if (i >= 0 && i < N_PARAM) { + if (i >= 0 && i < BDFLUSH_NR_PARAM) { if ((func & 1) == 0) return put_user(bdf_prm.data[i], (int*)data); @@ -3046,7 +3021,7 @@ int kupdate(void *startup) for (;;) { /* update interval */ - interval = bdf_prm.b_un.interval; + interval = bdflush_interval(); if (interval) { tsk->state = TASK_INTERRUPTIBLE; schedule_timeout(interval); diff -urNp x-ref/fs/jbd/journal.c x/fs/jbd/journal.c --- x-ref/fs/jbd/journal.c Fri Oct 4 04:13:43 2002 +++ x/fs/jbd/journal.c Thu Oct 10 04:24:45 2002 @@ -36,6 +36,7 @@ #include #include #include +#include EXPORT_SYMBOL(journal_start); EXPORT_SYMBOL(journal_try_start); @@ -225,7 +226,7 @@ int kjournald(void *arg) wake_up(&journal->j_wait_done_commit); printk(KERN_INFO "kjournald starting. Commit interval %ld seconds\n", - journal->j_commit_interval / HZ); + (journal->j_commit_interval ? : bdflush_interval()) / HZ); list_add(&journal->j_all_journals, &all_journals); /* And now, wait forever for commit wakeup events. */ @@ -706,7 +707,7 @@ static journal_t * journal_init_common ( init_MUTEX(&journal->j_checkpoint_sem); init_MUTEX(&journal->j_sem); - journal->j_commit_interval = (HZ * 5); + journal->j_commit_interval = 0; /* The journal is marked for error until we succeed with recovery! */ journal->j_flags = JFS_ABORT; diff -urNp x-ref/fs/jbd/transaction.c x/fs/jbd/transaction.c --- x-ref/fs/jbd/transaction.c Fri Oct 4 04:13:43 2002 +++ x/fs/jbd/transaction.c Thu Oct 10 04:21:21 2002 @@ -26,6 +26,7 @@ #include #include #include +#include extern spinlock_t journal_datalist_lock; @@ -56,7 +57,7 @@ static transaction_t * get_transaction ( transaction->t_journal = journal; transaction->t_state = T_RUNNING; transaction->t_tid = journal->j_transaction_sequence++; - transaction->t_expires = jiffies + journal->j_commit_interval; + transaction->t_expires = jiffies + (journal->j_commit_interval ? : bdflush_interval()); INIT_LIST_HEAD(&transaction->t_jcb); /* Set up the commit timer for the new transaction. */ diff -urNp x-ref/include/linux/bdf_prm.h x/include/linux/bdf_prm.h --- x-ref/include/linux/bdf_prm.h Thu Jan 1 01:00:00 1970 +++ x/include/linux/bdf_prm.h Mon Oct 7 02:59:50 2002 @@ -0,0 +1,34 @@ +#ifndef _LINUX_BDF_PRM_H +#define _LINUX_PDF_PRM_H + +/* Here is the parameter block for the bdflush process. If you add or + * remove any of the parameters, make sure to update kernel/sysctl.c + * and the documentation at linux/Documentation/sysctl/vm.txt. + */ + +#define BDFLUSH_NR_PARAM 9 + +/* The dummy values in this structure are left in there for compatibility + * with old programs that play with the /proc entries. + */ +union bdflush_param { + struct { + int nfract; /* Percentage of buffer cache dirty to + activate bdflush */ + int ndirty; /* Maximum number of dirty blocks to write out per + wake-cycle */ + int dummy2; /* old "nrefill" */ + int dummy3; /* unused */ + int interval; /* jiffies delay between kupdate flushes */ + int age_buffer; /* Time for normal buffer to age before we flush it */ + int nfract_sync;/* Percentage of buffer cache dirty to + activate bdflush synchronously */ + int nfract_stop_bdflush; /* Percetange of buffer cache dirty to stop bdflush */ + int dummy5; /* unused */ + } b_un; + unsigned int data[BDFLUSH_NR_PARAM]; +}; +extern union bdflush_param bdf_prm; +#define bdflush_interval() (bdf_prm.b_un.interval) + +#endif /* _LINUX_BDF_PRM_H */ diff -urNp x-ref/kernel/ksyms.c x/kernel/ksyms.c --- x-ref/kernel/ksyms.c Mon Oct 7 02:59:47 2002 +++ x/kernel/ksyms.c Mon Oct 7 02:59:50 2002 @@ -51,6 +51,7 @@ #include #include #include +#include #if defined(CONFIG_PROC_FS) @@ -186,6 +187,7 @@ EXPORT_SYMBOL(mark_buffer_dirty); EXPORT_SYMBOL(set_buffer_async_io); /* for reiserfs_writepage */ EXPORT_SYMBOL(__mark_buffer_dirty); EXPORT_SYMBOL(__mark_inode_dirty); +EXPORT_SYMBOL(bdf_prm); EXPORT_SYMBOL(fd_install); EXPORT_SYMBOL(get_empty_filp); EXPORT_SYMBOL(init_private_file); diff -urNp x-ref/kernel/sysctl.c x/kernel/sysctl.c --- x-ref/kernel/sysctl.c Mon Oct 7 02:59:46 2002 +++ x/kernel/sysctl.c Mon Oct 7 02:59:50 2002 @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -43,7 +44,7 @@ /* External variables not in a header file. */ extern int panic_timeout; extern int C_A_D; -extern int bdf_prm[], bdflush_min[], bdflush_max[]; +extern int bdflush_min[], bdflush_max[]; extern int sysctl_overcommit_memory; extern int max_threads; extern atomic_t nr_queued_signals; @@ -273,7 +274,7 @@ static ctl_table vm_table[] = { &vm_lru_balance_ratio, sizeof(int), 0644, NULL, &proc_dointvec}, {VM_PASSES, "vm_passes", &vm_passes, sizeof(int), 0644, NULL, &proc_dointvec}, - {VM_BDFLUSH, "bdflush", &bdf_prm, 9*sizeof(int), 0644, NULL, + {VM_BDFLUSH, "bdflush", &bdf_prm, BDFLUSH_NR_PARAM*sizeof(int), 0644, NULL, &proc_dointvec_minmax, &sysctl_intvec, NULL, &bdflush_min, &bdflush_max}, {VM_OVERCOMMIT_MEMORY, "overcommit_memory", &sysctl_overcommit_memory,