[Ocfs2-tools-commits] jlbec commits r474 - in trunk: clusterbo
debugfs.ocfs2 debugfs.ocfs2/include extras fsck.ocfs2
fsck.ocfs2/include fswreck fswreck/include libocfs2
libocfs2/include listuuid mkfs.ocfs2 mount.ocfs2
mounted.ocfs2 tunefs.ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Dec 9 17:14:04 CST 2004
Author: jlbec
Date: 2004-12-09 17:14:02 -0600 (Thu, 09 Dec 2004)
New Revision: 474
Removed:
trunk/libocfs2/include/ocfs2_disk_dlm.h
Modified:
trunk/clusterbo/
trunk/debugfs.ocfs2/commands.c
trunk/debugfs.ocfs2/dump.c
trunk/debugfs.ocfs2/include/dump.h
trunk/debugfs.ocfs2/include/main.h
trunk/debugfs.ocfs2/readfs.c
trunk/extras/set_random_bits.c
trunk/fsck.ocfs2/fsck.c
trunk/fsck.ocfs2/include/fsck.h
trunk/fsck.ocfs2/include/journal.h
trunk/fsck.ocfs2/journal.c
trunk/fswreck/corrupt.c
trunk/fswreck/include/main.h
trunk/libocfs2/Makefile
trunk/libocfs2/alloc.c
trunk/libocfs2/checkhb.c
trunk/libocfs2/extend_file.c
trunk/libocfs2/include/ocfs2.h
trunk/libocfs2/include/ocfs2_fs.h
trunk/listuuid/
trunk/listuuid/listuuid.c
trunk/mkfs.ocfs2/mkfs.c
trunk/mount.ocfs2/
trunk/mount.ocfs2/mount.ocfs2.c
trunk/mounted.ocfs2/
trunk/mounted.ocfs2/mounted.c
trunk/tunefs.ocfs2/tunefs.c
Log:
o Sync up the kernel ocfs2_fs.h structures with userspace.
o Fix all the programs that try to reference the old disk dlm areas.
o The heartbeat check code is just removed. We need new code for the
new heartbeat.
Property changes on: trunk/clusterbo
___________________________________________________________________
Name: svn:ignore
+ .*.sw?
clusterbo
Modified: trunk/debugfs.ocfs2/commands.c
===================================================================
--- trunk/debugfs.ocfs2/commands.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/debugfs.ocfs2/commands.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -338,7 +338,7 @@
/* lookup heartbeat file */
snprintf (sysfile, sizeof(sysfile),
- sysfile_info[HEARTBEAT_SYSTEM_INODE].name);
+ ocfs2_system_inodes[HEARTBEAT_SYSTEM_INODE].si_name);
ret = ocfs2_lookup(gbls.fs, gbls.sysdir_blkno, sysfile,
strlen(sysfile), NULL, &gbls.hb_blkno);
if (ret)
@@ -347,7 +347,7 @@
/* lookup journal files */
for (i = 0; i < sb->s_max_nodes; ++i) {
snprintf (sysfile, sizeof(sysfile),
- sysfile_info[JOURNAL_SYSTEM_INODE].name, i);
+ ocfs2_system_inodes[JOURNAL_SYSTEM_INODE].si_name, i);
ret = ocfs2_lookup(gbls.fs, gbls.sysdir_blkno, sysfile,
strlen(sysfile), NULL, &gbls.jrnl_blkno[i]);
if (ret)
@@ -655,14 +655,7 @@
goto bail;
}
- if (!strcasecmp(args[0], "nodes"))
- dump_func = dump_config;
- else if (!strcasecmp(args[0], "publish"))
- dump_func = dump_publish;
- else if (!strcasecmp(args[0], "vote"))
- dump_func = dump_vote;
- else
- DBGFS_FATAL("internal");
+ DBGFS_FATAL("internal");
ret = ocfs2_read_whole_file(gbls.fs, gbls.hb_blkno, &hbbuf, &len);
if (ret) {
Modified: trunk/debugfs.ocfs2/dump.c
===================================================================
--- trunk/debugfs.ocfs2/dump.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/debugfs.ocfs2/dump.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -155,8 +155,6 @@
fprintf(out, "\tLinks: %u Clusters: %u\n", in->i_links_count, in->i_clusters);
- dump_disk_lock (out, &(in->i_disk_lock));
-
str = ctime((time_t*)&in->i_ctime);
fprintf(out, "\tctime: 0x%"PRIx64" -- %s", in->i_ctime, str);
str = ctime((time_t*)&in->i_atime);
@@ -184,18 +182,7 @@
return ;
} /* dump_inode */
-/*
- * dump_disk_lock()
- *
- */
-void dump_disk_lock (FILE *out, ocfs2_disk_lock *dl)
-{
- fprintf(out, "\tLock Master: %u Level: 0x%0x\n",
- dl->dl_master, dl->dl_level);
- return ;
-} /* dump_disk_lock */
-
/*
* dump_chain_list()
*
@@ -309,130 +296,6 @@
}
/*
- * dump_config()
- *
- */
-void dump_config (FILE *out, char *buf)
-{
- char *p;
- ocfs_node_config_hdr *hdr;
- ocfs_node_config_info *node;
- ocfs2_super_block *sb = OCFS2_RAW_SB(gbls.fs->fs_super);
- __u16 port;
- char addr[32];
- struct in_addr ina;
- int i, j;
-
- hdr = (ocfs_node_config_hdr *)buf;
-
- fprintf(out, "\tVersion: %u Num Nodes: %u Last Node: %u "
- "Seqnum: %"PRIu64"\n",
- hdr->version, hdr->num_nodes, hdr->last_node, hdr->cfg_seq_num);
-
- dump_disk_lock (out, &(hdr->disk_lock));
-
- fprintf(out, "\t%-3s %-32s %-15s %-6s %s\n",
- "###", "Name", "IP Address", "Port", "UUID");
-
- p = buf + (2 << sb->s_blocksize_bits);
- for (i = 0; i < sb->s_max_nodes; ++i) {
- node = (ocfs_node_config_info *)p;
- if (!*node->node_name)
- continue;
-
- port = htonl(node->ipc_config.ip_port);
-
- ina.s_addr = node->ipc_config.addr_u.ip_addr4;
- strcpy (addr, inet_ntoa(ina));
-
- fprintf(out, "\t%3u %-32s %-15s %-6u ", i, node->node_name,
- addr, port);
- for (j = 0; j < OCFS2_GUID_LEN; j++)
- fprintf(out, "%c", node->guid.guid[j]);
- fprintf(out, "\n");
- p += (1 << sb->s_blocksize_bits);
- }
-
- return ;
-} /* dump_config */
-
-/*
- * dump_publish()
- *
- */
-void dump_publish (FILE *out, char *buf)
-{
- ocfs_publish *pub;
- char *p;
- GString *pub_flag;
- ocfs2_super_block *sb = OCFS2_RAW_SB(gbls.fs->fs_super);
- __u32 i, j;
-
- fprintf(out, "\t%-3s %-3s %-3s %-3s %-15s %-15s %-15s %-15s %-*s %-s\n",
- "###", "Mnt", "Vot", "Dty", "LockId", "Seq", "Comm Seq", "Time",
- sb->s_max_nodes, "Map", "Type");
-
- p = buf + ((2 + 4 + sb->s_max_nodes) << sb->s_blocksize_bits);
- for (i = 0; i < sb->s_max_nodes; ++i) {
- pub = (ocfs_publish *)p;
-
- pub_flag = g_string_new (NULL);
- get_publish_flag (pub->vote_type, pub_flag);
-
- fprintf(out, "\t%3d %1u %1u %1u %-15"PRIu64" "
- "%-15"PRIu64" %-15"PRIu64" %-15"PRIu64" ",
- i, pub->mounted, pub->vote, pub->dirty, pub->lock_id,
- pub->publ_seq_num, pub->comm_seq_num, pub->time);
-
- for (j = 0; j < sb->s_max_nodes; j++)
- fprintf (out, "%d",
- ((pub->vote_map[j / sizeof(pub->vote_map[0])] &
- (1 << (j % sizeof(pub->vote_map[0])))) ? 1 : 0));
-
- fprintf(out, " %-s\n", pub_flag->str);
-
- g_string_free (pub_flag, 1);
-
- p += (1 << sb->s_blocksize_bits);
- }
-
- return ;
-} /* dump_publish */
-
-/*
- * dump_vote()
- *
- */
-void dump_vote (FILE *out, char *buf)
-{
- ocfs_vote *vote;
- char *p;
- GString *vote_flag;
- ocfs2_super_block *sb = OCFS2_RAW_SB(gbls.fs->fs_super);
- __u32 i;
-
- fprintf(out, "\t%-3s %-2s %-1s %-15s %-15s %-s\n",
- "###", "NV", "O", "LockId", "Seq", "Type");
-
- p = buf + ((2 + 4 + sb->s_max_nodes + sb->s_max_nodes) << sb->s_blocksize_bits);
- for (i = 0; i < sb->s_max_nodes; ++i) {
- vote = (ocfs_vote *)p;
-
- vote_flag = g_string_new (NULL);
- get_vote_flag (vote->type, vote_flag);
-
- fprintf(out, "\t%3u %-2u %-1u %-15"PRIu64" %-15"PRIu64" %-s\n", i,
- vote->node, vote->open_handle, vote->lock_id,
- vote->vote_seq_num, vote_flag->str);
-
- g_string_free (vote_flag, 1);
- p += (1 << sb->s_blocksize_bits);
- }
-
- return ;
-} /* dump_vote */
-
-/*
* dump_jbd_header()
*
*/
Modified: trunk/debugfs.ocfs2/include/dump.h
===================================================================
--- trunk/debugfs.ocfs2/include/dump.h 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/debugfs.ocfs2/include/dump.h 2004-12-09 23:14:02 UTC (rev 474)
@@ -29,16 +29,12 @@
void dump_super_block (FILE *out, ocfs2_super_block *sb);
void dump_local_alloc (FILE *out, ocfs2_local_alloc *loc);
void dump_inode (FILE *out, ocfs2_dinode *in);
-void dump_disk_lock (FILE *out, ocfs2_disk_lock *dl);
void dump_extent_list (FILE *out, ocfs2_extent_list *ext);
void dump_chain_list (FILE *out, ocfs2_chain_list *cl);
void dump_extent_block (FILE *out, ocfs2_extent_block *blk);
void dump_group_descriptor (FILE *out, ocfs2_group_desc *grp, int index);
int dump_dir_entry (struct ocfs2_dir_entry *rec, int offset, int blocksize,
char *buf, void *priv_data);
-void dump_config (FILE *out, char *buf);
-void dump_publish (FILE *out, char *buf);
-void dump_vote (FILE *out, char *buf);
void dump_jbd_header (FILE *out, journal_header_t *header);
void dump_jbd_superblock (FILE *out, journal_superblock_t *jsb);
void dump_jbd_block (FILE *out, journal_header_t *header, __u64 blknum);
Modified: trunk/debugfs.ocfs2/include/main.h
===================================================================
--- trunk/debugfs.ocfs2/include/main.h 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/debugfs.ocfs2/include/main.h 2004-12-09 23:14:02 UTC (rev 474)
@@ -57,7 +57,6 @@
#include "ocfs2.h"
#include "ocfs2_fs.h"
-#include "ocfs2_disk_dlm.h"
#include "ocfs1_fs_compat.h"
enum {
Modified: trunk/debugfs.ocfs2/readfs.c
===================================================================
--- trunk/debugfs.ocfs2/readfs.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/debugfs.ocfs2/readfs.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -264,8 +264,8 @@
ocfs2_dinode *inode;
struct ocfs2_dir_entry *rec;
GArray *dirarr = NULL;
- char *hb = sysfile_info[HEARTBEAT_SYSTEM_INODE].name;
- char *gblbm = sysfile_info[GLOBAL_BITMAP_SYSTEM_INODE].name;
+ char *hb = ocfs2_system_inodes[HEARTBEAT_SYSTEM_INODE].si_name;
+ char *gblbm = ocfs2_system_inodes[GLOBAL_BITMAP_SYSTEM_INODE].si_name;
unsigned int i, j;
char *journal[256];
ocfs2_super_block *sb = &((gbls.superblk)->id2.i_super);
@@ -285,7 +285,7 @@
/* generate journal sysfile names */
for (i = 0; i < sb->s_max_nodes; ++i) {
snprintf (tmpstr, sizeof(tmpstr),
- sysfile_info[JOURNAL_SYSTEM_INODE].name, i);
+ ocfs2_system_inodes[JOURNAL_SYSTEM_INODE].si_name, i);
journal[i] = strdup (tmpstr);
gbls.journal_blkno[i] = 0;
}
Modified: trunk/extras/set_random_bits.c
===================================================================
--- trunk/extras/set_random_bits.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/extras/set_random_bits.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -107,7 +107,7 @@
uint64_t blkno, sys_blkno;
int c;
char *filename, *buf;
- const char *bitmap_name = sysfile_info[GLOBAL_BITMAP_SYSTEM_INODE].name;
+ const char *bitmap_name = ocfs2_system_inodes[GLOBAL_BITMAP_SYSTEM_INODE].si_name;
ocfs2_filesys *fs;
ocfs2_dinode *di;
struct walk_block wb;
Modified: trunk/fsck.ocfs2/fsck.c
===================================================================
--- trunk/fsck.ocfs2/fsck.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/fsck.ocfs2/fsck.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -359,8 +359,7 @@
errcode_t ret = 0;
char *whoami = __FUNCTION__;
- ret = o2fsck_should_replay_journals(ost->ost_fs, ost->ost_publish,
- &should);
+ ret = o2fsck_should_replay_journals(ost->ost_fs, &should);
if (ret)
goto out;
if (!should)
@@ -380,8 +379,7 @@
/* journal replay is careful not to use ost as we only really
* build it up after spraying the journal all over the disk
* and reopening */
- ret = o2fsck_replay_journals(ost->ost_fs, ost->ost_publish,
- &replayed);
+ ret = o2fsck_replay_journals(ost->ost_fs, &replayed);
if (ret)
goto out;
Modified: trunk/fsck.ocfs2/include/fsck.h
===================================================================
--- trunk/fsck.ocfs2/include/fsck.h 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/fsck.ocfs2/include/fsck.h 2004-12-09 23:14:02 UTC (rev 474)
@@ -26,7 +26,6 @@
#include "icount.h"
#include "dirblocks.h"
-#include "ocfs2_disk_dlm.h"
typedef struct _o2fsck_state {
ocfs2_filesys *ost_fs;
@@ -50,8 +49,6 @@
* entries, including '.' and '..'. */
o2fsck_icount *ost_icount_refs;
- ocfs_publish *ost_publish;
-
o2fsck_dirblocks ost_dirblocks;
uint32_t ost_fs_generation;
Modified: trunk/fsck.ocfs2/include/journal.h
===================================================================
--- trunk/fsck.ocfs2/include/journal.h 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/fsck.ocfs2/include/journal.h 2004-12-09 23:14:02 UTC (rev 474)
@@ -26,10 +26,8 @@
#include "fsck.h"
-errcode_t o2fsck_replay_journals(ocfs2_filesys *fs, ocfs_publish *pub,
- int *replayed);
-errcode_t o2fsck_should_replay_journals(ocfs2_filesys *fs, ocfs_publish *pub,
- int *should);
+errcode_t o2fsck_replay_journals(ocfs2_filesys *fs, int *replayed);
+errcode_t o2fsck_should_replay_journals(ocfs2_filesys *fs, int *should);
#endif /* __O2FSCK_JOURNAL_H__ */
Modified: trunk/fsck.ocfs2/journal.c
===================================================================
--- trunk/fsck.ocfs2/journal.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/fsck.ocfs2/journal.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -477,6 +477,11 @@
goto out;
}
+ if (ji->ji_cinode->ci_inode->id1.journal1.ij_flags & OCFS2_JOURNAL_DIRTY_FL) {
+ ji->ji_replay = 0;
+ goto out;
+ }
+
err = ocfs2_extent_map_init(fs, ji->ji_cinode);
if (err) {
com_err(whoami, err, "while initializing extent map");
@@ -504,8 +509,7 @@
return err;
}
-errcode_t o2fsck_should_replay_journals(ocfs2_filesys *fs, ocfs_publish *pub,
- int *should)
+errcode_t o2fsck_should_replay_journals(ocfs2_filesys *fs, int *should)
{
uint16_t i, max_nodes;
ocfs2_dinode *di;
@@ -542,9 +546,9 @@
}
verbosef("node %d JOURNAL_DIRTY_FL: %d\n", i,
- di->id1.journal1.i_flags & OCFS2_JOURNAL_DIRTY_FL);
+ di->id1.journal1.ij_flags & OCFS2_JOURNAL_DIRTY_FL);
- if (di->id1.journal1.i_flags & OCFS2_JOURNAL_DIRTY_FL)
+ if (di->id1.journal1.ij_flags & OCFS2_JOURNAL_DIRTY_FL)
*should = 1;
}
@@ -557,8 +561,7 @@
/* Try and replay the nodes journals if they're dirty. This only returns
* a non-zero error if the caller should not continue. */
-errcode_t o2fsck_replay_journals(ocfs2_filesys *fs, ocfs_publish *pub,
- int *replayed)
+errcode_t o2fsck_replay_journals(ocfs2_filesys *fs, int *replayed)
{
errcode_t err = 0, ret = 0;
struct journal_info *jis, *ji;
@@ -594,16 +597,20 @@
printf("Checking each node's journal.\n");
for (i = 0, ji = jis; i < max_nodes; i++, ji++) {
- if (!pub[i].mounted) {
- verbosef("node %d is clean\n", i);
- continue;
- }
ji->ji_replay = 1;
ji->ji_used_blocks = used_blocks;
err = prep_journal_info(fs, i, ji);
- if (err == 0)
+ if (err == 0) {
+ /* Will only be modified in prep_journal_info()
+ * if 0 is returned */
+ if (!ji->ji_replay) {
+ verbosef("node %d is clean\n", i);
+ continue;
+ }
+
err = walk_journal(fs, i, ji, buf, 0);
+ }
if (err) {
ji->ji_replay = 0;
Modified: trunk/fswreck/corrupt.c
===================================================================
--- trunk/fswreck/corrupt.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/fswreck/corrupt.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -49,20 +49,20 @@
case 11:
case 12:
snprintf(sysfile, sizeof(sysfile),
- sysfile_info[GLOBAL_BITMAP_SYSTEM_INODE].name);
+ ocfs2_system_inodes[GLOBAL_BITMAP_SYSTEM_INODE].si_name);
break;
#ifdef _LATER_
case X:
snprintf(sysfile, sizeof(sysfile),
- sysfile_info[GLOBAL_INODE_ALLOC_SYSTEM_INODE].name);
+ ocfs2_system_inodes[GLOBAL_INODE_ALLOC_SYSTEM_INODE].si_name);
break;
case Y:
snprintf(sysfile, sizeof(sysfile),
- sysfile_info[EXTENT_ALLOC_SYSTEM_INODE].name, nodenum);
+ ocfs2_system_inodes[EXTENT_ALLOC_SYSTEM_INODE].si_name, nodenum);
break;
case Z:
snprintf(sysfile, sizeof(sysfile),
- sysfile_info[INODE_ALLOC_SYSTEM_INODE].name, nodenum);
+ ocfs2_system_inodes[INODE_ALLOC_SYSTEM_INODE].si_name, nodenum);
break;
#endif
default:
Modified: trunk/fswreck/include/main.h
===================================================================
--- trunk/fswreck/include/main.h 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/fswreck/include/main.h 2004-12-09 23:14:02 UTC (rev 474)
@@ -54,7 +54,6 @@
#include "ocfs2.h"
#include "ocfs2_fs.h"
-#include "ocfs2_disk_dlm.h"
#include "ocfs1_fs_compat.h"
#define FSWRK_FATAL(fmt, arg...) ({ fprintf(stderr, "ERROR at %s, %d: " fmt ". EXITING!!!\n", \
Modified: trunk/libocfs2/Makefile
===================================================================
--- trunk/libocfs2/Makefile 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/libocfs2/Makefile 2004-12-09 23:14:02 UTC (rev 474)
@@ -75,7 +75,6 @@
include/kernel-list.h \
include/kernel-rbtree.h \
include/ocfs2_fs.h \
- include/ocfs2_disk_dlm.h \
include/ocfs1_fs_compat.h \
include/byteorder.h \
include/ocfs2.h \
Modified: trunk/libocfs2/alloc.c
===================================================================
--- trunk/libocfs2/alloc.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/libocfs2/alloc.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -356,6 +356,10 @@
* "find_clear_bit_range()" function for the bitmaps.
*
* XXX what to do about local allocs?
+ * XXX Well, we shouldn't use local allocs to allocate, as we are
+ * userspace and we have the entire bitmap in memory. However, this
+ * doesn't solve the issue of "is space still in dirty local
+ * allocs?"
*/
errcode_t ocfs2_new_clusters(ocfs2_filesys *fs,
uint32_t requested,
Modified: trunk/libocfs2/checkhb.c
===================================================================
--- trunk/libocfs2/checkhb.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/libocfs2/checkhb.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -37,9 +37,10 @@
#include "ocfs2.h"
#include "ocfs2_fs.h"
-#include "ocfs2_disk_dlm.h"
#include "ocfs1_fs_compat.h"
+#warning checkbh DOES NOT WORK. It needs a rewrite.
+#if 0
typedef struct _ocfs2_fs {
ocfs2_filesys *fs;
@@ -83,10 +84,15 @@
* List of live nodes
*
*/
+#endif /* 0 */
errcode_t ocfs2_check_heartbeat(char *device, int quick_detect,
int *mount_flags, struct list_head *nodes_list,
ocfs2_chb_notify notify, void *user_data)
{
+ return OCFS2_ET_INTERNAL_FAILURE;
+}
+#if 0
+{
errcode_t ret = 0;
struct list_head dev_list;
struct list_head *pos1, *pos2, *pos3, *pos4;
@@ -147,9 +153,14 @@
* ocfs2_check_heartbeats()
*
*/
+#endif /* 0 */
errcode_t ocfs2_check_heartbeats(struct list_head *dev_list, int quick_detect,
ocfs2_chb_notify notify, void *user_data)
{
+ return OCFS2_ET_INTERNAL_FAILURE;
+}
+#if 0
+{
ocfs2_filesys *fs = NULL;
errcode_t ret = 0;
uint16_t num_nodes;
@@ -352,7 +363,7 @@
int first_time)
{
ocfs2_filesys *fs = fs_blk->fs;
- char *hb = sysfile_info[HEARTBEAT_SYSTEM_INODE].name;
+ char *hb = ocfs2_system_inodes[HEARTBEAT_SYSTEM_INODE].si_name;
char *buf = NULL;
int buflen = 0;
errcode_t ret = 0;
@@ -504,3 +515,4 @@
close(fd);
return ret;
}
+#endif /* 0 */
Modified: trunk/libocfs2/extend_file.c
===================================================================
--- trunk/libocfs2/extend_file.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/libocfs2/extend_file.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -74,6 +74,7 @@
if (ret)
goto out;
+ /* This is written at the end by insert_extent() */
ctxt->di->i_last_eb_blk = eb->h_blkno;
out:
Modified: trunk/libocfs2/include/ocfs2.h
===================================================================
--- trunk/libocfs2/include/ocfs2.h 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/libocfs2/include/ocfs2.h 2004-12-09 23:14:02 UTC (rev 474)
@@ -201,6 +201,9 @@
ocfs2_bitmap *ci_chains;
};
+/* FIXME: this is totally bogus now. Userspace needs to change
+ * its heartbeat checking */
+#define MAX_NODE_NAME_LENGTH 32
struct _ocfs2_nodes {
struct list_head list;
char node_name[MAX_NODE_NAME_LENGTH+1];
Deleted: trunk/libocfs2/include/ocfs2_disk_dlm.h
===================================================================
--- trunk/libocfs2/include/ocfs2_disk_dlm.h 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/libocfs2/include/ocfs2_disk_dlm.h 2004-12-09 23:14:02 UTC (rev 474)
@@ -1,132 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * ocfs2_disk_dlm.h
- *
- * On-disk structures involved in disk publish/vote for OCFS2.
- *
- * Copyright (C) 2002, 2004 Oracle. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License, version 2, as published by the Free Software Foundation.
- *
- * This program 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 this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- *
- * Authors: Kurt Hackel, Mark Fasheh, Sunil Mushran, Wim Coekaerts,
- * Manish Singh, Joel Becker
- */
-
-#ifndef _OCFS2_DISK_DLM_H
-#define _OCFS2_DISK_DLM_H
-
-/*
- * On-disk IPC configuration for an OCFS2 node.
- */
-typedef struct _ocfs_ipc_config_info
-{
-/*00*/ __u16 ip_version; /* IP version in NBO */
- __u16 ip_port; /* IP port in NBO */
- __u32 ip_reserved1;
- __u64 ip_reserved2;
-/*10*/ union {
- __u32 ip_addr4; /* IPv4 address in NBO */
- __u32 ip_addr6[4]; /* IPv6 address in NBO */
- } addr_u;
-/*20*/
-} ocfs_ipc_config_info;
-
-/*
- * On-disk structure representing a Global Unique ID for an OCFS2 node.
- *
- * The GUID has two parts. The host_id is a generally-randomly-unique
- * hex-as-ascii string of 20 characters (10 bytes). The mad_id field
- * is, unsurprisingly, the MAC address of the network card that the
- * IPC mechanism will be using (the address in
- * ocfs_ipc_config_info.addr_u). This should (ha-ha) provide a unique
- * identifier for a node in the OCFS2 cluster. It has the added
- * benefit of detecting when a node has changed network cards
- * (host_id is the same, mac_id has changed) or when an identical
- * mac address is on a different mode (the converse).
- */
-typedef union _ocfs_guid
-{
-/*00*/ struct
- {
- char host_id[OCFS2_GUID_HOSTID_LEN];
- char mac_id[OCFS2_GUID_MACID_LEN];
- } id;
- __u8 guid[OCFS2_GUID_LEN];
-/*20*/
-} ocfs_guid;
-
-/*
- * On-disk configuration information for an OCFS2 node. A node
- * populates its own info for other nodes to read and use.
- */
-typedef struct _ocfs_node_config_info
-{
-/*00*/ ocfs2_disk_lock disk_lock; /* Lock on the info */
-/*30*/ ocfs_guid guid; /* GUID */
-/*50*/ ocfs_ipc_config_info ipc_config; /* IPC info */
-/*70*/ __u8 node_name[MAX_NODE_NAME_LENGTH+1]; /* Name */
-/*91*/ __u8 name_pad[7]; /* Pad to align (UGH) */
-/*98*/
-} ocfs_node_config_info;
-
-/*
- * On-disk ... for OCFS2. FIXME this description.
- */
-typedef struct _ocfs_node_config_hdr
-{
-/*00*/ ocfs2_disk_lock disk_lock;
-/*30*/ __u8 signature[OCFS2_NODE_CONFIG_SIGN_LEN];
- __u32 version;
- __u16 num_nodes;
- __u16 reserved1;
-/*40*/ __u32 last_node;
- __u32 onch_pad;
- __u64 cfg_seq_num;
-/*50*/
-} ocfs_node_config_hdr;
-
-/*
- * On-disk lock / state change request for OCFS2.
- */
-typedef struct _ocfs_publish
-{
-/*00*/ __u64 time; /* Time of publish */
- __s32 vote;
- __u32 dirty; /* Is the node in a clean state */
-/*10*/ __u32 vote_type; /* Type required */
- __u32 mounted; /* Does the publisher have it mounted */
-/*18*/ __u32 vote_map[8]; /* Who needs to vote */
-/*38*/ __u64 reserved1;
-/*50*/ __u64 publ_seq_num; /* Sequence for vote */
- __u64 lock_id; /* Lock vote is requested for */
- /* last seq num used in comm voting */
-/*60*/ __u64 comm_seq_num;
-/*68*/
-} ocfs_publish;
-
-typedef struct _ocfs_vote
-{
-/*00*/ __u8 type; /* Vote type */
- __u8 node; /* Node voting */
- __u8 reserved1[30]; /* used to be vote[32] */
-/*20*/ __u64 vote_seq_num; /* Vote sequence */
- __u64 lock_id; /* Lock being voted on */
-/*30*/ __u8 open_handle; /* Does the voter have it open */
- __u8 ov_pad[7];
-/*38*/
-} ocfs_vote;
-
-#endif /* _OCFS2_DISK_DLM_H */
Modified: trunk/libocfs2/include/ocfs2_fs.h
===================================================================
--- trunk/libocfs2/include/ocfs2_fs.h 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/libocfs2/include/ocfs2_fs.h 2004-12-09 23:14:02 UTC (rev 474)
@@ -121,11 +121,11 @@
#define OCFS2_DEFAULT_JOURNAL_SIZE (8 * ONE_MEGA_BYTE)
#define OCFS2_MIN_JOURNAL_SIZE (4 * ONE_MEGA_BYTE)
-typedef struct _ocfs2_sysfile_info {
- char *name;
- int flags;
- int dir;
-} ocfs2_sysfile_info;
+struct ocfs2_system_inode_info {
+ char *si_name;
+ int si_flags;
+ int si_mode;
+};
/* System file index */
enum {
@@ -144,23 +144,23 @@
NUM_SYSTEM_INODES
};
-static ocfs2_sysfile_info sysfile_info[NUM_SYSTEM_INODES] = {
+static struct ocfs2_system_inode_info ocfs2_system_inodes[NUM_SYSTEM_INODES] = {
/* Global system inodes (single copy) */
/* The first two are only used from userspace mfks/tunefs */
- [BAD_BLOCK_SYSTEM_INODE] { "bad_blocks", 0, 0 },
- [GLOBAL_INODE_ALLOC_SYSTEM_INODE] { "global_inode_alloc", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, 0 },
+ [BAD_BLOCK_SYSTEM_INODE] { "bad_blocks", 0, S_IFREG | 0644 },
+ [GLOBAL_INODE_ALLOC_SYSTEM_INODE] { "global_inode_alloc", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
/* These are used by the running filesystem */
- [SLOT_MAP_SYSTEM_INODE] { "slot_map", 0, 0 },
- [HEARTBEAT_SYSTEM_INODE] { "heartbeat", OCFS2_HEARTBEAT_FL, 0 },
- [GLOBAL_BITMAP_SYSTEM_INODE] { "global_bitmap", 0, 0 },
- [ORPHAN_DIR_SYSTEM_INODE] { "orphan_dir", 0, 1 },
+ [SLOT_MAP_SYSTEM_INODE] { "slot_map", 0, S_IFREG | 0644 },
+ [HEARTBEAT_SYSTEM_INODE] { "heartbeat", OCFS2_HEARTBEAT_FL, S_IFREG | 0644 },
+ [GLOBAL_BITMAP_SYSTEM_INODE] { "global_bitmap", 0, S_IFREG | 0644 },
+ [ORPHAN_DIR_SYSTEM_INODE] { "orphan_dir", 0, S_IFDIR | 0755 },
/* Node-specific system inodes (one copy per node) */
- [EXTENT_ALLOC_SYSTEM_INODE] { "extent_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, 0 },
- [INODE_ALLOC_SYSTEM_INODE] { "inode_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, 0 },
- [JOURNAL_SYSTEM_INODE] { "journal:%04d", OCFS2_JOURNAL_FL, 0 },
- [LOCAL_ALLOC_SYSTEM_INODE] { "local_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_LOCAL_ALLOC_FL, 0 }
+ [EXTENT_ALLOC_SYSTEM_INODE] { "extent_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
+ [INODE_ALLOC_SYSTEM_INODE] { "inode_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_CHAIN_FL, S_IFREG | 0644 },
+ [JOURNAL_SYSTEM_INODE] { "journal:%04d", OCFS2_JOURNAL_FL, S_IFREG | 0644 },
+ [LOCAL_ALLOC_SYSTEM_INODE] { "local_alloc:%04d", OCFS2_BITMAP_FL | OCFS2_LOCAL_ALLOC_FL, S_IFREG | 0644 }
};
@@ -209,23 +209,9 @@
* Convenience casts
*/
#define OCFS2_RAW_SB(dinode) (&((dinode)->id2.i_super))
-#define DISK_LOCK(dinode) (&((dinode)->i_disk_lock))
#define LOCAL_ALLOC(dinode) (&((dinode)->id2.i_lab))
-/* TODO: change these? */
-#define OCFS2_NODE_CONFIG_HDR_SIGN "NODECFG"
-#define OCFS2_NODE_CONFIG_SIGN_LEN 8
-#define OCFS2_NODE_CONFIG_VER 2
-#define OCFS2_NODE_MIN_SUPPORTED_VER 2
-#define MAX_NODE_NAME_LENGTH 32
-
-#define OCFS2_GUID_HOSTID_LEN 20
-#define OCFS2_GUID_MACID_LEN 12
-#define OCFS2_GUID_LEN (OCFS2_GUID_HOSTID_LEN + OCFS2_GUID_MACID_LEN)
-
-
-
/*
* On disk extent record for OCFS2
* It describes a range of clusters on disk.
@@ -298,17 +284,6 @@
} ocfs2_extent_block;
/*
- * On disk lock structure for OCFS2
- */
-typedef struct _ocfs2_disk_lock
-{
-/*00*/ __s16 dl_master; /* Node number of current master */
- __u8 dl_level; /* Lock level */
- __u8 dl_reserved1;
-/*04*/
-} 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.
@@ -367,9 +342,9 @@
belongs to */
__u16 i_suballoc_bit; /* Bit offset in suballocater
block group */
- __u32 i_reserved0;
-/*14*/ __u32 i_clusters; /* Cluster count */
-/*18*/ __u32 i_uid; /* Owner UID */
+/*10*/ __u32 i_reserved0;
+ __u32 i_clusters; /* Cluster count */
+ __u32 i_uid; /* Owner UID */
__u32 i_gid; /* Owning GID */
/*20*/ __u64 i_size; /* Size in bytes */
__u16 i_mode; /* File mode */
@@ -399,8 +374,8 @@
} bitmap1;
struct { /* Info for journal system
inodes */
- __u32 i_flags; /* Mounted, version, etc. */
- __u32 i_j_pad;
+ __u32 ij_flags; /* Mounted, versoin, etc. */
+ __u32 ij_pad;
} journal1;
} id1; /* Inode type dependant 1 */
/*C0*/ union {
@@ -567,9 +542,12 @@
* list has a copy per node.
*/
if (type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE)
- chars = snprintf(buf, len, sysfile_info[type].name);
+ chars = snprintf(buf, len,
+ ocfs2_system_inodes[type].si_name);
else
- chars = snprintf(buf, len, sysfile_info[type].name, node);
+ chars = snprintf(buf, len,
+ ocfs2_system_inodes[type].si_name,
+ node);
return chars;
}
Property changes on: trunk/listuuid
___________________________________________________________________
Name: svn:ignore
+ .*.sw?
listuuid
Modified: trunk/listuuid/listuuid.c
===================================================================
--- trunk/listuuid/listuuid.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/listuuid/listuuid.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -38,7 +38,6 @@
#define OCFS2_FLAT_INCLUDES 1
#include <ocfs2.h>
#include <ocfs2_fs.h>
-#include <ocfs2_disk_dlm.h>
#include <ocfs1_fs_compat.h>
#include <kernel-list.h>
Modified: trunk/mkfs.ocfs2/mkfs.c
===================================================================
--- trunk/mkfs.ocfs2/mkfs.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/mkfs.ocfs2/mkfs.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -48,7 +48,6 @@
#undef cpu_to_be32
#undef be32_to_cpu
-#include "ocfs2_disk_dlm.h"
#include "ocfs1_fs_compat.h"
typedef unsigned short kdev_t;
@@ -111,7 +110,7 @@
char *name;
int type;
int global;
- int dir;
+ int mode;
};
struct BitInfo {
@@ -147,7 +146,7 @@
int flags;
int links;
- int dir;
+ int mode;
int cluster_bitmap;
};
@@ -276,7 +275,7 @@
static int initial_nodes_for_volume(uint64_t size);
static void generate_uuid(State *s);
static void create_generation(State *s);
-static void init_record(State *s, SystemFileDiskRecord *rec, int type, int dir);
+static void init_record(State *s, SystemFileDiskRecord *rec, int type, int mode);
static void print_state(State *s);
static int ocfs2_clusters_per_group(int block_size,
int cluster_size_bits);
@@ -290,16 +289,16 @@
extern int optind, opterr, optopt;
SystemFileInfo system_files[] = {
- { "bad_blocks", SFI_OTHER, 1, 0 },
- { "global_inode_alloc", SFI_CHAIN, 1, 0 },
- { "slot_map", SFI_OTHER, 1, 0 },
- { "heartbeat", SFI_HEARTBEAT, 1, 0 },
- { "global_bitmap", SFI_CLUSTER, 1, 0 },
- { "orphan_dir", SFI_OTHER, 1, 1 },
- { "extent_alloc:%04d", SFI_CHAIN, 0, 0 },
- { "inode_alloc:%04d", SFI_CHAIN, 0, 0 },
- { "journal:%04d", SFI_JOURNAL, 0, 0 },
- { "local_alloc:%04d", SFI_LOCAL_ALLOC, 0, 0 }
+ { "bad_blocks", SFI_OTHER, 1, S_IFREG | 0644 },
+ { "global_inode_alloc", SFI_CHAIN, 1, S_IFREG | 0644 },
+ { "slot_map", SFI_OTHER, 1, S_IFREG | 0644 },
+ { "heartbeat", SFI_HEARTBEAT, 1, S_IFREG | 0644 },
+ { "global_bitmap", SFI_CLUSTER, 1, S_IFREG | 0644 },
+ { "orphan_dir", SFI_OTHER, 1, S_IFDIR | 0755 },
+ { "extent_alloc:%04d", SFI_CHAIN, 0, S_IFREG | 0644 },
+ { "inode_alloc:%04d", SFI_CHAIN, 0, S_IFREG | 0644 },
+ { "journal:%04d", SFI_JOURNAL, 0, S_IFREG | 0644 },
+ { "local_alloc:%04d", SFI_LOCAL_ALLOC, 0, S_IFREG | 0644 }
};
int
@@ -338,9 +337,9 @@
check_32bit_blocks (s);
- init_record(s, &superblock_rec, SFI_OTHER, 0);
- init_record(s, &root_dir_rec, SFI_OTHER, 1);
- init_record(s, &system_dir_rec, SFI_OTHER, 1);
+ init_record(s, &superblock_rec, SFI_OTHER, S_IFREG | 0644);
+ init_record(s, &root_dir_rec, SFI_OTHER, S_IFDIR | 0755);
+ init_record(s, &system_dir_rec, SFI_OTHER, S_IFDIR | 0755);
for (i = 0; i < NUM_SYSTEM_INODES; i++) {
num = system_files[i].global ? 1 : s->initial_nodes;
@@ -348,7 +347,7 @@
for (j = 0; j < num; j++) {
init_record(s, &record[i][j],
- system_files[i].type, system_files[i].dir);
+ system_files[i].type, system_files[i].mode);
}
}
@@ -432,7 +431,7 @@
sprintf(fname, system_files[i].name, j);
add_entry_to_directory(s, system_dir, fname,
record[i][j].fe_off,
- system_files[i].dir ? OCFS2_FT_DIR
+ S_ISDIR(system_files[i].mode) ? OCFS2_FT_DIR
: OCFS2_FT_REG_FILE);
}
}
@@ -1528,7 +1527,7 @@
uint32_t clusters;
AllocBitmap *bitmap;
- mode = rec->dir ? 0755 | S_IFDIR : 0644 | S_IFREG;
+ mode = rec->mode;
clusters = (rec->extent_len + s->cluster_size - 1) >> s->cluster_size_bits;
@@ -1860,14 +1859,14 @@
}
static void
-init_record(State *s, SystemFileDiskRecord *rec, int type, int dir)
+init_record(State *s, SystemFileDiskRecord *rec, int type, int mode)
{
memset(rec, 0, sizeof(SystemFileDiskRecord));
rec->flags = OCFS2_VALID_FL | OCFS2_SYSTEM_FL;
- rec->dir = dir;
+ rec->mode = mode;
- rec->links = dir ? 0 : 1;
+ rec->links = S_ISDIR(mode) ? 0 : 1;
rec->bi.used_bits = rec->bi.total_bits = 0;
rec->flags = (OCFS2_VALID_FL | OCFS2_SYSTEM_FL);
Property changes on: trunk/mount.ocfs2
___________________________________________________________________
Name: svn:ignore
+ .*.sw?
mount.ocfs2
Modified: trunk/mount.ocfs2/mount.ocfs2.c
===================================================================
--- trunk/mount.ocfs2/mount.ocfs2.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/mount.ocfs2/mount.ocfs2.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -59,7 +59,6 @@
#define OCFS2_FLAT_INCLUDES 1
#include <ocfs2.h>
#include <ocfs2_fs.h>
-#include <ocfs2_disk_dlm.h>
#include <ocfs1_fs_compat.h>
#include <kernel-list.h>
@@ -721,7 +720,7 @@
if (ret)
return status;
- heartbeat_filename = sysfile_info[HEARTBEAT_SYSTEM_INODE].name;
+ heartbeat_filename = ocfs2_system_inodes[HEARTBEAT_SYSTEM_INODE].si_name;
ret = ocfs2_lookup(fs, fs->fs_sysdir_blkno, heartbeat_filename,
strlen(heartbeat_filename), NULL, &blkno);
if (ret)
Property changes on: trunk/mounted.ocfs2
___________________________________________________________________
Name: svn:ignore
- mounted.ocfs2
stamp-md5
cscope.*
+ mounted.ocfs2
stamp-md5
.*.sw?
cscope.*
Modified: trunk/mounted.ocfs2/mounted.c
===================================================================
--- trunk/mounted.ocfs2/mounted.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/mounted.ocfs2/mounted.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -39,7 +39,6 @@
#define OCFS2_FLAT_INCLUDES 1
#include <ocfs2.h>
#include <ocfs2_fs.h>
-#include <ocfs2_disk_dlm.h>
#include <ocfs1_fs_compat.h>
#include <kernel-list.h>
Modified: trunk/tunefs.ocfs2/tunefs.c
===================================================================
--- trunk/tunefs.ocfs2/tunefs.c 2004-12-09 22:51:37 UTC (rev 473)
+++ trunk/tunefs.ocfs2/tunefs.c 2004-12-09 23:14:02 UTC (rev 474)
@@ -46,7 +46,6 @@
#include <ocfs2.h>
#include <ocfs2_fs.h>
-#include <ocfs2_disk_dlm.h>
#include <ocfs1_fs_compat.h>
#include <kernel-list.h>
@@ -273,12 +272,12 @@
for (i = OCFS2_LAST_GLOBAL_SYSTEM_INODE + 1; i < NUM_SYSTEM_INODES; ++i) {
for (j = old_num; j < opts.num_nodes; ++j) {
- sprintf(fname, sysfile_info[i].name, j);
+ sprintf(fname, ocfs2_system_inodes[i].si_name, j);
printf("Adding %s... ", fname);
/* create inode for system file */
- mode = sysfile_info[i].dir ? 0755 | S_IFDIR : 0644 | S_IFREG;
- ret = ocfs2_new_system_inode(fs, &blkno, mode, sysfile_info[i].flags);
+ mode = ocfs2_system_inodes[i].si_mode ? 0755 | S_IFDIR : 0644 | S_IFREG;
+ ret = ocfs2_new_system_inode(fs, &blkno, mode, ocfs2_system_inodes[i].si_flags);
if (ret)
goto bail;
@@ -318,7 +317,7 @@
ocfs2_dinode *di;
snprintf (jrnl_node0, sizeof(jrnl_node0),
- sysfile_info[JOURNAL_SYSTEM_INODE].name, 0);
+ ocfs2_system_inodes[JOURNAL_SYSTEM_INODE].si_name, 0);
ret = ocfs2_lookup(fs, fs->fs_sysdir_blkno, jrnl_node0,
strlen(jrnl_node0), NULL, &blkno);
@@ -400,7 +399,7 @@
for (i = 0; i < max_nodes; ++i) {
snprintf (jrnl_file, sizeof(jrnl_file),
- sysfile_info[JOURNAL_SYSTEM_INODE].name, i);
+ ocfs2_system_inodes[JOURNAL_SYSTEM_INODE].si_name, i);
ret = ocfs2_lookup(fs, fs->fs_sysdir_blkno, jrnl_file,
strlen(jrnl_file), NULL, &blkno);
More information about the Ocfs2-tools-commits
mailing list