[Ocfs2-commits] jlbec commits r1078 - branches/format-changes/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Sun Jun 13 04:30:20 CDT 2004


Author: jlbec
Date: 2004-06-13 03:30:18 -0500 (Sun, 13 Jun 2004)
New Revision: 1078

Modified:
   branches/format-changes/src/dir.c
   branches/format-changes/src/namei.c
   branches/format-changes/src/ocfs2_fs.h
   branches/format-changes/src/super.c
Log:

o Move the superblock offset define to ocfs2_fs.h
o Add ext3 attributions to dir.c and namei.c



Modified: branches/format-changes/src/dir.c
===================================================================
--- branches/format-changes/src/dir.c	2004-06-13 06:54:14 UTC (rev 1077)
+++ branches/format-changes/src/dir.c	2004-06-13 08:30:18 UTC (rev 1078)
@@ -7,6 +7,19 @@
  *
  * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
  *
+ *  Portions of this code from linux/fs/ext3/dir.c
+ *  
+ *  Copyright (C) 1992, 1993, 1994, 1995
+ *  Remy Card (card at masi.ibp.fr)
+ *  Laboratoire MASI - Institut Blaise pascal
+ *  Universite Pierre et Marie Curie (Paris VI)
+ *  
+ *   from
+ *
+ *   linux/fs/minix/dir.c
+ *
+ *   Copyright (C) 1991, 1992 Linux Torvalds
+ *
  * This program 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

Modified: branches/format-changes/src/namei.c
===================================================================
--- branches/format-changes/src/namei.c	2004-06-13 06:54:14 UTC (rev 1077)
+++ branches/format-changes/src/namei.c	2004-06-13 08:30:18 UTC (rev 1078)
@@ -7,6 +7,19 @@
  *
  * Copyright (C) 2002, 2004 Oracle.  All rights reserved.
  *
+ *  Portions of this code from linux/fs/ext3/dir.c
+ *  
+ *  Copyright (C) 1992, 1993, 1994, 1995
+ *  Remy Card (card at masi.ibp.fr)
+ *  Laboratoire MASI - Institut Blaise pascal
+ *  Universite Pierre et Marie Curie (Paris VI)
+ *  
+ *   from
+ *
+ *   linux/fs/minix/dir.c
+ *
+ *   Copyright (C) 1991, 1992 Linux Torvalds
+ *
  * This program 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

Modified: branches/format-changes/src/ocfs2_fs.h
===================================================================
--- branches/format-changes/src/ocfs2_fs.h	2004-06-13 06:54:14 UTC (rev 1077)
+++ branches/format-changes/src/ocfs2_fs.h	2004-06-13 08:30:18 UTC (rev 1078)
@@ -32,6 +32,19 @@
 #define OCFS2_MAJOR_REV_LEVEL		2
 #define OCFS2_MINOR_REV_LEVEL          	0
 
+/*
+ * An OCFS2 volume starts this way:
+ * Sector 0: Valid ocfs1_vol_disk_hdr that cleanly fails to mount v1.
+ * Sector 1: Valid ocfs1_vol_label that cleanly fails to mount v1.
+ * Block OCFS2_SUPER_BLOCK_BLKNO: OCFS2 superblock.
+ *
+ * All other structures are found from the superblock information.
+ *
+ * OCFS2_SUPER_BLOCK_BLKNO is in blocks, not sectors.  eg, for a
+ * blocksize of 2K, it is 4096 bytes into disk.
+ */
+#define OCFS2_SUPER_BLOCK_BLKNO		2
+
 /* Object signatures */
 #define OCFS2_SUPER_BLOCK_SIGNATURE	"OCFSV2"
 #define OCFS2_FILE_ENTRY_SIGNATURE	"INODE01"
@@ -91,7 +104,7 @@
 
 
 /* Default size for the local alloc bitmap */
