/* This is only called on sync() and umount(), when s_dirt=1. */
static void sysv_write_super(struct super_block *sb)
{
- if (!(sb->s_flags & MS_RDONLY)) {
- /* If we are going to write out the super block,
- then attach current time stamp.
- But if the filesystem was marked clean, keep it clean. */
- unsigned long time = CURRENT_TIME;
- unsigned long old_time = fs32_to_cpu(sb, *sb->sv_sb_time);
- if (sb->sv_type == FSTYPE_SYSV4)
- if (*sb->sv_sb_state == cpu_to_fs32(sb, 0x7c269d38 - old_time))
- *sb->sv_sb_state = cpu_to_fs32(sb, 0x7c269d38 - time);
- *sb->sv_sb_time = cpu_to_fs32(sb, time);
- mark_buffer_dirty(sb->sv_bh2);
+ struct sysv_sb_info *sbi = SYSV_SB(sb);
+ unsigned long time = CURRENT_TIME, old_time;
+
+ lock_kernel();
+ if (sb->s_flags & MS_RDONLY)
+ goto clean;
+
+ /*
+ * If we are going to write out the super block,
+ * then attach current time stamp.
+ * But if the filesystem was marked clean, keep it clean.
+ */
+ old_time = fs32_to_cpu(sbi, *sbi->s_sb_time);
+ if (sbi->s_type == FSTYPE_SYSV4) {
+ if (*sbi->s_sb_state == cpu_to_fs32(sbi, 0x7c269d38 - old_time))
+ *sbi->s_sb_state = cpu_to_fs32(sbi, 0x7c269d38 - time);
+ *sbi->s_sb_time = cpu_to_fs32(sbi, time);
+ mark_buffer_dirty(sbi->s_bh2);
}
+ clean:
sb->s_dirt = 0;
+ unlock_kernel();
}
static void sysv_put_super(struct super_block *sb)
#include <linux/ext3_fs_sb.h>
#include <linux/hpfs_fs_sb.h>
- #include <linux/sysv_fs_sb.h>
-#include <linux/ntfs_fs_sb.h>
#include <linux/ufs_fs_sb.h>
#include <linux/romfs_fs_sb.h>
#include <linux/adfs_fs_sb.h>
union {
struct ext3_sb_info ext3_sb;
struct hpfs_sb_info hpfs_sb;
- struct sysv_sb_info sysv_sb;
- struct ntfs_sb_info ntfs_sb;
struct ufs_sb_info ufs_sb;
struct romfs_sb_info romfs_sb;
struct adfs_sb_info adfs_sb;