reiserfs-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: ReiserFS Mailing List <reiserfs-devel@vger.kernel.org>,
	Edward Shishkin <edward@namesys.com>
Subject: Re: [PATCH 2/2] reiserfs: Add mount counting
Date: Mon, 03 Dec 2007 14:46:21 -0500	[thread overview]
Message-ID: <47545D0D.6080608@suse.com> (raw)
In-Reply-To: <474B4BCF.1000905@suse.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Any comments on this? I'd like to be able to check this into our kernel
tree, but I can't do so until these fields have been officially reserved.

- -Jeff

Jeff Mahoney wrote:
>  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.
> 
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>
> ---
> 
>  fs/reiserfs/super.c            |    6 +++++-
>  include/linux/reiserfs_fs.h    |    6 +++++-
>  include/linux/reiserfs_fs_sb.h |    3 +++
>  3 files changed, 13 insertions(+), 2 deletions(-)
> 
> --- a/fs/reiserfs/super.c	2007-11-26 17:09:51.000000000 -0500
> +++ b/fs/reiserfs/super.c	2007-11-26 17:32:21.000000000 -0500
> @@ -1239,6 +1239,8 @@ static int reiserfs_remount(struct super
>  		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;
> @@ -1764,7 +1766,9 @@ static int reiserfs_fill_super(struct su
>  			} 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);
> --- a/include/linux/reiserfs_fs.h	2007-11-26 17:09:58.000000000 -0500
> +++ b/include/linux/reiserfs_fs.h	2007-11-26 17:22:35.000000000 -0500
> @@ -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. */
> --- a/include/linux/reiserfs_fs_sb.h	2007-11-26 17:09:58.000000000 -0500
> +++ b/include/linux/reiserfs_fs_sb.h	2007-11-26 17:24:54.000000000 -0500
> @@ -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) \
> 


- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFHVF0NLPWxlyuTD7IRApOuAJ4+oIw0W37hkDrUv8GSGNgX9R8itwCbBWOx
FLf7hNIByLk/lkjsLm/4HIY=
=gzSp
-----END PGP SIGNATURE-----

  reply	other threads:[~2007-12-03 19:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-26 22:42 [PATCH 2/2] reiserfs: Add mount counting Jeff Mahoney
2007-12-03 19:46 ` Jeff Mahoney [this message]
2007-12-03 20:36   ` Edward Shishkin
2007-12-03 20:40     ` Jeff Mahoney
2007-12-03 20:51       ` Edward Shishkin
2007-12-03 21:32         ` Jeff Mahoney
2007-12-03 22:56           ` Edward Shishkin
2007-12-03 23:00             ` Jeff Mahoney
2007-12-05 12:22               ` Ric Wheeler
2007-12-05 13:01                 ` Vladimir Saveliev
2007-12-05 15:32                   ` Jeff Mahoney
2007-12-05 15:39                     ` Ric Wheeler
2007-12-05 15:52                       ` Jeff Mahoney
2007-12-05 17:53                     ` Vladimir Saveliev
2007-12-05 18:18                       ` Ric Wheeler
2008-01-24 19:52               ` Jeff Mahoney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47545D0D.6080608@suse.com \
    --to=jeffm@suse.com \
    --cc=edward@namesys.com \
    --cc=reiserfs-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).