]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/patches/suse-2.6.27.25/patches.suse/reiserfs-mount-count
Updated xen patches taken from suse.
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.suse / reiserfs-mount-count
1 From: Jeff Mahoney <jeffm@suse.com>
2 Subject: reiserfs: add support for mount count incrementing
3
4 The following patch adds the fields for tracking mount counts and
5 last fsck timestamps to the superblock. It also increments the mount
6 count on every read-write mount. These fields have been reserved on
7 the reiserfs-devel list, and will be a part of the next reiserfsprogs
8 release.
9
10 Signed-off-by: Jeff Mahoney <jeffm@suse.com>
11 ---
12 fs/reiserfs/super.c | 6 +++++-
13 include/linux/reiserfs_fs.h | 6 +++++-
14 include/linux/reiserfs_fs_sb.h | 3 +++
15 3 files changed, 13 insertions(+), 2 deletions(-)
16
17 --- a/fs/reiserfs/super.c
18 +++ b/fs/reiserfs/super.c
19 @@ -1278,6 +1278,8 @@ static int reiserfs_remount(struct super
20 REISERFS_SB(s)->s_mount_state = sb_umount_state(rs);
21 s->s_flags &= ~MS_RDONLY;
22 set_sb_umount_state(rs, REISERFS_ERROR_FS);
23 + if (!old_format_only(s))
24 + set_sb_mnt_count(rs, sb_mnt_count(rs) + 1);
25 /* mark_buffer_dirty (SB_BUFFER_WITH_SB (s), 1); */
26 journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
27 REISERFS_SB(s)->s_mount_state = REISERFS_VALID_FS;
28 @@ -1817,7 +1819,9 @@ static int reiserfs_fill_super(struct su
29 } else if (!silent) {
30 reiserfs_info(s, "using 3.5.x disk format\n");
31 }
32 - }
33 + } else
34 + set_sb_mnt_count(rs, sb_mnt_count(rs) + 1);
35 +
36
37 journal_mark_dirty(&th, s, SB_BUFFER_WITH_SB(s));
38 errval = journal_end(&th, s, 1);
39 --- a/include/linux/reiserfs_fs.h
40 +++ b/include/linux/reiserfs_fs.h
41 @@ -171,7 +171,11 @@ struct reiserfs_super_block {
42 __le32 s_flags; /* Right now used only by inode-attributes, if enabled */
43 unsigned char s_uuid[16]; /* filesystem unique identifier */
44 unsigned char s_label[16]; /* filesystem volume label */
45 - char s_unused[88]; /* zero filled by mkreiserfs and
46 + __le16 s_mnt_count; /* Count of mounts since last fsck */
47 + __le16 s_max_mnt_count; /* Maximum mounts before check */
48 + __le32 s_lastcheck; /* Timestamp of last fsck */
49 + __le32 s_check_interval; /* Interval between checks */
50 + char s_unused[76]; /* zero filled by mkreiserfs and
51 * reiserfs_convert_objectid_map_v1()
52 * so any additions must be updated
53 * there as well. */
54 --- a/include/linux/reiserfs_fs_sb.h
55 +++ b/include/linux/reiserfs_fs_sb.h
56 @@ -73,6 +73,9 @@ typedef enum {
57 #define sb_version(sbp) (le16_to_cpu((sbp)->s_v1.s_version))
58 #define set_sb_version(sbp,v) ((sbp)->s_v1.s_version = cpu_to_le16(v))
59
60 +#define sb_mnt_count(sbp) (le16_to_cpu((sbp)->s_mnt_count))
61 +#define set_sb_mnt_count(sbp, v) ((sbp)->s_mnt_count = cpu_to_le16(v))
62 +
63 #define sb_reserved_for_journal(sbp) \
64 (le16_to_cpu((sbp)->s_v1.s_reserved_for_journal))
65 #define set_sb_reserved_for_journal(sbp,v) \