linux-nilfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vyacheslav Dubeyko <slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
To: linux-nilfs <linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: [PATCH v4 08/15] nilfs-utils: fsck: add fsck internal declarations
Date: Mon, 12 Nov 2012 13:36:35 +0400	[thread overview]
Message-ID: <1352712995.2555.43.camel@slavad-ubuntu> (raw)

Hi,

This patch adds fsck_common.h file with fsck internal declarations.

With the best regards,
Vyacheslav Dubeyko.
--
From: Vyacheslav Dubeyko <slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
Subject: [PATCH v4 08/15] nilfs-utils: fsck: add fsck internal declarations

This patch adds fsck_common.h file with fsck internal declarations.

Signed-off-by: Vyacheslav Dubeyko <slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
---
 sbin/fsck/fsck_common.h |  119 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 119 insertions(+)
 create mode 100644 sbin/fsck/fsck_common.h

diff --git a/sbin/fsck/fsck_common.h b/sbin/fsck/fsck_common.h
new file mode 100644
index 0000000..679bf7a
--- /dev/null
+++ b/sbin/fsck/fsck_common.h
@@ -0,0 +1,119 @@
+/*
+ * fsck_common.h - NILFS fsck application-related declarations
+ *
+ * Copyright (C) 2012 Vyacheslav Dubeyko <slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
+ *
+ * This file is part of NILFS.
+ *
+ * NILFS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * NILFS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with NILFS; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Written by Vyacheslav Dubeyko <slava-yeENwD64cLxBDgjK7y7TUQ@public.gmane.org>
+ */
+
+#ifndef FSCK_COMMON_H
+#define FSCK_COMMON_H
+
+#include "nilfs.h"
+#include "nilfs_messages.h"
+#include "fsck_nilfs2.h"
+
+#define FSCK_VERSION "v.0.04-under-development"
+
+#define UNDEFINED_SNAPSHOT -1
+
+/*
+ * struct nilfs_segment_reference
+ *
+ * Item of array that defines references of segments
+ * on each other in sequence.
+ *
+ * @prev_seg: previous segment number.
+ * @next_seg: next segment number.
+ * @seg_seq_id: segment sequence number.
+ * @logs_count: count of logs in segment
+ *
+ */
+struct nilfs_segment_reference {
+	__u64 prev_seg;
+	__u64 next_seg;
+	__u64 seg_seq_id;
+	__u32 logs_count;
+}; /* struct nilfs_segment_reference */
+
+/*
+ * struct log_check
+ */
+struct log_check {
+	union {
+		__u16 check_mask;
+		__u16 errs_bmp;
+	} ss_hdr;
+}; /* struct log_check */
+
+/*
+ * struct segment_check
+ */
+struct segment_check {
+	struct log_check *logs;
+	__u32 logs_count;
+}; /* struct segment_check */
+
+/*
+ * struct fsck_check
+ *
+ * Defines what should check and return errors.
+ * For every item check_mask is prepared before
+ * checking. It needs to check only items which
+ * flags were been set. If checking item is
+ * valid then proper bit is unset in errors_bitmap.
+ */
+struct fsck_check {
+/* Volume at whole section */
+	union {
+		__u64 check_mask;
+		__u64 errs_bmp;
+	} volume;
+/* Superblock section */
+	union {
+		__u64 check_mask;
+		__u64 errs_bmp;
+	} sb[SUPERBLOCK_TYPES_NUMBER];
+/* Segments section */
+	struct segment_check *segments;
+	__u64 segs_count;
+}; /* struct fsck_check */
+
+/* libmountchk function */
+extern int check_mount(const char *device);
+
+/* Current mode of fsck working */
+extern int fsck_work_mode;
+
+/* Defines what should check and keeps errors */
+extern struct fsck_check detected_err_db;
+
+/* Array of pointers on NILFS volume's superblocks */
+extern struct nilfs_super_block *superblocks[SUPERBLOCK_TYPES_NUMBER];
+
+/* NILFS object for library API accessing */
+extern struct nilfs *nilfs_object_ptr;
+
+/* Pointer on segment references array */
+extern struct nilfs_segment_reference *seg_refs_array_ptr;
+
+/* Pointer on segments bitmap */
+extern int *segments_bitmap_ptr;
+
+#endif /* FSCK_COMMON_H */
-- 
1.7.9.5


--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2012-11-12  9:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1352712995.2555.43.camel@slavad-ubuntu \
    --to=slava-yeenwd64clxbdgjk7y7tuq@public.gmane.org \
    --cc=linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).