[Ocfs2-commits] jlbec commits r1081 - branches/format-changes/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Sun Jun 13 21:09:19 CDT 2004
Author: jlbec
Date: 2004-06-13 20:09:17 -0500 (Sun, 13 Jun 2004)
New Revision: 1081
Modified:
branches/format-changes/src/ocfs2_fs.h
branches/format-changes/src/super.c
branches/format-changes/src/sysfile.c
Log:
o Some sysfile stuff
Modified: branches/format-changes/src/ocfs2_fs.h
===================================================================
--- branches/format-changes/src/ocfs2_fs.h 2004-06-13 23:56:13 UTC (rev 1080)
+++ branches/format-changes/src/ocfs2_fs.h 2004-06-14 01:09:17 UTC (rev 1081)
@@ -45,6 +45,12 @@
*/
#define OCFS2_SUPER_BLOCK_BLKNO 2
+/*
+ * As OCFS2 has a minimum clustersize of 4K, it has a maximum blocksize
+ * of 4K
+ */
+#define OCFS2_MAX_BLOCKSIZE 4096
+
/* Object signatures */
#define OCFS2_SUPER_BLOCK_SIGNATURE "OCFSV2"
#define OCFS2_FILE_ENTRY_SIGNATURE "INODE01"
@@ -53,14 +59,17 @@
/*
* Flags on ocfs2_dinode.i_flags
*/
-#define OCFS2_VALID_FL (0x01)
-#define OCFS2_UNUSED2_FL (0x02)
-#define OCFS2_ORPHANED_FL (0x04)
-#define OCFS2_UNUSED3_FL (0x08)
-#define OCFS2_SYSTEM_FL (0x10)
-#define OCFS2_SUPER_BLOCK_FL (0x20)
-#define OCFS2_LOCAL_ALLOC_FL (0x40)
-#define OCFS2_BITMAP_FL (0x80)
+#define OCFS2_VALID_FL (0x00000001) /* Inode is valid */
+#define OCFS2_UNUSED2_FL (0x00000002)
+#define OCFS2_ORPHANED_FL (0x00000004) /* On the orphan list */
+#define OCFS2_UNUSED3_FL (0x00000008)
+/* System inode flags */
+#define OCFS2_SYSTEM_FL (0x00000010) /* System inode */
+#define OCFS2_SUPER_BLOCK_FL (0x00000020) /* Super block */
+#define OCFS2_LOCAL_ALLOC_FL (0x00000040) /* Node local alloc bitmap */
+#define OCFS2_BITMAP_FL (0x00000080) /* Allocation bitmap */
+#define OCFS2_JOURNAL_FL (0x00000100) /* Node journal */
+#define OCFS2_DLM_FL (0x00000200) /* DLM area */
/* Limit of space in ocfs2_dir_entry */
@@ -87,6 +96,7 @@
PUBLISH_SYSTEM_INODE,
VOTE_SYSTEM_INODE,
ORPHAN_DIR_SYSTEM_INODE,
+#define OCFS_LAST_GLOBAL_SYSTEM_INODE ORPHAN_DIR_SYSTEM_INODE
EXTENT_ALLOC_SYSTEM_INODE,
EXTENT_ALLOC_BITMAP_SYSTEM_INODE,
INODE_ALLOC_SYSTEM_INODE,
@@ -96,11 +106,30 @@
NUM_SYSTEM_INODES
};
+static char *ocfs2_system_inode_names[NUM_SYSTEM_INODES] = {
+ /* Global system inodes (single copy) */
+ [GLOBAL_BITMAP_SYSTEM_INODE] "global_bitmap",
+ [GLOBAL_INODE_ALLOC_SYSTEM_INODE] "global_inode_alloc",
+ [GLOBAL_INODE_ALLOC_BITMAP_SYSTEM_INODE] "global_inode_alloc_bitmap",
+ [AUTOCONFIG_SYSTEM_INODE] "autoconfig",
+ [PUBLISH_SYSTEM_INODE] "publish",
+ [VOTE_SYSTEM_INODE] "vote",
+ [ORPHAN_DIR_SYSTEM_INODE] "orphan_dir",
+
+ /* Node-specific system inodes (one copy per node) */
+ [EXTENT_ALLOC_SYSTEM_INODE] "extent_alloc:%04d",
+ [EXTENT_ALLOC_BITMAP_SYSTEM_INODE] "extent_alloc_bitmap:%04d",
+ [INODE_ALLOC_SYSTEM_INODE] "inode_alloc:%04d",
+ [INODE_ALLOC_BITMAP_SYSTEM_INODE] "inode_alloc_bitmap:%04d",
+ [JOURNAL_SYSTEM_INODE] "journal:%04d",
+ [LOCAL_ALLOC_SYSTEM_INODE] "local_alloc:%04d"
+};
+
+
/*
* The last system inode that has only one global copy. Every system
* inode after it in the system inode enum has a node-specific copy.
*/
-#define OCFS_LAST_GLOBAL_SYSTEM_INODE ORPHAN_DIR_SYSTEM_INODE
/* Default size for the local alloc bitmap */
Modified: branches/format-changes/src/super.c
===================================================================
--- branches/format-changes/src/super.c 2004-06-13 23:56:13 UTC (rev 1080)
+++ branches/format-changes/src/super.c 2004-06-14 01:09:17 UTC (rev 1081)
@@ -897,9 +897,13 @@
goto bail;
}
- /* now check at magic offset for 512, 1024, 2048, 4096 blocksizes */
+ /*
+ * Now check at magic offset for 512, 1024, 2048, 4096
+ * blocksizes. 4096 is the maximum blocksize because it is
+ * the minimum clustersize.
+ */
status = -EINVAL;
- for (sectsize=hardsect; sectsize<=4096; sectsize<<=1) {
+ for (sectsize = hardsect; sectsize <= OCFS2_MAX_BLOCKSIZE; sectsize <<= 1) {
tmpstat = ocfs2_get_sector(sb, bh,
OCFS2_SUPER_BLOCK_BLKNO,
sectsize);
Modified: branches/format-changes/src/sysfile.c
===================================================================
--- branches/format-changes/src/sysfile.c 2004-06-13 23:56:13 UTC (rev 1080)
+++ branches/format-changes/src/sysfile.c 2004-06-14 01:09:17 UTC (rev 1081)
@@ -51,22 +51,6 @@
static struct inode * _ocfs_get_system_file_inode(ocfs_super *osb, int type, __u32 node);
-char *system_file_names[] = {
- "global_bitmap",
- "global_inode_alloc",
- "global_inode_alloc_bitmap",
- "autoconfig",
- "publish",
- "vote",
- "orphan_dir",
- "extent_alloc:%04d",
- "extent_alloc_bitmap:%04d",
- "inode_alloc:%04d",
- "inode_alloc_bitmap:%04d",
- "journal:%04d",
- "local_alloc:%04d"
-};
-
static inline int is_global_system_inode(int type);
static inline int is_in_system_inode_array(ocfs_super *osb, int type, __u32 node);
@@ -121,9 +105,9 @@
* list has a copy per node.
*/
if (type <= OCFS_LAST_GLOBAL_SYSTEM_INODE)
- sprintf(namebuf, system_file_names[type]);
+ sprintf(namebuf, ocfs2_system_inode_names[type]);
else
- sprintf(namebuf, system_file_names[type], node);
+ sprintf(namebuf, ocfs2_system_inode_names[type], node);
status = ocfs_find_files_on_disk(osb, namebuf, strlen(namebuf),
&fe_off, osb->sys_root_inode,
More information about the Ocfs2-commits
mailing list