diff options
author | Victor Lowther <victor.lowther@gmail.com> | 2008-07-23 21:29:27 -0500 |
---|---|---|
committer | Victor Lowther <victor.lowther@gmail.com> | 2010-06-05 13:38:38 -0500 |
commit | ded3b131f51ba3aa64536019c4bfb0cb7a0df58b (patch) | |
tree | b928f15ec05469a6f93c50c7d69f82ea05c98d40 /pm/power.d/journal-commit | |
parent | a262ed4c23199e6c42c19dd6fea423d72b78a15a (diff) |
Added powersave hook to change journal commit interval
Diffstat (limited to 'pm/power.d/journal-commit')
-rw-r--r-- | pm/power.d/journal-commit | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/pm/power.d/journal-commit b/pm/power.d/journal-commit new file mode 100644 index 0000000..be68fed --- /dev/null +++ b/pm/power.d/journal-commit @@ -0,0 +1,38 @@ +#!/bin/sh + +. ${PM_FUNCTIONS} + +# actually remount the file system +remount_fs() +{ + # $1 = filesystem to remount + # $2 = mount option to change + mount -o remount,$2 $1 +} + +# invoked on an ext3 file system +handle_ext3() +{ + # $1 = filesystem to remount + # $2 = commit time + remount_fs $1 "commit=${2}" +} + +handle_filesystems() +{ + # $1 = new journal commit time in seconds + while read DEV MOUNT FSTYPE REST; + do + command_exists "handle_${FSTYPE}" || continue + "handle_${FSTYPE}" $MOUNT $1 + done < /proc/mounts +} + +case $1 in + true) handle_filesystems 600 ;; + false) handle_filesystems 5 ;; + *) exit $NA ;; +esac + +exit 0 + |