-#define OCFS2_LOCAL_BITMAP_DEFAULT_SIZE 256
+#define OCFS2_LOCAL_BITMAP_DEFAULT_SIZE		256
 
 /*
  * OCFS2 directory file types.  Only the low 3 bits are used.  The
@@ -118,9 +131,9 @@
 #define OCFS2_DIR_REC_LEN(name_len)	(((name_len) + 12 + \
                                           OCFS2_DIR_ROUND) & \
 					 ~OCFS2_DIR_ROUND)
-#define OCFS2_LINK_MAX 32000
+#define OCFS2_LINK_MAX		32000
 
-#define S_SHIFT 12
+#define S_SHIFT			12
 static unsigned char ocfs_type_by_mode[S_IFMT >> S_SHIFT] = {
 	[S_IFREG >> S_SHIFT]    OCFS2_FT_REG_FILE,
 	[S_IFDIR >> S_SHIFT]    OCFS2_FT_DIR,
@@ -141,8 +154,8 @@
 
 
 /*
- * On disk extent record for OCFS2.  It describes a range of clusters
- * on disk.
+ * On disk extent record for OCFS2
+ * It describes a range of clusters on disk.
  */
 typedef struct _ocfs2_extent_rec {
 /*00*/	__u32 e_cpos;		/* Offset into the file, in clusters */
@@ -208,9 +221,9 @@
 } ocfs2_disk_lock;
 
 /*
- * On disk superblock for OCFS2.  Note that it is contained inside an
- * ocfs2_dinode, so all offsets are relative to the start of
- * ocfs2_dinode.id2.
+ * On disk superblock for OCFS2
+ * Note that it is contained inside an ocfs2_dinode, so all offsets
+ * are relative to the start of ocfs2_dinode.id2.
  */
 typedef struct _ocfs2_super_block {
 /*00*/	__u16 s_major_rev_level;
@@ -241,9 +254,9 @@
 } ocfs2_super_block;
 
 /*
- * Local allocation bitmap for OCFS2 nodes.  Node that it exists inside
- * an ocfs2_dinode, so all offsets are relative to the start of
- * ocfs2_dinode.id2.
+ * Local allocation bitmap for OCFS2 nodes
+ * Node that it exists inside an ocfs2_dinode, so all offsets are
+ * relative to the start of ocfs2_dinode.id2.
  */
 typedef struct _ocfs2_local_alloc
 {
@@ -307,6 +320,9 @@
 /* Actual on-disk size is one block */
 } ocfs2_dinode;
 
+/*
+ * On-disk directory entry structure for OCFS2
+ */
 struct ocfs2_dir_entry {
 /*00*/	__u64   inode;                  /* Inode number */
 	__u16   rec_len;                /* Directory entry length */
@@ -316,6 +332,7 @@
 /* Actual on-disk length specified by rec_len */
 };
 
+
 #ifdef __KERNEL__
 static inline int ocfs2_extent_recs_per_inode(struct super_block *sb)
 {

Modified: branches/format-changes/src/super.c
===================================================================
--- branches/format-changes/src/super.c	2004-06-13 06:54:14 UTC (rev 1077)
+++ branches/format-changes/src/super.c	2004-06-13 08:30:18 UTC (rev 1078)
@@ -815,7 +815,6 @@
 	OCFS_CLEAR_FLAG (OcfsGlobalCtxt.flags, OCFS_FLAG_MEM_LISTS_INITIALIZED);
 }				/* ocfs_free_mem_lists */
 
-#define MAGIC_SUPERBLOCK_BLOCK_NUMBER  2
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 static inline int ocfs_hardsect_size(struct block_device *bdev)
@@ -878,7 +877,7 @@
 	for (sectsize=hardsect; sectsize<=4096; sectsize<<=1) {
 		int done = 0;
 		tmpstat = ocfs2_get_sector(sb, bh, 
-					   MAGIC_SUPERBLOCK_BLOCK_NUMBER, 
+					   OCFS2_SUPER_BLOCK_BLKNO, 
 					   sectsize);
 		if (tmpstat < 0) {
 			LOG_ERROR_STATUS(status = tmpstat);



More information about the Ocfs2-commits mailing list