[Ocfs2-commits] jlbec commits r1147 - trunk/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Jun 18 11:24:22 CDT 2004
Author: jlbec
Date: 2004-06-18 10:24:20 -0500 (Fri, 18 Jun 2004)
New Revision: 1147
Modified:
trunk/src/alloc.c
trunk/src/buffer_head_io.c
trunk/src/buffer_head_io.h
trunk/src/dlm.c
trunk/src/journal.c
trunk/src/ocfs.h
trunk/src/ocfs_compat.h
trunk/src/super.c
Log:
o Removing lots of useless stuff from ocfs.h
Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c 2004-06-18 06:30:14 UTC (rev 1146)
+++ trunk/src/alloc.c 2004-06-18 15:24:20 UTC (rev 1147)
@@ -565,7 +565,7 @@
goto leave;
}
- if (!IS_VALID_NODE_NUM (NodeNum)) {
+ if (NodeNum >= osb->max_nodes) {
LOG_ERROR_STATUS(status = -EINVAL);
goto leave;
}
Modified: trunk/src/buffer_head_io.c
===================================================================
--- trunk/src/buffer_head_io.c 2004-06-18 06:30:14 UTC (rev 1146)
+++ trunk/src/buffer_head_io.c 2004-06-18 15:24:20 UTC (rev 1147)
@@ -63,7 +63,35 @@
return;
}
+#warning should we really still be doing this every write
+/*
+ * This is an ugly sign of no-confidence. Heck, we should never write
+ * block 0 under *any* circumstances now, as our superblock is
+ * block 2
+ */
+#include "ocfs1_fs_compat.h"
+static inline int check_block_zero_write(struct buffer_head *bh)
+{
+ if (unlikely(bh->b_blocknr == 0)) {
+ ocfs1_vol_disk_hdr *hdr = (ocfs1_vol_disk_hdr *) bh->b_data;
+ if (hdr == NULL) {
+ printk ("ocfs2: failed to map bh page!!!\n");
+ return -EIO;
+ }
+
+ if (memcmp(hdr->signature,
+ OCFS1_VOLUME_SIGNATURE,
+ strlen(OCFS1_VOLUME_SIGNATURE)) != 0) {
+ printk("ocfs2: WARNING! attempting to write non "
+ "volume header to block 0\n");
+ return -EIO;
+ }
+ }
+
+ return 0;
+}
+
int ocfs_write_bhs (ocfs_super * osb, struct buffer_head *bhs[],
int nr, int flags, struct inode *inode)
{
Modified: trunk/src/buffer_head_io.h
===================================================================
--- trunk/src/buffer_head_io.h 2004-06-18 06:30:14 UTC (rev 1146)
+++ trunk/src/buffer_head_io.h 2004-06-18 15:24:20 UTC (rev 1147)
@@ -128,28 +128,6 @@
return ret;
}
-static inline int check_block_zero_write(struct buffer_head *bh)
-{
- if (unlikely(bh->b_blocknr == 0)) {
- ocfs_vol_disk_hdr *hdr = (ocfs_vol_disk_hdr *) bh->b_data;
-
- if (hdr == NULL) {
- printk ("ocfs2: failed to map bh page!!!\n");
- return -EIO;
- }
-
- if (memcmp(hdr->signature,
- OCFS_VOLUME_SIGNATURE,
- strlen(OCFS_VOLUME_SIGNATURE)) != 0) {
- printk("ocfs2: WARNING! attempting to write non "
- "volume header to block 0\n");
- return -EIO;
- }
- }
-
- return 0;
-}
-
#define OCFS_PRINT_FE_SIZE(bh) \
do { \
if (bh) { \
Modified: trunk/src/dlm.c
===================================================================
--- trunk/src/dlm.c 2004-06-18 06:30:14 UTC (rev 1146)
+++ trunk/src/dlm.c 2004-06-18 15:24:20 UTC (rev 1147)
@@ -1031,7 +1031,7 @@
#endif
curr_master = DISK_LOCK(fe)->dl_master;
- if (!IS_VALID_NODE_NUM (curr_master)) {
+ if (curr_master >= osb->max_nodes) {
LOG_ERROR_STATUS(status = -EINVAL);
goto finito;
}
Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c 2004-06-18 06:30:14 UTC (rev 1146)
+++ trunk/src/journal.c 2004-06-18 15:24:20 UTC (rev 1147)
@@ -1297,7 +1297,7 @@
LOG_ENTRY_ARGS("(node_num=%d, osb->node_num = %d)\n", node_num,
osb->node_num);
- if (!osb || !IS_VALID_NODE_NUM(node_num)) {
+ if (!osb || (node_num >= osb->max_nodes)) {
LOG_ERROR_STATUS (status = -EINVAL);
goto done;
}
Modified: trunk/src/ocfs.h
===================================================================
--- trunk/src/ocfs.h 2004-06-18 06:30:14 UTC (rev 1146)
+++ trunk/src/ocfs.h 2004-06-18 15:24:20 UTC (rev 1147)
@@ -64,8 +64,6 @@
-#define OCFS_POINTER_SIZE (sizeof(void *))
-
enum
{
OCFS_VOTE_REQUEST = 1,
@@ -128,8 +126,6 @@
#define OCFS_SET_INODE_TIME(i, x, y) (ocfs_get_seconds(i->x) = (y))
-#define ONE_MEGA_BYTE (1 * 1024 * 1024) /* in bytes */
-
#define MISS_COUNT_VALUE 30
/*
@@ -172,7 +168,6 @@
-#define OCFS_MAXIMUM_NODES 32
#define OCFS_MAX_OSB_ID 65536
@@ -291,8 +286,6 @@
#define BLOCKS_PER_CLEAN_LIST ( ((PAGE_SIZE-sizeof(void *))/sizeof(unsigned long)) >> 3 )
-#define IORUN_ALLOC_SIZE (OCFS_MAX_DATA_EXTENTS * sizeof (ocfs_io_runs))
-
#ifndef _OCFSDEF_H_
#define _OCFSDEF_H_
@@ -302,8 +295,6 @@
#define IS_VALID_EXTENT_BLOCK(ptr) \
(!strcmp((ptr)->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE))
-#define IS_VALID_NODE_NUM(node) \
- (((node) >= 0) && ((node) < OCFS_MAXIMUM_NODES))
#define down_with_flag(_sem, _flg) \
@@ -383,23 +374,9 @@
#define OCFS_NODEV NODEV
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-/* No longer exists in 2.5 */
-#define fsync_inode_buffers(inode) sync_mapping_buffers(inode->i_mapping)
-#endif /* >= 2.6.0 */
-
#define OCFS_SB(sb) ((ocfs_super *)OCFS_GENERIC_SB_MEMBER(sb))
-#define OCFS_MINOR_VERSION (0)
-#define OCFS_MAJOR_VERSION (2)
-#define OCFS_MINOR_VER_STRING "0"
-#define OCFS_MAJOR_VER_STRING "2"
-
-#define OCFS_VOLUME_SIGNATURE "OracleCFS"
-#define MAX_VOL_SIGNATURE_LEN 128
-#define MAX_MOUNT_POINT_LEN 128
-
#define DLOCK_FLAG_OPEN_MAP (0x1)
#define DLOCK_FLAG_LOCK (0x2)
#define DLOCK_FLAG_SEQ_NUM (0x4)
@@ -422,60 +399,6 @@
#include "ocfs2_fs.h"
-typedef struct _ocfs_vol_disk_hdr // CLASS
-{
- __u32 minor_version; // NUMBER RANGE(0,UINT_MAX)
- __u32 major_version; // NUMBER RANGE(0,UINT_MAX)
- __u8 signature[MAX_VOL_SIGNATURE_LEN]; // CHAR[MAX_VOL_SIGNATURE_LEN]
- __u8 mount_point[MAX_MOUNT_POINT_LEN]; // CHAR[MAX_MOUNT_POINT_LEN]
- __u64 serial_num; // NUMBER RANGE(0,ULONG_LONG_MAX)
- /* Size of the device in bytes */
- __u64 device_size; // NUMBER RANGE(0,ULONG_LONG_MAX)
- /* Start of the volume... typically 0 */
- __u64 start_off; // NUMBER RANGE(0,ULONG_LONG_MAX)
- /* Offset to Volume Bitmap... */
- __u64 bitmap_off; // NUMBER RANGE(0,ULONG_LONG_MAX)
- /* Offset to the Publish Sector */
- __u64 publ_off; // NUMBER RANGE(0,ULONG_LONG_MAX)
- /* Offset to the Vote Sector */
- __u64 vote_off; // NUMBER RANGE(0,ULONG_LONG_MAX)
- __u64 root_bitmap_off; // NUMBER RANGE(0,ULONG_LONG_MAX)
- __u64 data_start_off; // NUMBER RANGE(0,ULONG_LONG_MAX)
- __u64 root_bitmap_size; // NUMBER RANGE(0,ULONG_LONG_MAX)
- __u64 root_off; // NUMBER RANGE(0,ULONG_LONG_MAX)
- __u64 root_size; // NUMBER RANGE(0,ULONG_LONG_MAX)
- /* Cluster size as specified during format */
- __u64 cluster_size; // CLUSTERSIZE
- /* Max number of nodes.... OCFS_MAXIMUM_NODES */
- __u64 num_nodes; // NUMBER RANGE(0,32)
- /* Number of free clusters at format */
- __u64 num_clusters; // NUMBER RANGE(0,ULONG_LONG_MAX)
- /* OCFS_DEFAULT_FILE_NODE_SIZE */
- __u64 file_node_size; // NUMBER RANGE(0,ULONG_LONG_MAX)
- __u64 internal_off; // NUMBER RANGE(0,ULONG_LONG_MAX)
- /* Offset to Node Config */
- __u64 node_cfg_off; // NUMBER RANGE(0,ULONG_LONG_MAX)
- /* Size of Node Config */
- __u64 node_cfg_size; // NUMBER RANGE(0,ULONG_LONG_MAX)
- /* Offset to Node Config Lock */
- __u64 new_cfg_off; // NUMBER RANGE(0,ULONG_LONG_MAX)
- __u32 prot_bits; // PERMS
- __s32 excl_mount; // NODENUM
-}
-ocfs_vol_disk_hdr; // END CLASS
-
-typedef struct _ocfs_vol_label // CLASS
-{
- ocfs2_disk_lock disk_lock; // DISKLOCK
- __u8 label[MAX_VOL_LABEL_LEN]; // CHAR[MAX_VOL_LABEL_LEN]
- __u16 label_len; // NUMBER RANGE(0,MAX_VOL_LABEL_LEN)
- __u8 vol_id[MAX_VOL_ID_LENGTH]; // HEX[MAX_VOL_ID_LENGTH]
- __u16 vol_id_len; // NUMBER RANGE(0,MAX_VOL_ID_LENGTH)
- __u8 cluster_name[MAX_CLUSTER_NAME_LEN]; // CHAR[MAX_CLUSTER_NAME_LEN]
- __u16 cluster_name_len; // NUMBER RANGE(0,MAX_CLUSTER_NAME_LEN)
-}
-ocfs_vol_label; // END CLASS
-
typedef struct _BARF_BARF_BARF
{
char node_name[MAX_NODE_NAME_LENGTH];
@@ -514,7 +437,6 @@
typedef struct _ocfs_super ocfs_super;
-typedef struct _ocfs_io_runs ocfs_io_runs;
typedef struct _ocfs_lock_res ocfs_lock_res;
/* this limits us to 256 nodes
@@ -588,7 +510,6 @@
/* stolen right off of ocfs2_dinode */
union {
__u64 fe_private;
- __u64 child_dirnode;
struct _ip_bitinfo {
__u32 used_bits;
__u32 total_bits;
@@ -621,7 +542,7 @@
#define GET_INODE_CLEAN_SEQ(i) (atomic_t *)(&(OCFS_I(i)->ip_clean_buffer_seq))
-#define IS_SYSTEM_FILE_INODE(i) ((i) && (OCFS_I(i)->ip_flags & OCFS_INODE_SYSTEM_FILE))
+#define IS_SYSTEM_FILE_INODE(i) (OCFS_I(i)->ip_flags & OCFS_INODE_SYSTEM_FILE)
#define INODE_DELETED(i) (OCFS_I(i)->ip_flags & OCFS_INODE_DELETED)
@@ -695,9 +616,7 @@
atomic_t ext_extends;
} ocfs_alloc_stats;
-extern char *system_file_names[];
-
struct _ocfs_journal;
/*
@@ -834,13 +753,6 @@
}
ocfs_global_ctxt;
-struct _ocfs_io_runs
-{
- __u64 disk_off;
- __u32 offset;
- __u32 byte_cnt;
-};
-
typedef struct _ocfs_ipc_ctxt
{
__u32 dlm_msg_size;
@@ -1044,9 +956,6 @@
/* these three used as 'type' in ocfs_bitmap_update */
-#if 0
-#define DISK_ALLOC_DIR_NODE 1
-#endif
#define DISK_ALLOC_EXTENT_NODE 2
#define DISK_ALLOC_VOLUME 3
#define DISK_ALLOC_INODE 4
Modified: trunk/src/ocfs_compat.h
===================================================================
--- trunk/src/ocfs_compat.h 2004-06-18 06:30:14 UTC (rev 1146)
+++ trunk/src/ocfs_compat.h 2004-06-18 15:24:20 UTC (rev 1147)
@@ -105,6 +105,9 @@
#define ocfs_get_seconds(t) ((t).tv_sec)
+#define fsync_inode_buffers(inode) \
+ sync_mapping_buffers((inode)->i_mapping)
+
#endif /* LINUX_VERSION_CODE < 2.6 */
#ifndef BITS_TO_LONGS
Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c 2004-06-18 06:30:14 UTC (rev 1146)
+++ trunk/src/super.c 2004-06-18 15:24:20 UTC (rev 1147)
@@ -812,7 +812,7 @@
NULL, NULL);
OcfsGlobalCtxt.extent_cache = kmem_cache_create ("ocfs2_extent",
- sizeof(ocfs_extent) + OCFS_POINTER_SIZE, 0, SLAB_NO_REAP | SLAB_HWCACHE_ALIGN,
+ sizeof(ocfs_extent) + sizeof(void*), 0, SLAB_NO_REAP | SLAB_HWCACHE_ALIGN,
NULL, NULL);
OCFS_SET_FLAG (OcfsGlobalCtxt.flags, OCFS_FLAG_MEM_LISTS_INITIALIZED);
More information about the Ocfs2-commits
mailing list