]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
reiserfs: add support for mount count incrementing
authorJeff Mahoney <jeffm@suse.com>
Mon, 30 Mar 2009 18:02:16 +0000 (14:02 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 30 Mar 2009 19:16:35 +0000 (12:16 -0700)
The following patch adds the fields for tracking mount counts and last
fsck timestamps to the superblock.  It also increments the mount count
on every read-write mount.

Reiserfsprogs 3.6.21 added support for these fields.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/reiserfs/super.c
include/linux/reiserfs_fs.h
include/linux/reiserfs_fs_sb.h

index f3c820b758296179be10796a51a47ff3242494ac..4ad40afe54e1420d8ce800c2b7e9c4b62618c5db 100644 (file)
@@ -1280,6 +1280,8 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
                REISERFS_SB(s)->s_mount_state = sb_umount_state(rs);
                s->s_flags &= ~MS_RDONLY;
                set_sb_umount_state(rs, REISERFS_ERROR_FS);
+               if (!old_format_only(s))
+                       set_sb_mnt_count(rs, sb_mnt_count(rs) + 1);
                /* mark_buffer_dirty (SB_BUFFER_WITH_SB (s), 1); */
                journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
                REISERFS_SB(s)->s_mount_state = REISERFS_VALID_FS;
@@ -1819,7 +1821,9 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
                        } else if (!silent) {
                                reiserfs_info(s, "using 3.5.x disk format\n");
                        }
-               }
+               } else
+                       set_sb_mnt_count(rs, sb_mnt_count(rs) + 1);
+
 
                journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
                errval = journal_end(&th, s, 1);
index bc5114d35e99b65db4e11acefe3bae623a7c9db9..ab748a03fe97943655a0bf69ce14b2d89a3d060a 100644 (file)
@@ -171,7 +171,11 @@ struct reiserfs_super_block {
        __le32 s_flags;         /* Right now used only by inode-attributes, if enabled */
        unsigned char s_uuid[16];       /* filesystem unique identifier */
        unsigned char s_label[16];      /* filesystem volume label */
-       char s_unused[88];      /* zero filled by mkreiserfs and
+       __le16 s_mnt_count;             /* Count of mounts since last fsck */
+       __le16 s_max_mnt_count;         /* Maximum mounts before check */
+       __le32 s_lastcheck;             /* Timestamp of last fsck */
+       __le32 s_check_interval;        /* Interval between checks */
+       char s_unused[76];      /* zero filled by mkreiserfs and
                                 * reiserfs_convert_objectid_map_v1()
                                 * so any additions must be updated
                                 * there as well. */
index bda6b562a1e05dc5ee936ca52dfc8bfb14ae86a9..ccd38f35153003283382f929ba095d2312602aa0 100644 (file)
@@ -73,6 +73,9 @@ typedef enum {
 #define sb_version(sbp)            (le16_to_cpu((sbp)->s_v1.s_version))
 #define set_sb_version(sbp,v)      ((sbp)->s_v1.s_version = cpu_to_le16(v))
 
+#define sb_mnt_count(sbp)         (le16_to_cpu((sbp)->s_mnt_count))
+#define set_sb_mnt_count(sbp, v)   ((sbp)->s_mnt_count = cpu_to_le16(v))
+
 #define sb_reserved_for_journal(sbp) \
               (le16_to_cpu((sbp)->s_v1.s_reserved_for_journal))
 #define set_sb_reserved_for_journal(sbp,v) \