[Ocfs2-tools-commits] manish commits r909 - in trunk: debugfs.ocfs2
debugfs.ocfs2/include fsck.ocfs2 fswreck fswreck/include
libo2cb/include libocfs2 libocfs2/include mkfs.ocfs2
mounted.ocfs2 ocfs2console/ocfs2interface sizetest tunefs.ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon May 23 18:35:50 CDT 2005
Author: manish
Signed-off-by: jlbec
Date: 2005-05-23 18:35:49 -0500 (Mon, 23 May 2005)
New Revision: 909
Modified:
trunk/debugfs.ocfs2/commands.c
trunk/debugfs.ocfs2/dump.c
trunk/debugfs.ocfs2/include/readfs.h
trunk/debugfs.ocfs2/include/utils.h
trunk/debugfs.ocfs2/readfs.c
trunk/debugfs.ocfs2/utils.c
trunk/fsck.ocfs2/fsck.c
trunk/fsck.ocfs2/journal.c
trunk/fsck.ocfs2/pass0.c
trunk/fsck.ocfs2/pass1.c
trunk/fsck.ocfs2/pass4.c
trunk/fswreck/Makefile
trunk/fswreck/corrupt.c
trunk/fswreck/include/corrupt.h
trunk/fswreck/main.c
trunk/libo2cb/include/o2cb.h
trunk/libo2cb/include/ocfs2_nodemanager.h
trunk/libocfs2/alloc.c
trunk/libocfs2/checkhb.c
trunk/libocfs2/dlm.c
trunk/libocfs2/extents.c
trunk/libocfs2/heartbeat.c
trunk/libocfs2/include/ocfs2.h
trunk/libocfs2/include/ocfs2_fs.h
trunk/libocfs2/inode.c
trunk/libocfs2/inode_scan.c
trunk/libocfs2/openfs.c
trunk/libocfs2/sysfile.c
trunk/mkfs.ocfs2/mkfs.c
trunk/mkfs.ocfs2/mkfs.h
trunk/mkfs.ocfs2/mkfs.ocfs2.8.in
trunk/mounted.ocfs2/mounted.c
trunk/ocfs2console/ocfs2interface/format.py
trunk/ocfs2console/ocfs2interface/fswidgets.py
trunk/ocfs2console/ocfs2interface/nodeconfig.py
trunk/ocfs2console/ocfs2interface/o2cbmodule.c
trunk/ocfs2console/ocfs2interface/ocfs2module.c
trunk/ocfs2console/ocfs2interface/tune.py
trunk/sizetest/sizetest.c
trunk/tunefs.ocfs2/tunefs.c
trunk/tunefs.ocfs2/tunefs.ocfs2.8.in
Log:
Fix node/slot confusion, and make consistent use of constants
Signed-off-by: jlbec
Modified: trunk/debugfs.ocfs2/commands.c
===================================================================
--- trunk/debugfs.ocfs2/commands.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/debugfs.ocfs2/commands.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -264,25 +264,27 @@
}
/*
- * get_nodenum()
+ * get_slotnum()
*
*/
-static int get_nodenum(char **args, uint16_t *nodenum)
+static int get_slotnum(char **args, uint16_t *slotnum)
{
ocfs2_super_block *sb = OCFS2_RAW_SB(gbls.fs->fs_super);
char *endptr;
if (args[1]) {
- *nodenum = strtoul(args[1], &endptr, 0);
+ *slotnum = strtoul(args[1], &endptr, 0);
if (!*endptr) {
- if (*nodenum < sb->s_max_nodes)
+ if (*slotnum < sb->s_max_slots)
return 0;
else
- fprintf(stderr, "%s: Invalid node number\n", args[0]);
+ fprintf(stderr,
+ "%s: Invalid node slot number\n",
+ args[0]);
} else
- fprintf(stderr, "usage: %s <nodenum>\n", args[0]);
+ fprintf(stderr, "usage: %s <slotnum>\n", args[0]);
} else
- fprintf(stderr, "usage: %s <nodenum>\n", args[0]);
+ fprintf(stderr, "usage: %s <slotnum>\n", args[0]);
return -1;
}
@@ -438,7 +440,7 @@
gbls.slotmap_blkno = 0;
/* lookup journal files */
- for (i = 0; i < sb->s_max_nodes; ++i) {
+ for (i = 0; i < sb->s_max_slots; ++i) {
snprintf (sysfile, sizeof(sysfile),
ocfs2_system_inodes[JOURNAL_SYSTEM_INODE].si_name, i);
ret = ocfs2_lookup(gbls.fs, gbls.sysdir_blkno, sysfile,
@@ -579,7 +581,7 @@
printf ("group <block#>\t\t\t\tShow chain group\n");
printf ("help, ?\t\t\t\t\tThis information\n");
printf ("lcd <directory>\t\t\t\tChange directory on a mounted flesystem\n");
- printf ("logdump <node#>\t\t\t\tPrints journal file for the node\n");
+ printf ("logdump <slot#>\t\t\t\tPrints journal file for the node slot\n");
printf ("ls [-l] <filespec>\t\t\tList directory\n");
printf ("open <device>\t\t\t\tOpen a device\n");
printf ("quit, q\t\t\t\t\tExit the program\n");
@@ -848,16 +850,16 @@
uint64_t blkno = 0;
int32_t len = 0;
FILE *out;
- uint16_t nodenum;
+ uint16_t slotnum;
errcode_t ret = 0;
if (check_device_open())
return ;
- if (get_nodenum(args, &nodenum))
+ if (get_slotnum(args, &slotnum))
return ;
- blkno = gbls.jrnl_blkno[nodenum];
+ blkno = gbls.jrnl_blkno[slotnum];
ret = read_whole_file(gbls.fs, blkno, &logbuf, &len);
if (ret) {
com_err(args[0], ret, " ");
Modified: trunk/debugfs.ocfs2/dump.c
===================================================================
--- trunk/debugfs.ocfs2/dump.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/debugfs.ocfs2/dump.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -60,7 +60,7 @@
fprintf(out, "\tBlock Size Bits: %u Cluster Size Bits: %u\n",
sb->s_blocksize_bits, sb->s_clustersize_bits);
- fprintf(out, "\tMax Nodes: %u\n", sb->s_max_nodes);
+ fprintf(out, "\tMax Node Slots: %u\n", sb->s_max_slots);
fprintf(out, "\tLabel: %s\n", sb->s_label);
fprintf(out, "\tUUID: ");
@@ -207,11 +207,11 @@
le32_to_cpu(in->i_mtime_nsec), le32_to_cpu(in->i_mtime_nsec));
fprintf(out, "\tLast Extblk: %"PRIu64"\n", in->i_last_eb_blk);
- if (in->i_suballoc_node == -1)
+ if (in->i_suballoc_slot == OCFS2_INVALID_SLOT)
strcpy(tmp_str, "Global");
else
- sprintf(tmp_str, "%d", in->i_suballoc_node);
- fprintf(out, "\tSub Alloc Node: %s Sub Alloc Bit: %u\n",
+ sprintf(tmp_str, "%d", in->i_suballoc_slot);
+ fprintf(out, "\tSub Alloc Slot: %s Sub Alloc Bit: %u\n",
tmp_str, in->i_suballoc_bit);
if (in->i_flags & OCFS2_BITMAP_FL)
@@ -293,8 +293,8 @@
*/
void dump_extent_block (FILE *out, ocfs2_extent_block *blk)
{
- fprintf (out, "\tSubAlloc Bit: %u SubAlloc Node: %u\n",
- blk->h_suballoc_bit, blk->h_suballoc_node);
+ fprintf (out, "\tSubAlloc Bit: %u SubAlloc Slot: %u\n",
+ blk->h_suballoc_bit, blk->h_suballoc_slot);
fprintf (out, "\tBlknum: %"PRIu64" Next Leaf: %"PRIu64"\n",
blk->h_blkno, blk->h_next_leaf_blk);
@@ -370,7 +370,7 @@
GString *jstr = NULL;
jstr = g_string_new (NULL);
- get_journal_blktyp (ntohl(header->h_blocktype), jstr);
+ get_journal_block_type (ntohl(header->h_blocktype), jstr);
fprintf (out, "\tSeq: %u Type: %d (%s)\n", ntohl(header->h_sequence),
ntohl(header->h_blocktype), jstr->str);
Modified: trunk/debugfs.ocfs2/include/readfs.h
===================================================================
--- trunk/debugfs.ocfs2/include/readfs.h 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/debugfs.ocfs2/include/readfs.h 2005-05-23 23:35:49 UTC (rev 909)
@@ -1,38 +0,0 @@
-/*
- * readfs.h
- *
- * Function prototypes, macros, etc. for related 'C' files
- *
- * Copyright (C) 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 as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * 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: Sunil Mushran
- */
-
-#ifndef __READFS_H__
-#define __READFS_H__
-
-int read_super_block (int fd, char **buf);
-int read_inode (int fd, uint64_t blknum, char *buf, int buflen);
-int read_group (int fd, uint64_t blknum, char *buf, int buflen);
-int traverse_extents (int fd, ocfs2_extent_list *ext, GArray *arr, int dump, FILE *out);
-void read_dir_block (struct ocfs2_dir_entry *dir, int len, GArray *arr);
-void read_dir (int fd, ocfs2_extent_list *ext, uint64_t size, GArray *dirarr);
-void read_sysdir (int fd, char *sysdir);
-int read_file (int fd, uint64_t blknum, int fdo, char **buf);
-
-#endif /* __READFS_H__ */
Modified: trunk/debugfs.ocfs2/include/utils.h
===================================================================
--- trunk/debugfs.ocfs2/include/utils.h 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/debugfs.ocfs2/include/utils.h 2005-05-23 23:35:49 UTC (rev 909)
@@ -35,7 +35,7 @@
void get_vote_flag (uint32_t flag, GString *str);
void get_publish_flag (uint32_t flag, GString *str);
-void get_journal_blktyp (uint32_t jtype, GString *str);
+void get_journal_block_type (uint32_t jtype, GString *str);
void get_tag_flag (uint32_t flags, GString *str);
FILE *open_pager(int interactive);
void close_pager(FILE *stream);
@@ -51,4 +51,5 @@
errcode_t rdump_inode(ocfs2_filesys *fs, uint64_t blkno, const char *name,
const char *dumproot, int verbose);
void crunch_strsplit(char **args);
+
#endif /* __UTILS_H__ */
Modified: trunk/debugfs.ocfs2/readfs.c
===================================================================
--- trunk/debugfs.ocfs2/readfs.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/debugfs.ocfs2/readfs.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -1,414 +0,0 @@
-/*
- * readfs.c
- *
- * reads ocfs2 structures
- *
- * Copyright (C) 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 as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * 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: Sunil Mushran
- */
-
-#include <main.h>
-#include <inttypes.h>
-
-extern dbgfs_gbls gbls;
-
-/*
- * read_super_block()
- *
- */
-int read_super_block (int fd, char **buf)
-{
- int ret = -1;
- uint64_t off;
- ocfs1_vol_disk_hdr *hdr;
- ocfs2_dinode *di;
- uint32_t bits = 9;
- uint32_t buflen;
-
- for (bits = 9; bits < 13; bits++) {
- buflen = 1 << bits;
- if (!(*buf = memalign(buflen, buflen)))
- DBGFS_FATAL("%s", strerror(errno));
-
- if ((ret = pread64(fd, *buf, buflen, 0)) == -1) {
- safefree (*buf);
- continue;
- } else
- break;
- }
-
- if (ret == -1)
- DBGFS_FATAL ("unable to read the first block");
-
- hdr = (ocfs1_vol_disk_hdr *)*buf;
- if (memcmp(hdr->signature, OCFS1_VOLUME_SIGNATURE,
- strlen (OCFS1_VOLUME_SIGNATURE)) == 0) {
- printf("OCFS1 detected. Use debugocfs.\n");
- safefree (*buf);
- ret = -1;
- goto bail;
- }
-
- /*
- * Now check at magic offset for 512, 1024, 2048, 4096
- * blocksizes. 4096 is the maximum blocksize because it is
- * the minimum clustersize.
- */
- for (; bits < 13; bits++) {
- if (!*buf) {
- buflen = 1 << bits;
- if (!(*buf = memalign(buflen, buflen)))
- DBGFS_FATAL("%s", strerror(errno));
- }
-
- off = OCFS2_SUPER_BLOCK_BLKNO << bits;
- if ((pread64(fd, *buf, buflen, off)) == -1)
- DBGFS_FATAL("%s", strerror(errno));
-
- di = (ocfs2_dinode *) *buf;
- if (!memcmp(di->i_signature, OCFS2_SUPER_BLOCK_SIGNATURE,
- strlen(OCFS2_SUPER_BLOCK_SIGNATURE))) {
- ret = 0;
- break;
- }
- safefree (*buf);
- }
-
- if (bits >= 13) {
- printf("Not an OCFS2 volume\n");
- ret = -1;
- }
-
-bail:
- return ret;
-} /* read_super_block */
-
-/*
- * read_inode()
- *
- */
-int read_inode (int fd, uint64_t blknum, char *buf, int buflen)
-{
- uint64_t off;
- ocfs2_dinode *inode;
- int ret = 0;
-
- off = blknum << gbls.blksz_bits;
-
- if ((pread64(fd, buf, buflen, off)) == -1)
- DBGFS_FATAL("%s off=%"PRIu64, strerror(errno), off);
-
- inode = (ocfs2_dinode *)buf;
-
- if (memcmp(inode->i_signature, OCFS2_INODE_SIGNATURE,
- sizeof(OCFS2_INODE_SIGNATURE)))
- ret = -1;
-
- return ret;
-} /* read_inode */
-
-/*
- * read_group()
- *
- */
-int read_group (int fd, uint64_t blknum, char *buf, int buflen)
-{
- uint64_t off;
- ocfs2_group_desc *bg;
- int ret = 0;
-
- off = blknum << gbls.blksz_bits;
-
- if ((pread64(fd, buf, buflen, off)) == -1)
- DBGFS_FATAL("%s off=%"PRIu64, strerror(errno), off);
-
- bg = (ocfs2_group_desc *)buf;
-
- if (memcmp(bg->bg_signature, OCFS2_GROUP_DESC_SIGNATURE,
- sizeof(OCFS2_GROUP_DESC_SIGNATURE)))
- ret = -1;
-
- return ret;
-} /* read_group */
-
-/*
- * traverse_extents()
- *
- */
-int traverse_extents (int fd, ocfs2_extent_list *ext, GArray *arr, int dump, FILE *out)
-{
- ocfs2_extent_block *blk;
- ocfs2_extent_rec *rec;
- int ret = 0;
- uint64_t off;
- char *buf = NULL;
- uint32_t buflen;
- int i;
-
- if (dump)
- dump_extent_list (out, ext);
-
- for (i = 0; i < ext->l_next_free_rec; ++i) {
- rec = &(ext->l_recs[i]);
- if (ext->l_tree_depth == 0)
- add_extent_rec (arr, rec);
- else {
- buflen = 1 << gbls.blksz_bits;
- if (!(buf = memalign(buflen, buflen)))
- DBGFS_FATAL("%s", strerror(errno));
-
- off = (uint64_t)rec->e_blkno << gbls.blksz_bits;
- if ((pread64 (fd, buf, buflen, off)) == -1)
- DBGFS_FATAL("%s", strerror(errno));
-
- blk = (ocfs2_extent_block *)buf;
-
- if (dump)
- dump_extent_block (out, blk);
-
- traverse_extents (fd, &(blk->h_list), arr, dump, out);
- }
- }
-
- safefree (buf);
- return ret;
-} /* traverse_extents */
-
-/*
- * read_dir_block()
- *
- */
-void read_dir_block (struct ocfs2_dir_entry *dir, int len, GArray *arr)
-{
- char *p;
- struct ocfs2_dir_entry *rec;
-
- p = (char *) dir;
-
- while (p < (((char *)dir) + len)) {
- rec = (struct ocfs2_dir_entry *)p;
- if (rec->inode)
- add_dir_rec (arr, rec);
- p += rec->rec_len;
- }
-
- return ;
-} /* read_dir_block */
-
-/*
- * read_dir()
- *
- */
-void read_dir (int fd, ocfs2_extent_list *ext, uint64_t size, GArray *dirarr)
-{
- ocfs2_extent_rec *rec;
- GArray *arr = NULL;
- unsigned int i = 0;
- char *buf = NULL;
- uint32_t len;
- uint64_t off;
- uint64_t foff;
-
- arr = g_array_new(0, 1, sizeof(ocfs2_extent_rec));
-
- traverse_extents (fd, ext, arr, 0, stdout);
-
- for (i = 0; i < arr->len; ++i) {
- rec = &(g_array_index(arr, ocfs2_extent_rec, i));
-
- off = rec->e_blkno << gbls.blksz_bits;
- foff = rec->e_cpos << gbls.clstrsz_bits;
- len = rec->e_clusters << gbls.clstrsz_bits;
- if ((foff + len) > size)
- len = size - foff;
-
- if (!(buf = memalign((1 << gbls.blksz_bits), len)))
- DBGFS_FATAL("%s", strerror(errno));
-
- if ((pread64(fd, buf, len, off)) == -1)
- DBGFS_FATAL("%s", strerror(errno));
-
- read_dir_block ((struct ocfs2_dir_entry *)buf, len, dirarr);
-
- safefree (buf);
- }
-
- if (arr)
- g_array_free (arr, 1);
-
- return ;
-} /* read_dir */
-
-/*
- * read_sysdir()
- *
- */
-void read_sysdir (int fd, char *sysdir)
-{
- ocfs2_dinode *inode;
- struct ocfs2_dir_entry *rec;
- GArray *dirarr = NULL;
- 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);
- char tmpstr[40];
-
- inode = (ocfs2_dinode *)sysdir;
-
- if (!S_ISDIR(inode->i_mode)) {
- printf("No system directory on the volume\n");
- goto bail;
- }
-
- dirarr = g_array_new(0, 1, sizeof(struct ocfs2_dir_entry));
-
- read_dir (fd, &(inode->id2.i_list), inode->i_size, dirarr);
-
- /* generate journal sysfile names */
- for (i = 0; i < sb->s_max_nodes; ++i) {
- snprintf (tmpstr, sizeof(tmpstr),
- ocfs2_system_inodes[JOURNAL_SYSTEM_INODE].si_name, i);
- journal[i] = strdup (tmpstr);
- gbls.journal_blkno[i] = 0;
- }
-
- for (i = 0; i < dirarr->len; ++i) {
- rec = &(g_array_index(dirarr, struct ocfs2_dir_entry, i));
- if (!strncmp (rec->name, hb, strlen(hb))) {
- gbls.hb_blkno = rec->inode;
- continue;
- }
- if (!strncmp (rec->name, gblbm, strlen(gblbm))) {
- gbls.gblbm_blkno = rec->inode;
- continue;
- }
- for (j = 0; j < sb->s_max_nodes; ++j) {
- if (!strncmp (rec->name, journal[j], strlen(journal[j]))) {
- gbls.journal_blkno[j] = rec->inode;
- break;
- }
- }
- }
-
-bail:
- if (dirarr)
- g_array_free (dirarr, 1);
-
- for (i = 0; i < sb->s_max_nodes; ++i)
- safefree (journal[i]);
-
- return ;
-} /* read_sysdir */
-
-/*
- * read_file()
- *
- */
-int read_file (int fd, uint64_t blknum, int fdo, char **buf)
-{
- ocfs2_dinode *inode = NULL;
- GArray *arr = NULL;
- ocfs2_extent_rec *rec;
- char *p = NULL;
- uint64_t off, foff, len;
- unsigned int i;
- char *newbuf = NULL;
- uint64_t newlen = 0;
- char *inode_buf = NULL;
- uint64_t buflen = 0;
- uint64_t rndup = 0;
- int ret = -1;
-
- arr = g_array_new(0, 1, sizeof(ocfs2_extent_rec));
-
- buflen = 1 << gbls.blksz_bits;
- if (!(inode_buf = memalign(buflen, buflen)))
- DBGFS_FATAL("%s", strerror(errno));
-
- if ((read_inode (fd, blknum, inode_buf, buflen)) == -1) {
- printf("Not an inode\n");
- goto bail;
- }
- inode = (ocfs2_dinode *)inode_buf;
-
- traverse_extents (fd, &(inode->id2.i_list), arr, 0, stdout);
-
- if (fdo == -1) {
- newlen = inode->i_size;
- } else {
- newlen = 1024 * 1024;
- if (fdo > 2) {
- fchmod (fdo, inode->i_mode);
- fchown (fdo, inode->i_uid, inode->i_gid);
- }
- }
-
- if (!(newbuf = memalign((1 << gbls.blksz_bits), newlen)))
- DBGFS_FATAL("%s", strerror(errno));
-
- p = newbuf;
-
- for (i = 0; i < arr->len; ++i) {
- rec = &(g_array_index(arr, ocfs2_extent_rec, i));
- off = rec->e_blkno << gbls.blksz_bits;
- foff = rec->e_cpos << gbls.clstrsz_bits;
- len = rec->e_clusters << gbls.clstrsz_bits;
- if ((foff + len) > inode->i_size)
- len = inode->i_size - foff;
-
- while (len) {
- buflen = min (newlen, len);
- /* rndup is reqd because source is read o_direct */
- rndup = buflen % (1 << gbls.blksz_bits);
- rndup = (rndup ? (1 << gbls.blksz_bits) - rndup : 0);
- buflen += rndup;
-
- if ((pread64(fd, p, buflen, off)) == -1)
- DBGFS_FATAL("%s", strerror(errno));
-
- buflen -= rndup;
-
- if (fdo != -1) {
- if (!(write (fdo, p, buflen)))
- DBGFS_FATAL("%s", strerror(errno));
- } else
- p += buflen;
- len -= buflen;
- off += buflen;
- }
- }
-
- ret = 0;
- if (buf) {
- *buf = newbuf;
- ret = newlen;
- }
-
-bail:
- safefree (inode_buf);
- if (ret == -1 || !buf)
- safefree (newbuf);
-
- if (arr)
- g_array_free (arr, 1);
-
- return ret;
-} /* read_file */
Modified: trunk/debugfs.ocfs2/utils.c
===================================================================
--- trunk/debugfs.ocfs2/utils.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/debugfs.ocfs2/utils.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -144,10 +144,10 @@
}
/*
- * get_journal_blktyp()
+ * get_journal_block_type()
*
*/
-void get_journal_blktyp (uint32_t jtype, GString *str)
+void get_journal_block_type (uint32_t jtype, GString *str)
{
switch (jtype) {
case JFS_DESCRIPTOR_BLOCK:
Modified: trunk/fsck.ocfs2/fsck.c
===================================================================
--- trunk/fsck.ocfs2/fsck.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/fsck.ocfs2/fsck.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -161,8 +161,8 @@
ocfs2_super_block *sb = OCFS2_RAW_SB(di);
errcode_t ret = 0;
- if (sb->s_max_nodes == 0) {
- printf("The superblock max_nodes field is set to 0.\n");
+ if (sb->s_max_slots == 0) {
+ printf("The superblock max_slots field is set to 0.\n");
ret = OCFS2_ET_CORRUPT_SUPERBLOCK;
}
@@ -559,8 +559,8 @@
printf(" bytes per block: %u\n", ost->ost_fs->fs_blocksize);
printf(" number of clusters: %"PRIu32"\n", ost->ost_fs->fs_clusters);
printf(" bytes per cluster: %u\n", ost->ost_fs->fs_clustersize);
- printf(" max nodes: %u\n\n",
- OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_nodes);
+ printf(" max slots: %u\n\n",
+ OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_slots);
ret = maybe_replay_journals(ost, filename, open_flags, blkno, blksize);
if (ret) {
Modified: trunk/fsck.ocfs2/journal.c
===================================================================
--- trunk/fsck.ocfs2/journal.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/fsck.ocfs2/journal.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -23,7 +23,7 @@
* Boston, MA 021110-1307, USA.
*
* --
- * This replays the jbd journals for each node. First all the journals are
+ * This replays the jbd journals for each slot. First all the journals are
* walked to detect inconsistencies. Only journals with no problems will be
* replayed. IO errors during replay will just result in partial journal
* replay, just like jbd does in the kernel. Journals that don't pass
@@ -55,7 +55,7 @@
static const char *whoami = "journal recovery";
struct journal_info {
- int ji_node;
+ int ji_slot;
unsigned ji_replay:1;
uint64_t ji_ino;
@@ -247,17 +247,17 @@
&contig);
if (ret) {
com_err(whoami, ret, "while looking up logical block "
- "%"PRIu64" in node %d's journal", blkoff, ji->ji_node);
+ "%"PRIu64" in slot %d's journal", blkoff, ji->ji_slot);
goto out;
}
if (check_dup) {
ocfs2_bitmap_set(ji->ji_used_blocks, *blkno, &was_set);
if (was_set) {
- printf("Logical block %"PRIu64" in node %d's journal "
+ printf("Logical block %"PRIu64" in slot %d's journal "
"maps to block %"PRIu64" which has already "
"been used in another journal.\n", blkoff,
- ji->ji_node, *blkno);
+ ji->ji_slot, *blkno);
ret = OCFS2_ET_DUPLICATE_BLOCK;
}
}
@@ -281,8 +281,8 @@
err = io_read_block(fs->fs_io, blkno, 1, buf);
if (err)
- com_err(whoami, err, "while reading block %"PRIu64" of node "
- "%d's journal", blkno, ji->ji_node);
+ com_err(whoami, err, "while reading block %"PRIu64" of slot "
+ "%d's journal", blkno, ji->ji_slot);
return err;
}
@@ -348,7 +348,7 @@
return ret;
}
-static errcode_t walk_journal(ocfs2_filesys *fs, int node,
+static errcode_t walk_journal(ocfs2_filesys *fs, int slot,
struct journal_info *ji, char *buf, int recover)
{
errcode_t err, ret = 0;
@@ -443,9 +443,9 @@
ji->ji_set_final_seq = 1;
ji->ji_final_seq = next_seq;
} else if (ji->ji_final_seq != next_seq) {
- printf("Replaying node %d's journal stopped at seq %"PRIu32" "
+ printf("Replaying slot %d's journal stopped at seq %"PRIu32" "
"but an initial scan indicated that it should have "
- "stopped at seq %"PRIu32"\n", ji->ji_node, next_seq,
+ "stopped at seq %"PRIu32"\n", ji->ji_slot, next_seq,
ji->ji_final_seq);
if (ret == 0)
err = OCFS2_ET_IO;
@@ -454,7 +454,7 @@
return ret;
}
-static errcode_t prep_journal_info(ocfs2_filesys *fs, int node,
+static errcode_t prep_journal_info(ocfs2_filesys *fs, int slot,
struct journal_info *ji)
{
errcode_t err;
@@ -462,21 +462,21 @@
err = ocfs2_malloc_blocks(fs->fs_io, 1, &ji->ji_jsb);
if (err)
- com_err(whoami, err, "while allocating space for node %d's "
- "journal superblock", node);
+ com_err(whoami, err, "while allocating space for slot %d's "
+ "journal superblock", slot);
err = ocfs2_lookup_system_inode(fs, JOURNAL_SYSTEM_INODE,
- node, &ji->ji_ino);
+ slot, &ji->ji_ino);
if (err) {
com_err(whoami, err, "while looking up the journal inode for "
- "node %d", node);
+ "slot %d", slot);
goto out;
}
err = ocfs2_read_cached_inode(fs, ji->ji_ino, &ji->ji_cinode);
if (err) {
com_err(whoami, err, "while reading cached inode %"PRIu64" "
- "for node %d's journal", ji->ji_ino, node);
+ "for slot %d's journal", ji->ji_ino, slot);
goto out;
}
@@ -499,15 +499,15 @@
err = ocfs2_read_journal_superblock(fs, ji->ji_jsb_block,
(char *)ji->ji_jsb);
if (err) {
- com_err(whoami, err, "while reading block %"PRIu64" as node "
+ com_err(whoami, err, "while reading block %"PRIu64" as slot "
"%d's journal super block", ji->ji_jsb_block,
- ji->ji_node);
+ ji->ji_slot);
goto out;
}
ji->ji_replay = 1;
- verbosef("node: %d jsb start %u maxlen %u\n", node,
+ verbosef("slot: %d jsb start %u maxlen %u\n", slot,
ji->ji_jsb->s_start, ji->ji_jsb->s_maxlen);
out:
return err;
@@ -526,7 +526,7 @@
*/
errcode_t o2fsck_should_replay_journals(ocfs2_filesys *fs, int *should)
{
- uint16_t i, max_nodes;
+ uint16_t i, max_slots;
char *buf = NULL;
uint64_t blkno;
errcode_t ret;
@@ -535,7 +535,7 @@
journal_superblock_t *jsb;
*should = 0;
- max_nodes = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
+ max_slots = OCFS2_RAW_SB(fs->fs_super)->s_max_slots;
ret = ocfs2_malloc_block(fs->fs_io, &buf);
if (ret) {
@@ -546,12 +546,12 @@
jsb = (journal_superblock_t *)buf;
- for (i = 0; i < max_nodes; i++) {
+ for (i = 0; i < max_slots; i++) {
ret = ocfs2_lookup_system_inode(fs, JOURNAL_SYSTEM_INODE, i,
&blkno);
if (ret) {
com_err(whoami, ret, "while looking up the journal "
- "inode for node %d", i);
+ "inode for slot %d", i);
goto out;
}
@@ -562,7 +562,7 @@
ret = ocfs2_read_cached_inode(fs, blkno, &cinode);
if (ret) {
com_err(whoami, ret, "while reading cached inode "
- "%"PRIu64" for node %d's journal", blkno, i);
+ "%"PRIu64" for slot %d's journal", blkno, i);
goto out;
}
@@ -574,7 +574,7 @@
is_dirty = cinode->ci_inode->id1.journal1.ij_flags &
OCFS2_JOURNAL_DIRTY_FL;
- verbosef("node %d JOURNAL_DIRTY_FL: %d\n", i, is_dirty);
+ verbosef("slot %d JOURNAL_DIRTY_FL: %d\n", i, is_dirty);
if (!is_dirty)
continue;
@@ -582,7 +582,7 @@
&contig);
if (ret) {
com_err(whoami, ret, "while looking up the journal "
- "super block in node %d's journal", i);
+ "super block in slot %d's journal", i);
goto out;
}
@@ -591,7 +591,7 @@
ret = ocfs2_read_journal_superblock(fs, blkno, buf);
if (ret) {
com_err(whoami, ret, "while reading the journal "
- "super block in node %d's journal", i);
+ "super block in slot %d's journal", i);
goto out;
}
@@ -608,7 +608,7 @@
}
-/* Try and replay the nodes journals if they're dirty. This only returns
+/* Try and replay the slots 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, int *replayed)
{
@@ -617,10 +617,10 @@
journal_superblock_t *jsb;
char *buf = NULL;
int journal_trouble = 0;
- uint16_t i, max_nodes;
+ uint16_t i, max_slots;
ocfs2_bitmap *used_blocks = NULL;
- max_nodes = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
+ max_slots = OCFS2_RAW_SB(fs->fs_super)->s_max_slots;
ret = ocfs2_block_bitmap_new(fs, "journal blocks",
&used_blocks);
@@ -636,46 +636,46 @@
goto out;
}
- ret = ocfs2_malloc0(sizeof(struct journal_info) * max_nodes, &jis);
+ ret = ocfs2_malloc0(sizeof(struct journal_info) * max_slots, &jis);
if (ret) {
com_err(whoami, ret, "while allocating an array of block "
"numbers for journal replay");
goto out;
}
- printf("Checking each node's journal.\n");
+ printf("Checking each slot's journal.\n");
- for (i = 0, ji = jis; i < max_nodes; i++, ji++) {
+ for (i = 0, ji = jis; i < max_slots; i++, ji++) {
ji->ji_used_blocks = used_blocks;
ji->ji_revoke = RB_ROOT;
- ji->ji_node = i;
+ ji->ji_slot = i;
/* sets ji->ji_replay */
err = prep_journal_info(fs, i, ji);
if (err) {
- printf("Node %d seems to have a corrupt journal.\n",
+ printf("Slot %d seems to have a corrupt journal.\n",
i);
journal_trouble = 1;
continue;
}
if (!ji->ji_replay) {
- verbosef("node %d is clean\n", i);
+ verbosef("slot %d is clean\n", i);
continue;
}
err = walk_journal(fs, i, ji, buf, 0);
if (err) {
- printf("Node %d's journal can not be replayed.\n", i);
+ printf("Slot %d's journal can not be replayed.\n", i);
journal_trouble = 1;
}
}
- for (i = 0, ji = jis; i < max_nodes; i++, ji++) {
+ for (i = 0, ji = jis; i < max_slots; i++, ji++) {
if (!ji->ji_replay)
continue;
- printf("Replaying node %d's journal.\n", i);
+ printf("Replaying slot %d's journal.\n", i);
err = walk_journal(fs, i, ji, buf, 1);
if (err) {
@@ -698,11 +698,11 @@
ji->ji_jsb_block,
(char *)ji->ji_jsb);
if (err) {
- com_err(whoami, err, "while writing node %d's journal "
+ com_err(whoami, err, "while writing slot %d's journal "
"super block", i);
journal_trouble = 1;
} else {
- printf("Node %d's journal replayed successfully.\n",
+ printf("Slot %d's journal replayed successfully.\n",
i);
*replayed = 1;
}
@@ -719,7 +719,7 @@
out:
if (jis) {
- for (i = 0, ji = jis; i < max_nodes; i++, ji++) {
+ for (i = 0, ji = jis; i < max_slots; i++, ji++) {
if (ji->ji_jsb)
ocfs2_free(&ji->ji_jsb);
if (ji->ji_cinode)
Modified: trunk/fsck.ocfs2/pass0.c
===================================================================
--- trunk/fsck.ocfs2/pass0.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/fsck.ocfs2/pass0.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -812,7 +812,7 @@
ocfs2_dinode *di = NULL;
ocfs2_filesys *fs = ost->ost_fs;
ocfs2_cached_inode **ci;
- int max_nodes = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
+ int max_slots = OCFS2_RAW_SB(fs->fs_super)->s_max_slots;
int i, type;
printf("Pass 0a: Checking cluster allocation chains\n");
@@ -824,7 +824,7 @@
}
di = (ocfs2_dinode *)blocks;
- ret = ocfs2_malloc0(max_nodes * sizeof(ocfs2_cached_inode *),
+ ret = ocfs2_malloc0(max_slots * sizeof(ocfs2_cached_inode *),
&ost->ost_inode_allocs);
if (ret) {
com_err(whoami, ret, "while cached inodes for each node");
@@ -862,7 +862,7 @@
type = GLOBAL_INODE_ALLOC_SYSTEM_INODE;
i = -1;
- for ( ; i < max_nodes; i++, type = INODE_ALLOC_SYSTEM_INODE) {
+ for ( ; i < max_slots; i++, type = INODE_ALLOC_SYSTEM_INODE) {
ret = ocfs2_lookup_system_inode(fs, type, i, &blkno);
if (ret) {
com_err(whoami, ret, "while looking up the inode "
@@ -914,7 +914,7 @@
printf("Pass 0c: Checking extent block allocation chains\n");
- for (i = 0; i < max_nodes; i++) {
+ for (i = 0; i < max_slots; i++) {
ret = ocfs2_lookup_system_inode(fs, EXTENT_ALLOC_SYSTEM_INODE,
i, &blkno);
if (ret) {
Modified: trunk/fsck.ocfs2/pass1.c
===================================================================
--- trunk/fsck.ocfs2/pass1.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/fsck.ocfs2/pass1.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -74,7 +74,7 @@
ocfs2_free_cached_inode(ost->ost_fs, ost->ost_global_inode_alloc);
- for (i = 0; i < OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_nodes;i++)
+ for (i = 0; i < OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_slots; i++)
ocfs2_free_cached_inode(ost->ost_fs, ost->ost_inode_allocs[i]);
}
@@ -84,7 +84,8 @@
static void update_inode_alloc(o2fsck_state *ost, ocfs2_dinode *di,
uint64_t blkno, int val)
{
- uint16_t node, max_nodes, yn;
+ int16_t slot;
+ uint16_t max_slots, yn;
errcode_t ret = OCFS2_ET_INTERNAL_FAILURE;
ocfs2_cached_inode *cinode;
int oldval;
@@ -94,15 +95,15 @@
if (ost->ost_write_inode_alloc_asked && !ost->ost_write_inode_alloc)
return;
- max_nodes = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_nodes;
+ max_slots = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_slots;
- for (node = ~0; node != max_nodes; node++,
+ for (slot = OCFS2_INVALID_SLOT; slot != max_slots; slot++,
ret = OCFS2_ET_INTERNAL_FAILURE) {
- if (node == (uint16_t)~0)
+ if (slot == OCFS2_INVALID_SLOT)
cinode = ost->ost_global_inode_alloc;
else
- cinode = ost->ost_inode_allocs[node];
+ cinode = ost->ost_inode_allocs[slot];
/* we might have had trouble reading the chains in pass 0 */
if (cinode == NULL)
@@ -114,8 +115,8 @@
if (ret != OCFS2_ET_INVALID_BIT)
com_err(whoami, ret, "while trying to set "
"inode %"PRIu64"'s allocation to '%d' "
- "in node %u's chain", blkno, val,
- node);
+ "in slot %"PRId16"'s chain", blkno,
+ val, slot);
continue;
}
@@ -123,7 +124,7 @@
* didn't use 'int' but rather some real boolean construct */
oldval = !!oldval;
- /* this node covers the inode. see if we've changed the
+ /* this slot covers the inode. see if we've changed the
* bitmap and if the user wants us to keep tracking it and
* write back the new map */
if (oldval != val && !ost->ost_write_inode_alloc_asked) {
@@ -142,24 +143,24 @@
if (ret) {
com_err(whoami, ret, "while trying to set inode %"PRIu64"'s "
- "allocation to '%d'. None of the nodes chain "
+ "allocation to '%d'. None of the slots chain "
"allocator's had a group covering the inode.",
blkno, val);
goto out;
}
- verbosef("updated inode %"PRIu64" alloc to %d in node %"PRIu16"\n",
- blkno, val, node);
+ verbosef("updated inode %"PRIu64" alloc to %d in slot %"PRId16"\n",
+ blkno, val, slot);
/* make sure the inode's fields are consistent if it's allocated */
- if (val == 1 && node != (uint16_t)di->i_suballoc_node &&
+ if (val == 1 && slot != di->i_suballoc_slot &&
prompt(ost, PY, PR_INODE_SUBALLOC,
"Inode %"PRIu64" indicates that it was allocated "
- "from node %"PRIu16" but node %"PRIu16"'s chain allocator "
+ "from slot %"PRId16" but slot %"PRId16"'s chain allocator "
"covers the inode. Fix the inode's record of where it is "
"allocated?",
- blkno, di->i_suballoc_node, node)) {
- di->i_suballoc_node = node;
+ blkno, di->i_suballoc_slot, slot)) {
+ di->i_suballoc_slot = slot;
o2fsck_write_inode(ost, di->i_blkno, di);
}
out:
@@ -813,7 +814,8 @@
*/
static void mark_local_allocs(o2fsck_state *ost)
{
- uint16_t node, max_nodes;
+ int16_t slot;
+ uint16_t max_slots;
char *buf = NULL;
errcode_t ret;
uint64_t blkno, start, end;
@@ -821,7 +823,7 @@
ocfs2_local_alloc *la = &di->id2.i_lab;
int bit;
- max_nodes = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_nodes;
+ max_slots = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_slots;
ret = ocfs2_malloc_block(ost->ost_fs->fs_io, &buf);
if (ret) {
@@ -832,10 +834,10 @@
di = (ocfs2_dinode *)buf;
- for (node = 0; node < max_nodes; node++) {
+ for (slot = 0; slot < max_slots; slot++) {
ret = ocfs2_lookup_system_inode(ost->ost_fs,
LOCAL_ALLOC_SYSTEM_INODE,
- node, &blkno);
+ slot, &blkno);
if (ret) {
com_err(whoami, ret, "while looking up local alloc "
"inode %"PRIu64" to verify its bitmap",
@@ -874,7 +876,7 @@
continue;
/* bits that are clear in the local alloc haven't been
- * used by the node yet, they must still be set in the
+ * used by the slot yet, they must still be set in the
* main bitmap. bits that are set might have been used
* and already freed in the main bitmap. */
for(bit = 0; bit < di->id1.bitmap1.i_total; bit++) {
@@ -908,14 +910,15 @@
*/
static void mark_truncate_logs(o2fsck_state *ost)
{
- uint16_t node, max_nodes, i, max;
+ int16_t slot;
+ uint16_t max_slots, i, max;
ocfs2_truncate_log *tl;
uint64_t blkno;
ocfs2_dinode *di;
char *buf = NULL;
errcode_t ret;
- max_nodes = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_nodes;
+ max_slots = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_slots;
max = ocfs2_truncate_recs_per_inode(ost->ost_fs->fs_blocksize);
ret = ocfs2_malloc_block(ost->ost_fs->fs_io, &buf);
@@ -927,10 +930,10 @@
di = (ocfs2_dinode *)buf;
- for (node = 0; node < max_nodes; node++) {
+ for (slot = 0; slot < max_slots; slot++) {
ret = ocfs2_lookup_system_inode(ost->ost_fs,
TRUNCATE_LOG_SYSTEM_INODE,
- node, &blkno);
+ slot, &blkno);
if (ret) {
com_err(whoami, ret, "while looking up truncate log "
"inode %"PRIu64" to account for its records",
@@ -1095,16 +1098,16 @@
static void write_inode_alloc(o2fsck_state *ost)
{
- int max_nodes = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_nodes;
+ int max_slots = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_slots;
ocfs2_cached_inode **ci;
errcode_t ret;
- int i = -1;
+ int i;
if (!ost->ost_write_inode_alloc)
return;
- for ( ; i < max_nodes; i++) {
- if (i == -1)
+ for (i = -1; i < max_slots; i++) {
+ if (i == OCFS2_INVALID_SLOT)
ci = &ost->ost_global_inode_alloc;
else
ci = &ost->ost_inode_allocs[i];
@@ -1112,11 +1115,11 @@
if (*ci == NULL)
continue;
- verbosef("writing node %d's allocator\n", i);
+ verbosef("writing slot %d's allocator\n", i);
ret = ocfs2_write_chain_allocator(ost->ost_fs, *ci);
if (ret)
- com_err(whoami, ret, "while trying to write back node "
+ com_err(whoami, ret, "while trying to write back slot "
"%d's inode allocator", i);
}
Modified: trunk/fsck.ocfs2/pass4.c
===================================================================
--- trunk/fsck.ocfs2/pass4.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/fsck.ocfs2/pass4.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -156,9 +156,9 @@
uint64_t ino;
int bytes;
int i;
- int num_nodes = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_nodes;
+ int num_slots = OCFS2_RAW_SB(ost->ost_fs->fs_super)->s_max_slots;
- for (i = 0; i < num_nodes; ++i) {
+ for (i = 0; i < num_slots; ++i) {
bytes = ocfs2_sprintf_system_inode_name(name, PATH_MAX,
ORPHAN_DIR_SYSTEM_INODE, i);
if (bytes < 1) {
Modified: trunk/fswreck/Makefile
===================================================================
--- trunk/fswreck/Makefile 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/fswreck/Makefile 2005-05-23 23:35:49 UTC (rev 909)
@@ -5,9 +5,9 @@
SBIN_PROGRAMS = fswreck
DEFINES = -DG_DISABLE_DEPRECATED -DLINUX
-DEFINES += -DOCFS2_FLAT_INCLUDES -DVERSION=\"$(VERSION)\"
+DEFINES += -DOCFS2_FLAT_INCLUDES -DO2DLM_FLAT_INCLUDES -DO2CB_FLAT_INCLUDES -DVERSION=\"$(VERSION)\"
-INCLUDES = -Iinclude -I$(TOPDIR)/libocfs2/include
+INCLUDES = -Iinclude -I$(TOPDIR)/libocfs2/include -I$(TOPDIR)/libo2dlm/include -I$(TOPDIR)/libo2cb/include
INCLUDES += $(GLIB_CFLAGS)
ifdef OCFS_DEBUG
@@ -28,7 +28,13 @@
LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
-fswreck: $(OBJS) $(LIBOCFS2_DEPS)
- $(LINK) $(GLIB_LIBS) $(LIBOCFS2_LIBS) $(COM_ERR_LIBS)
+LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm
+LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
+
+fswreck: $(OBJS) $(LIBOCFS2_DEPS) $(LIBO2DLM_DEPS) $(LIBO2CB_DEPS)
+ $(LINK) $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(LIBO2CB_LIBS) $(GLIB_LIBS) $(COM_ERR_LIBS)
+
include $(TOPDIR)/Postamble.make
Modified: trunk/fswreck/corrupt.c
===================================================================
--- trunk/fswreck/corrupt.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/fswreck/corrupt.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -31,7 +31,7 @@
* corrupt_chains()
*
*/
-void corrupt_chains(ocfs2_filesys *fs, int code, uint16_t nodenum)
+void corrupt_chains(ocfs2_filesys *fs, int code, uint16_t slotnum)
{
errcode_t ret;
uint64_t blkno;
@@ -58,11 +58,11 @@
break;
case Y:
snprintf(sysfile, sizeof(sysfile),
- ocfs2_system_inodes[EXTENT_ALLOC_SYSTEM_INODE].si_name, nodenum);
+ ocfs2_system_inodes[EXTENT_ALLOC_SYSTEM_INODE].si_name, slotnum);
break;
case Z:
snprintf(sysfile, sizeof(sysfile),
- ocfs2_system_inodes[INODE_ALLOC_SYSTEM_INODE].si_name, nodenum);
+ ocfs2_system_inodes[INODE_ALLOC_SYSTEM_INODE].si_name, slotnum);
break;
#endif
default:
Modified: trunk/fswreck/include/corrupt.h
===================================================================
--- trunk/fswreck/include/corrupt.h 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/fswreck/include/corrupt.h 2005-05-23 23:35:49 UTC (rev 909)
@@ -26,6 +26,6 @@
#ifndef __CORRUPT_H
#define __CORRUPT_H
-void corrupt_chains(ocfs2_filesys *fs, int code, uint16_t nodenum);
+void corrupt_chains(ocfs2_filesys *fs, int code, uint16_t slotnum);
#endif /* __CORRUPT_H */
Modified: trunk/fswreck/main.c
===================================================================
--- trunk/fswreck/main.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/fswreck/main.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -28,15 +28,16 @@
#define MAX_CORRUPT 12
char *progname = NULL;
-char *device = NULL;
-uint16_t nodenum = 0;
-int corrupt[MAX_CORRUPT];
+static char *device = NULL;
+static uint16_t slotnum = 0;
+static int corrupt[MAX_CORRUPT];
+
struct corrupt_funcs {
- void (*func) (ocfs2_filesys *fs, int code, uint16_t nodenum);
+ void (*func) (ocfs2_filesys *fs, int code, uint16_t slotnum);
};
-struct corrupt_funcs cf[] = {
+static struct corrupt_funcs cf[] = {
{ NULL }, /* 00 */
{ NULL }, /* 01 */
{ NULL }, /* 02 */
@@ -61,7 +62,7 @@
{
g_print ("Usage: %s [OPTION]... [DEVICE]\n", progname);
g_print (" -c <corrupt code>\n");
- g_print (" -n <node number>\n");
+ g_print (" -n <node slot number>\n");
exit (0);
} /* usage */
@@ -123,8 +124,8 @@
}
break;
- case 'n': /* nodenum */
- nodenum = strtoul(optarg, NULL, 0);
+ case 'n': /* slotnum */
+ slotnum = strtoul(optarg, NULL, 0);
break;
default:
@@ -182,7 +183,7 @@
for (i = 1; i <= MAX_CORRUPT; ++i) {
if (corrupt[i]) {
if (cf[i].func)
- cf[i].func(fs, i, nodenum);
+ cf[i].func(fs, i, slotnum);
else
fprintf(stderr, "Unimplemented corrupt code = %d\n", i);
}
Modified: trunk/libo2cb/include/o2cb.h
===================================================================
--- trunk/libo2cb/include/o2cb.h 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libo2cb/include/o2cb.h 2005-05-23 23:35:49 UTC (rev 909)
@@ -43,8 +43,10 @@
#if O2CB_FLAT_INCLUDES
#include "o2cb_err.h"
+#include "ocfs2_nodemanager.h"
#else
#include <o2cb/o2cb_err.h>
+#include <o2cb/ocfs2_nodemanager.h>
#endif
errcode_t o2cb_init(void);
Modified: trunk/libo2cb/include/ocfs2_nodemanager.h
===================================================================
--- trunk/libo2cb/include/ocfs2_nodemanager.h 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libo2cb/include/ocfs2_nodemanager.h 2005-05-23 23:35:49 UTC (rev 909)
@@ -31,7 +31,7 @@
#define NM_API_VERSION 2
#define NM_MAX_NODES 255
-#define NM_INVALID_SLOT_NUM 255
+#define NM_INVALID_NODE_NUM 255
/* host name, group name, cluster name all 64 bytes */
#define NM_MAX_NAME_LEN 64 // __NEW_UTS_LEN
Modified: trunk/libocfs2/alloc.c
===================================================================
--- trunk/libocfs2/alloc.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libocfs2/alloc.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -71,15 +71,14 @@
}
static errcode_t ocfs2_load_allocator(ocfs2_filesys *fs,
- int type, int node_num,
+ int type, int slot_num,
ocfs2_cached_inode **alloc_cinode)
{
errcode_t ret;
uint64_t blkno;
if (!*alloc_cinode) {
- ret = ocfs2_lookup_system_inode(fs, type, node_num,
- &blkno);
+ ret = ocfs2_lookup_system_inode(fs, type, slot_num, &blkno);
if (ret)
return ret;
ret = ocfs2_read_cached_inode(fs, blkno, alloc_cinode);
@@ -121,7 +120,7 @@
return (megabytes << ONE_MB_SHIFT) >> cluster_size_bits;
}
-static void ocfs2_init_inode(ocfs2_filesys *fs, ocfs2_dinode *di, int16_t node,
+static void ocfs2_init_inode(ocfs2_filesys *fs, ocfs2_dinode *di, int16_t slot,
uint64_t gd_blkno, uint64_t blkno, uint16_t mode,
uint32_t flags)
{
@@ -132,7 +131,7 @@
di->i_generation = fs->fs_super->i_generation;
di->i_fs_generation = fs->fs_super->i_fs_generation;
di->i_blkno = blkno;
- di->i_suballoc_node = node;
+ di->i_suballoc_slot = slot;
di->i_suballoc_bit = (uint16_t)(blkno - gd_blkno);
di->i_uid = di->i_gid = 0;
di->i_mode = mode;
@@ -182,7 +181,7 @@
{
strcpy(eb->h_signature, OCFS2_EXTENT_BLOCK_SIGNATURE);
eb->h_blkno = blkno;
- eb->h_suballoc_node = 0;
+ eb->h_suballoc_slot = 0;
eb->h_suballoc_bit = (uint16_t)(blkno - gd_blkno);
eb->h_list.l_count = ocfs2_extent_recs_per_eb(fs->fs_blocksize);
}
@@ -276,7 +275,7 @@
errcode_t ret;
char *buf;
ocfs2_dinode *di;
- int node;
+ int slot;
ocfs2_cached_inode **inode_alloc;
ret = ocfs2_malloc_block(fs->fs_io, &buf);
@@ -287,14 +286,14 @@
if (ret)
goto out;
di = (ocfs2_dinode *)buf;
- node = di->i_suballoc_node;
+ slot = di->i_suballoc_slot;
- if (node == -1)
+ if (slot == OCFS2_INVALID_SLOT)
inode_alloc = &fs->fs_system_inode_alloc;
else
- inode_alloc = &fs->fs_inode_allocs[node];
+ inode_alloc = &fs->fs_inode_allocs[slot];
- ret = ocfs2_load_allocator(fs, INODE_ALLOC_SYSTEM_INODE, node,
+ ret = ocfs2_load_allocator(fs, INODE_ALLOC_SYSTEM_INODE, slot,
inode_alloc);
if (ret)
goto out;
@@ -315,21 +314,22 @@
errcode_t ocfs2_test_inode_allocated(ocfs2_filesys *fs, uint64_t blkno,
int *is_allocated)
{
- uint16_t node, max_nodes = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
+ int16_t slot;
+ uint16_t max_slots = OCFS2_RAW_SB(fs->fs_super)->s_max_slots;
ocfs2_cached_inode **ci;
int type;
errcode_t ret = OCFS2_ET_INTERNAL_FAILURE;
- for (node = ~0; node != max_nodes; node++) {
- if (node == (uint16_t)~0) {
+ for (slot = OCFS2_INVALID_SLOT; slot != max_slots; slot++) {
+ if (slot == OCFS2_INVALID_SLOT) {
type = GLOBAL_INODE_ALLOC_SYSTEM_INODE;
ci = &fs->fs_system_inode_alloc;
} else {
type = INODE_ALLOC_SYSTEM_INODE;
- ci = &fs->fs_inode_allocs[node];
+ ci = &fs->fs_inode_allocs[slot];
}
- ret = ocfs2_load_allocator(fs, type, node, ci);
+ ret = ocfs2_load_allocator(fs, type, slot, ci);
if (ret)
break;
@@ -378,7 +378,7 @@
errcode_t ret;
char *buf;
ocfs2_extent_block *eb;
- int node;
+ int slot;
ret = ocfs2_malloc_block(fs->fs_io, &buf);
if (ret)
@@ -388,16 +388,14 @@
if (ret)
goto out;
eb = (ocfs2_extent_block *)buf;
- node = eb->h_suballoc_node;
+ slot = eb->h_suballoc_slot;
- ret = ocfs2_load_allocator(fs, EXTENT_ALLOC_SYSTEM_INODE,
- node,
- &fs->fs_eb_allocs[node]);
+ ret = ocfs2_load_allocator(fs, EXTENT_ALLOC_SYSTEM_INODE, slot,
+ &fs->fs_eb_allocs[slot]);
if (ret)
goto out;
- ret = ocfs2_chain_free_with_io(fs, fs->fs_eb_allocs[node],
- blkno);
+ ret = ocfs2_chain_free_with_io(fs, fs->fs_eb_allocs[slot], blkno);
if (ret)
goto out;
Modified: trunk/libocfs2/checkhb.c
===================================================================
--- trunk/libocfs2/checkhb.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libocfs2/checkhb.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -50,7 +50,7 @@
uint64_t slotmap_blkno;
int16_t *slots;
int i, j;
- uint32_t num_nodes = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
+ uint32_t num_nodes = OCFS2_RAW_SB(fs->fs_super)->s_max_slots;
slotmap_len = strlen(slotmap);
@@ -112,19 +112,19 @@
goto bail;
/* get label/uuid for ocfs2 */
- dev->max_nodes = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
+ dev->max_slots = OCFS2_RAW_SB(fs->fs_super)->s_max_slots;
memcpy(dev->label, OCFS2_RAW_SB(fs->fs_super)->s_label,
sizeof(dev->label));
memcpy(dev->uuid, OCFS2_RAW_SB(fs->fs_super)->s_uuid,
sizeof(dev->uuid));
- ret = ocfs2_malloc((sizeof(uint8_t) * dev->max_nodes),
+ ret = ocfs2_malloc((sizeof(uint8_t) * dev->max_slots),
&dev->node_nums);
if (ret)
goto bail;
- memset(dev->node_nums, OCFS2_MAX_NODES,
- (sizeof(uint8_t) * dev->max_nodes));
+ memset(dev->node_nums, OCFS2_MAX_SLOTS,
+ (sizeof(uint8_t) * dev->max_slots));
/* read slotmap to get nodes on which the volume is mounted */
ret = ocfs2_read_slotmap(fs, dev->node_nums);
@@ -132,7 +132,7 @@
dev->errcode = ret;
ret = 0;
} else {
- if (dev->node_nums[0] != OCFS2_MAX_NODES)
+ if (dev->node_nums[0] != OCFS2_MAX_SLOTS)
dev->mount_flags |= OCFS2_MF_MOUNTED_CLUSTER;
}
ocfs2_close(fs);
Modified: trunk/libocfs2/dlm.c
===================================================================
--- trunk/libocfs2/dlm.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libocfs2/dlm.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -67,7 +67,7 @@
int i;
errcode_t ret = 0;
- for (i = 0; i < sb->s_max_nodes; ++i) {
+ for (i = 0; i < sb->s_max_slots; ++i) {
snprintf (sysfile, sizeof(sysfile),
ocfs2_system_inodes[JOURNAL_SYSTEM_INODE].si_name, i);
ret = ocfs2_lookup(fs, fs->fs_sysdir_blkno, sysfile,
@@ -83,7 +83,7 @@
errcode_t ocfs2_lock_down_cluster(ocfs2_filesys *fs)
{
ocfs2_super_block *sb = OCFS2_RAW_SB(fs->fs_super);
- uint64_t jrnl_blkno[OCFS2_MAX_NODES];
+ uint64_t jrnl_blkno[OCFS2_MAX_SLOTS];
ocfs2_cached_inode *ci;
errcode_t ret = 0;
int i;
@@ -96,7 +96,7 @@
if (ret)
goto bail;
- for (i = 0; i < sb->s_max_nodes; ++i) {
+ for (i = 0; i < sb->s_max_slots; ++i) {
ret = ocfs2_read_cached_inode(fs, jrnl_blkno[i], &ci);
if (ret) {
ocfs2_super_unlock(fs);
Modified: trunk/libocfs2/extents.c
===================================================================
--- trunk/libocfs2/extents.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libocfs2/extents.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -37,14 +37,14 @@
static void ocfs2_swap_extent_block_to_cpu(ocfs2_extent_block *eb)
{
eb->h_blkno = le64_to_cpu(eb->h_blkno);
- eb->h_suballoc_node = le16_to_cpu(eb->h_suballoc_node);
+ eb->h_suballoc_slot = le16_to_cpu(eb->h_suballoc_slot);
eb->h_suballoc_bit = le16_to_cpu(eb->h_suballoc_bit);
}
static void ocfs2_swap_extent_block_to_le(ocfs2_extent_block *eb)
{
eb->h_blkno = cpu_to_le64(eb->h_blkno);
- eb->h_suballoc_node = cpu_to_le16(eb->h_suballoc_node);
+ eb->h_suballoc_slot = cpu_to_le16(eb->h_suballoc_slot);
eb->h_suballoc_bit = cpu_to_le16(eb->h_suballoc_bit);
}
Modified: trunk/libocfs2/heartbeat.c
===================================================================
--- trunk/libocfs2/heartbeat.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libocfs2/heartbeat.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -82,10 +82,8 @@
blocks = rec->e_clusters << cluster_bits;
blocks >>= block_bits;
- /* clamp to NM_MAX_NODES */
- /* XXX: hmmbo, NM_MAX_NODES is 255 */
- if (blocks > 254)
- blocks = 254;
+ if (blocks > NM_MAX_NODES)
+ blocks = NM_MAX_NODES;
start_block = rec->e_blkno << block_bits;
start_block >>= sectsize_bits;
Modified: trunk/libocfs2/include/ocfs2.h
===================================================================
--- trunk/libocfs2/include/ocfs2.h 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libocfs2/include/ocfs2.h 2005-05-23 23:35:49 UTC (rev 909)
@@ -155,10 +155,6 @@
#define OCFS2_MF_SWAP 0x08
#define OCFS2_MF_MOUNTED_CLUSTER 0x16
-/* Some constants used in heartbeat */
-#define OCFS2_NODE_MAP_MAX_NODES 256
-#define OCFS2_HBT_WAIT 10
-
/* check_heartbeats progress states */
#define OCFS2_CHB_START 1
#define OCFS2_CHB_WAITING 2
@@ -173,7 +169,6 @@
typedef struct _ocfs2_inode_scan ocfs2_inode_scan;
typedef struct _ocfs2_dir_scan ocfs2_dir_scan;
typedef struct _ocfs2_bitmap ocfs2_bitmap;
-typedef struct _ocfs2_nodes ocfs2_nodes;
typedef struct _ocfs2_devices ocfs2_devices;
struct _ocfs2_filesys {
@@ -224,7 +219,7 @@
uint32_t min_num; /* minor number of the device */
errcode_t errcode; /* error encountered reading device */
void *private;
- uint16_t max_nodes;
+ uint16_t max_slots;
uint8_t *node_nums; /* list of mounted nodes */
};
@@ -386,7 +381,7 @@
uint64_t *inode);
errcode_t ocfs2_lookup_system_inode(ocfs2_filesys *fs, int type,
- int node_num, uint64_t *blkno);
+ int slot_num, uint64_t *blkno);
errcode_t ocfs2_link(ocfs2_filesys *fs, uint64_t dir, const char *name,
uint64_t ino, int flags);
Modified: trunk/libocfs2/include/ocfs2_fs.h
===================================================================
--- trunk/libocfs2/include/ocfs2_fs.h 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libocfs2/include/ocfs2_fs.h 2005-05-23 23:35:49 UTC (rev 909)
@@ -111,9 +111,9 @@
/* 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_LOCAL_ALLOC_FL (0x00000040) /* Slot local alloc bitmap */
#define OCFS2_BITMAP_FL (0x00000080) /* Allocation bitmap */
-#define OCFS2_JOURNAL_FL (0x00000100) /* Node journal */
+#define OCFS2_JOURNAL_FL (0x00000100) /* Slot local journal */
#define OCFS2_HEARTBEAT_FL (0x00000200) /* Heartbeat area */
#define OCFS2_CHAIN_FL (0x00000400) /* Chain allocator */
#define OCFS2_DEALLOC_FL (0x00000800) /* Truncate log */
@@ -131,15 +131,15 @@
/* Limit of space in ocfs2_dir_entry */
#define OCFS2_MAX_FILENAME_LEN 255
-/* Limit of node map bits in ocfs2_disk_lock */
-#define OCFS2_MAX_NODES 255
+/* Maximum slots on an ocfs2 file system */
+#define OCFS2_MAX_SLOTS 255
+/* Slot map indicator for an empty slot */
+#define OCFS2_INVALID_SLOT -1
+
#define OCFS2_VOL_UUID_LEN 16
#define OCFS2_MAX_VOL_LABEL_LEN 64
-#define OCFS2_MAX_CLUSTER_NAME_LEN 64
-
-
/* Journal limits (in bytes) */
#define OCFS2_MIN_JOURNAL_SIZE (4 * 1024 * 1024)
#define OCFS2_MAX_JOURNAL_SIZE (500 * 1024 * 1024)
@@ -179,7 +179,7 @@
[HEARTBEAT_SYSTEM_INODE] = { "heartbeat", OCFS2_HEARTBEAT_FL, S_IFREG | 0644 },
[GLOBAL_BITMAP_SYSTEM_INODE] = { "global_bitmap", 0, S_IFREG | 0644 },
- /* Node-specific system inodes (one copy per node) */
+ /* Slot-specific system inodes (one copy per slot) */
[ORPHAN_DIR_SYSTEM_INODE] = { "orphan_dir:%04d", 0, S_IFDIR | 0755 },
[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 },
@@ -313,9 +313,9 @@
{
/*00*/ __u8 h_signature[8]; /* Signature for verification */
__u64 h_reserved1;
-/*10*/ __s16 h_suballoc_node; /* Node suballocator this
+/*10*/ __s16 h_suballoc_slot; /* Slot suballocator this
extent_header belongs to */
- __u16 h_suballoc_bit; /* Bit offset in suballocater
+ __u16 h_suballoc_bit; /* Bit offset in suballocator
block group */
__u32 h_fs_generation; /* Must match super block */
__u64 h_blkno; /* Offset on disk, in blocks */
@@ -351,8 +351,8 @@
directory dinode */
__u32 s_blocksize_bits; /* Blocksize for this fs */
__u32 s_clustersize_bits; /* Clustersize for this fs */
-/*40*/ __u16 s_max_nodes; /* Max nodes in this cluster before
- tunefs required */
+/*40*/ __u16 s_max_slots; /* Max number of simultaneous mounts
+ before tunefs required */
__u16 s_reserved1;
__u32 s_reserved2;
__u64 s_first_cluster_group; /* Block offset of 1st cluster
@@ -363,8 +363,8 @@
} ocfs2_super_block;
/*
- * Local allocation bitmap for OCFS2 nodes
- * Node that it exists inside an ocfs2_dinode, so all offsets are
+ * Local allocation bitmap for OCFS2 slots
+ * Note that it exists inside an ocfs2_dinode, so all offsets are
* relative to the start of ocfs2_dinode.id2.
*/
typedef struct _ocfs2_local_alloc
@@ -382,9 +382,9 @@
typedef struct _ocfs2_dinode {
/*00*/ __u8 i_signature[8]; /* Signature for validation */
__u32 i_generation; /* Generation number */
- __s16 i_suballoc_node; /* Node suballocater this inode
+ __s16 i_suballoc_slot; /* Slot suballocator this inode
belongs to */
- __u16 i_suballoc_bit; /* Bit offset in suballocater
+ __u16 i_suballoc_bit; /* Bit offset in suballocator
block group */
/*10*/ __u32 i_reserved0;
__u32 i_clusters; /* Cluster count */
@@ -613,14 +613,14 @@
}
static inline int ocfs2_sprintf_system_inode_name(char *buf, int len,
- int type, int node)
+ int type, int slot)
{
int chars;
/*
* Global system inodes can only have one copy. Everything
* after OCFS_LAST_GLOBAL_SYSTEM_INODE in the system inode
- * list has a copy per node.
+ * list has a copy per slot.
*/
if (type <= OCFS2_LAST_GLOBAL_SYSTEM_INODE)
chars = snprintf(buf, len,
@@ -628,7 +628,7 @@
else
chars = snprintf(buf, len,
ocfs2_system_inodes[type].si_name,
- node);
+ slot);
return chars;
}
Modified: trunk/libocfs2/inode.c
===================================================================
--- trunk/libocfs2/inode.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libocfs2/inode.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -67,7 +67,7 @@
void ocfs2_swap_inode_to_cpu(ocfs2_dinode *di)
{
di->i_generation = le32_to_cpu(di->i_generation);
- di->i_suballoc_node = le16_to_cpu(di->i_suballoc_node);
+ di->i_suballoc_slot = le16_to_cpu(di->i_suballoc_slot);
di->i_suballoc_bit = le16_to_cpu(di->i_suballoc_bit);
di->i_fs_generation = le32_to_cpu(di->i_fs_generation);
@@ -87,7 +87,7 @@
void ocfs2_swap_inode_to_le(ocfs2_dinode *di)
{
di->i_generation = cpu_to_le32(di->i_generation);
- di->i_suballoc_node = cpu_to_le16(di->i_suballoc_node);
+ di->i_suballoc_slot = cpu_to_le16(di->i_suballoc_slot);
di->i_suballoc_bit = cpu_to_le16(di->i_suballoc_bit);
di->i_fs_generation = cpu_to_le32(di->i_fs_generation);
Modified: trunk/libocfs2/inode_scan.c
===================================================================
--- trunk/libocfs2/inode_scan.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libocfs2/inode_scan.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -258,7 +258,7 @@
ocfs2_inode_scan *scan;
uint64_t blkno;
errcode_t ret;
- int i, node_num;
+ int i, slot_num;
ret = ocfs2_malloc0(sizeof(struct _ocfs2_inode_scan), &scan);
if (ret)
@@ -266,9 +266,9 @@
scan->fs = fs;
- /* One inode alloc per node, one global inode alloc */
+ /* One inode alloc per slot, one global inode alloc */
scan->num_inode_alloc =
- OCFS2_RAW_SB(fs->fs_super)->s_max_nodes + 1;
+ OCFS2_RAW_SB(fs->fs_super)->s_max_slots + 1;
ret = ocfs2_malloc0(sizeof(ocfs2_cached_inode *) *
scan->num_inode_alloc,
&scan->inode_alloc);
@@ -303,10 +303,10 @@
goto out_cleanup;
for (i = 1; i < scan->num_inode_alloc; i++) {
- node_num = i - 1;
+ slot_num = i - 1;
ret = ocfs2_lookup_system_inode(fs,
INODE_ALLOC_SYSTEM_INODE,
- node_num,
+ slot_num,
&blkno);
if (ret)
goto out_cleanup;
Modified: trunk/libocfs2/openfs.c
===================================================================
--- trunk/libocfs2/openfs.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libocfs2/openfs.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -93,7 +93,7 @@
sb->s_system_dir_blkno = le64_to_cpu(sb->s_system_dir_blkno);
sb->s_blocksize_bits = le32_to_cpu(sb->s_blocksize_bits);
sb->s_clustersize_bits = le32_to_cpu(sb->s_clustersize_bits);
- sb->s_max_nodes = le16_to_cpu(sb->s_max_nodes);
+ sb->s_max_slots = le16_to_cpu(sb->s_max_slots);
sb->s_first_cluster_group = le64_to_cpu(sb->s_first_cluster_group);
}
@@ -119,7 +119,7 @@
sb->s_system_dir_blkno = cpu_to_le64(sb->s_system_dir_blkno);
sb->s_blocksize_bits = cpu_to_le32(sb->s_blocksize_bits);
sb->s_clustersize_bits = cpu_to_le32(sb->s_clustersize_bits);
- sb->s_max_nodes = cpu_to_le16(sb->s_max_nodes);
+ sb->s_max_slots = cpu_to_le16(sb->s_max_slots);
sb->s_first_cluster_group = cpu_to_le64(sb->s_first_cluster_group);
}
@@ -287,16 +287,16 @@
if (!OCFS2_RAW_SB(fs->fs_super)->s_root_blkno ||
!OCFS2_RAW_SB(fs->fs_super)->s_system_dir_blkno)
goto out;
- if (OCFS2_RAW_SB(fs->fs_super)->s_max_nodes > OCFS2_MAX_NODES)
+ if (OCFS2_RAW_SB(fs->fs_super)->s_max_slots > OCFS2_MAX_SLOTS)
goto out;
- ret = ocfs2_malloc0(OCFS2_RAW_SB(fs->fs_super)->s_max_nodes *
+ ret = ocfs2_malloc0(OCFS2_RAW_SB(fs->fs_super)->s_max_slots *
sizeof(ocfs2_cached_inode *),
&fs->fs_inode_allocs);
if (ret)
goto out;
- ret = ocfs2_malloc0(OCFS2_RAW_SB(fs->fs_super)->s_max_nodes *
+ ret = ocfs2_malloc0(OCFS2_RAW_SB(fs->fs_super)->s_max_slots *
sizeof(ocfs2_cached_inode *),
&fs->fs_eb_allocs);
if (ret)
Modified: trunk/libocfs2/sysfile.c
===================================================================
--- trunk/libocfs2/sysfile.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/libocfs2/sysfile.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -30,7 +30,7 @@
#include "ocfs2.h"
errcode_t ocfs2_lookup_system_inode(ocfs2_filesys *fs, int type,
- int node_num, uint64_t *blkno)
+ int slot_num, uint64_t *blkno)
{
errcode_t ret;
char *buf;
@@ -40,7 +40,7 @@
return ret;
ocfs2_sprintf_system_inode_name(buf, OCFS2_MAX_FILENAME_LEN,
- type, node_num);
+ type, slot_num);
ret = ocfs2_lookup(fs, fs->fs_sysdir_blkno, buf,
strlen(buf), NULL, blkno);
Modified: trunk/mkfs.ocfs2/mkfs.c
===================================================================
--- trunk/mkfs.ocfs2/mkfs.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/mkfs.ocfs2/mkfs.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -53,7 +53,7 @@
static void add_entry_to_directory(State *s, DirData *dir, char *name,
uint64_t byte_off, uint8_t type);
static uint32_t blocks_needed(State *s);
-static uint32_t sys_blocks_needed(uint32_t num_nodes);
+static uint32_t sys_blocks_needed(uint32_t num_slots);
static uint32_t system_dir_blocks_needed(State *s);
static void check_32bit_blocks(State *s);
static void format_superblock(State *s, SystemFileDiskRecord *rec,
@@ -69,7 +69,7 @@
static void replacement_journal_create(State *s, uint64_t journal_off);
static void open_device(State *s);
static void close_device(State *s);
-static int initial_nodes_for_volume(uint64_t size);
+static int initial_slots_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 mode);
@@ -139,7 +139,7 @@
SystemFileDiskRecord root_dir_rec;
SystemFileDiskRecord system_dir_rec;
int i, j, num;
- DirData *orphan_dir[OCFS2_MAX_NODES];
+ DirData *orphan_dir[OCFS2_MAX_SLOTS];
DirData *root_dir;
DirData *system_dir;
uint64_t need;
@@ -202,7 +202,7 @@
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;
+ num = system_files[i].global ? 1 : s->initial_slots;
record[i] = do_malloc(s, sizeof(SystemFileDiskRecord) * num);
for (j = 0; j < num; j++) {
@@ -213,7 +213,7 @@
root_dir = alloc_directory(s);
system_dir = alloc_directory(s);
- for (i = 0; i < s->initial_nodes; ++i)
+ for (i = 0; i < s->initial_slots; ++i)
orphan_dir[i] = alloc_directory(s);
need = (s->volume_size_in_clusters + 7) >> 3;
@@ -286,7 +286,7 @@
add_entry_to_directory(s, system_dir, "..", system_dir_rec.fe_off, OCFS2_FT_DIR);
for (i = 0; i < NUM_SYSTEM_INODES; i++) {
- num = (system_files[i].global) ? 1 : s->initial_nodes;
+ num = (system_files[i].global) ? 1 : s->initial_slots;
for (j = 0; j < num; j++) {
record[i][j].fe_off = alloc_inode(s, &(record[i][j].suballoc_bit));
@@ -305,12 +305,12 @@
tmprec->fe_off >> s->blocksize_bits;
tmprec = &(record[HEARTBEAT_SYSTEM_INODE][0]);
- need = (OCFS2_MAX_NODES + 1) << s->blocksize_bits;
+ need = (NM_MAX_NODES + 1) << s->blocksize_bits;
alloc_bytes_from_bitmap(s, need, s->global_bm, &tmprec->extent_off, &tmprec->extent_len);
tmprec->file_size = need;
- for (i = 0; i < s->initial_nodes; ++i) {
+ for (i = 0; i < s->initial_slots; ++i) {
tmprec = &record[ORPHAN_DIR_SYSTEM_INODE][i];
orphan_dir[i]->record = tmprec;
alloc_from_bitmap(s, 1, s->global_bm, &tmprec->extent_off, &tmprec->extent_len);
@@ -333,7 +333,7 @@
format_file(s, &system_dir_rec);
for (i = 0; i < NUM_SYSTEM_INODES; i++) {
- num = system_files[i].global ? 1 : s->initial_nodes;
+ num = system_files[i].global ? 1 : s->initial_slots;
for (j = 0; j < num; j++) {
tmprec = &(record[i][j]);
if (system_files[i].type == SFI_JOURNAL) {
@@ -364,7 +364,7 @@
write_directory_data(s, root_dir);
write_directory_data(s, system_dir);
- for (i = 0; i < s->initial_nodes; ++i)
+ for (i = 0; i < s->initial_slots; ++i)
write_directory_data(s, orphan_dir[i]);
tmprec = &(record[HEARTBEAT_SYSTEM_INODE][0]);
@@ -408,7 +408,7 @@
unsigned int blocksize = 0;
unsigned int cluster_size = 0;
char *vol_label = NULL;
- unsigned int initial_nodes = 0;
+ unsigned int initial_slots = 0;
char *dummy;
State *s;
int c;
@@ -423,7 +423,7 @@
{ "block-size", 1, 0, 'b' },
{ "cluster-size", 1, 0, 'C' },
{ "label", 1, 0, 'L' },
- { "nodes", 1, 0, 'N' },
+ { "node-slots", 1, 0, 'N' },
{ "verbose", 0, 0, 'v' },
{ "quiet", 0, 0, 'q' },
{ "version", 0, 0, 'V' },
@@ -495,16 +495,18 @@
break;
case 'N':
- initial_nodes = strtoul(optarg, &dummy, 0);
+ initial_slots = strtoul(optarg, &dummy, 0);
- if (initial_nodes > OCFS2_MAX_NODES || *dummy != '\0') {
+ if (initial_slots > OCFS2_MAX_SLOTS || *dummy != '\0') {
com_err(progname, 0,
- "Initial nodes must be no more than %d",
- OCFS2_MAX_NODES);
+ "Initial node slots must be no more "
+ "than %d",
+ OCFS2_MAX_SLOTS);
exit(1);
- } else if (initial_nodes < 1) {
+ } else if (initial_slots < 1) {
com_err(progname, 0,
- "Initial nodes must be at least 1");
+ "Initial node slots must be at "
+ "least 1");
exit(1);
}
@@ -583,7 +585,7 @@
s->blocksize = blocksize;
s->cluster_size = cluster_size;
s->vol_label = vol_label;
- s->initial_nodes = initial_nodes;
+ s->initial_slots = initial_slots;
s->device_name = strdup(device_name);
@@ -705,8 +707,10 @@
static void
usage(const char *progname)
{
- fprintf(stderr, "Usage: %s [-b block-size] [-C cluster-size] [-L volume-label]\n"
- "\t[-N number-of-nodes] [-J journal-options] [-FqvV] device [blocks-count]\n",
+ fprintf(stderr, "Usage: %s [-b block-size] [-C cluster-size] "
+ "[-N number-of-node-slots]\n"
+ "\t[-L volume-label] [-J journal-options] [-FqvV] "
+ "device [blocks-count]\n",
progname);
exit(0);
}
@@ -732,7 +736,7 @@
/* mke2fs knows about free blocks at this point, but
* we don't so lets just take a wild guess as to what
* the fs overhead we're looking at will be. */
- if ((j_blocks * s->initial_nodes + 1024) >
+ if ((j_blocks * s->initial_slots + 1024) >
s->volume_size_in_blocks) {
fprintf(stderr,
"Journal size too big for filesystem.\n");
@@ -886,9 +890,9 @@
printf("nr_cluster_groups = %u\n", s->nr_cluster_groups);
printf("tail_group_bits = %u\n", s->tail_group_bits);
#endif
- if (!s->initial_nodes) {
- s->initial_nodes =
- initial_nodes_for_volume(s->volume_size_in_bytes);
+ if (!s->initial_slots) {
+ s->initial_slots =
+ initial_slots_for_volume(s->volume_size_in_bytes);
}
if (!s->vol_label) {
@@ -1368,13 +1372,13 @@
num += ROOTDIR_BLOCKS;
num += SYSDIR_BLOCKS;
num += LOSTDIR_BLOCKS;
- num += sys_blocks_needed(MAX(32, s->initial_nodes));
+ num += sys_blocks_needed(MAX(32, s->initial_slots));
return num;
}
static uint32_t
-sys_blocks_needed(uint32_t num_nodes)
+sys_blocks_needed(uint32_t num_slots)
{
uint32_t num = 0;
uint32_t cnt = sizeof(system_files) / sizeof(SystemFileInfo);
@@ -1384,7 +1388,7 @@
if (system_files[i].global)
++num;
else
- num += num_nodes;
+ num += num_slots;
}
return num;
@@ -1397,7 +1401,7 @@
int each = OCFS2_DIR_REC_LEN(SYSTEM_FILE_NAME_MAX);
int entries_per_block = s->blocksize / each;
- bytes_needed = ((sys_blocks_needed(s->initial_nodes) +
+ bytes_needed = ((sys_blocks_needed(s->initial_slots) +
entries_per_block - 1) / entries_per_block) << s->blocksize_bits;
return (bytes_needed + s->cluster_size - 1) >> s->cluster_size_bits;
@@ -1457,7 +1461,7 @@
memset(di, 0, s->blocksize);
strcpy(di->i_signature, OCFS2_SUPER_BLOCK_SIGNATURE);
- di->i_suballoc_node = cpu_to_le16((__u16)-1);
+ di->i_suballoc_slot = cpu_to_le16((__u16)OCFS2_INVALID_SLOT);
di->i_suballoc_bit = cpu_to_le16((__u16)-1);
di->i_generation = cpu_to_le32(s->vol_generation);
di->i_fs_generation = cpu_to_le32(s->vol_generation);
@@ -1481,7 +1485,7 @@
di->id2.i_super.s_creator_os = cpu_to_le32(OCFS2_OS_LINUX);
di->id2.i_super.s_blocksize_bits = cpu_to_le32(s->blocksize_bits);
di->id2.i_super.s_clustersize_bits = cpu_to_le32(s->cluster_size_bits);
- di->id2.i_super.s_max_nodes = cpu_to_le16(s->initial_nodes);
+ di->id2.i_super.s_max_slots = cpu_to_le16(s->initial_slots);
di->id2.i_super.s_first_cluster_group = cpu_to_le64(s->first_cluster_group_blkno);
#ifdef CONFIG_ARCH_S390
@@ -1541,7 +1545,7 @@
strcpy(di->i_signature, OCFS2_INODE_SIGNATURE);
di->i_generation = cpu_to_le32(s->vol_generation);
di->i_fs_generation = cpu_to_le32(s->vol_generation);
- di->i_suballoc_node = cpu_to_le16(-1);
+ di->i_suballoc_slot = cpu_to_le16((__u16)OCFS2_INVALID_SLOT);
di->i_suballoc_bit = cpu_to_le16(rec->suballoc_bit);
di->i_blkno = rec->fe_off >> s->blocksize_bits;
di->i_uid = 0;
@@ -1805,7 +1809,7 @@
}
static int
-initial_nodes_for_volume(uint64_t size)
+initial_slots_for_volume(uint64_t size)
{
int i, shift = ONE_GB_SHIFT;
int defaults[4] = { 2, 4, 8, 16 };
@@ -1900,7 +1904,7 @@
printf("%u cluster groups (tail covers %u clusters, rest cover %u "
"clusters)\n", s->nr_cluster_groups, s->tail_group_bits,
s->global_cpg);
- printf("Initial number of nodes: %u\n", s->initial_nodes);
+ printf("Initial number of node slots: %u\n", s->initial_slots);
}
static void
Modified: trunk/mkfs.ocfs2/mkfs.h
===================================================================
--- trunk/mkfs.ocfs2/mkfs.h 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/mkfs.ocfs2/mkfs.h 2005-05-23 23:35:49 UTC (rev 909)
@@ -210,7 +210,7 @@
uint64_t reserved_tail_size;
- unsigned int initial_nodes;
+ unsigned int initial_slots;
uint64_t journal_size_in_bytes;
Modified: trunk/mkfs.ocfs2/mkfs.ocfs2.8.in
===================================================================
--- trunk/mkfs.ocfs2/mkfs.ocfs2.8.in 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/mkfs.ocfs2/mkfs.ocfs2.8.in 2005-05-23 23:35:49 UTC (rev 909)
@@ -17,11 +17,11 @@
.TP
\fB\-L\fR \fIvolume\-label\fR
-\fIVolume\-label\fR is usefull when the \fILABEL\fR option is used to mount the partitions. The maximum \fIvolume-label\fR lenght allowed is 64 bytes.
+\fIVolume\-label\fR is useful when the \fILABEL\fR option is used to mount the partitions. The maximum \fIvolume-label\fR lenght allowed is 64 bytes.
.TP
-\fB\-N\fR \fInumber\-of\-nodes\fR
-\fInumber\-of\-nodes\fR specify the max number of nodes where the partition will be mounted. The maximum \fInumber\-of\-nodes\fR allowed is 255. That will allow a better control of allocated space and make OCFS2 more efficient.
+\fB\-N\fR \fInumber\-of\-node\-slots\fR
+\fInumber\-of\-node\-slots\fR specify the maximum number of nodes that can simultaneously mount the partition. The maximum \fInumber\-of\-node\-slots\fR allowed is 255. That will allow a better control of allocated space and make OCFS2 more efficient.
.TP
\fB\-J\fR \fIjournal\-options\fR
Modified: trunk/mounted.ocfs2/mounted.c
===================================================================
--- trunk/mounted.ocfs2/mounted.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/mounted.ocfs2/mounted.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -56,7 +56,7 @@
uint8_t n;
uint8_t *nums = dev->node_nums;
- for (i = 0; i < dev->max_nodes && nums[i] != OCFS2_MAX_NODES; ++i) {
+ for (i = 0; i < dev->max_slots && nums[i] != NM_MAX_NODES; ++i) {
if (i)
printf(", ");
n = nums[i];
@@ -74,7 +74,7 @@
struct list_head *pos;
char **node_names = NULL;
char **cluster_names = NULL;
- char *nodes[OCFS2_MAX_NODES];
+ char *nodes[NM_MAX_NODES];
int i = 0;
uint16_t num;
@@ -90,7 +90,7 @@
if (o2cb_get_node_num(*cluster_names, node_names[i],
&num))
break;
- if (num >= OCFS2_MAX_NODES)
+ if (num >= NM_MAX_NODES)
break;
nodes[num] = node_names[i];
++i;
@@ -109,7 +109,7 @@
fflush(stdout);
com_err("Unknown", dev->errcode, " ");
} else {
- if (dev->node_nums[0] == OCFS2_MAX_NODES) {
+ if (dev->node_nums[0] == NM_MAX_NODES) {
printf("Not mounted\n");
continue;
}
Modified: trunk/ocfs2console/ocfs2interface/format.py
===================================================================
--- trunk/ocfs2console/ocfs2interface/format.py 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/ocfs2console/ocfs2interface/format.py 2005-05-23 23:35:49 UTC (rev 909)
@@ -22,7 +22,7 @@
from guiutil import Dialog, set_props, error_box, format_bytes
from process import Process
-from fswidgets import BaseCombo, NumNodes, VolumeLabel, ClusterSize, BlockSize
+from fswidgets import BaseCombo, NumSlots, VolumeLabel, ClusterSize, BlockSize
base_command = ('mkfs.ocfs2', '-x')
@@ -40,7 +40,7 @@
VolumeLabel.__init__(self)
self.set_text('oracle')
-entries = (Device, FormatVolumeLabel, ClusterSize, NumNodes, BlockSize)
+entries = (Device, FormatVolumeLabel, ClusterSize, NumSlots, BlockSize)
def format_partition(parent, device):
partitions = []
Modified: trunk/ocfs2console/ocfs2interface/fswidgets.py
===================================================================
--- trunk/ocfs2console/ocfs2interface/fswidgets.py 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/ocfs2console/ocfs2interface/fswidgets.py 2005-05-23 23:35:49 UTC (rev 909)
@@ -89,14 +89,14 @@
else:
return None
-class NumNodes(gtk.SpinButton):
+class NumSlots(gtk.SpinButton):
def __init__(self):
- adjustment = gtk.Adjustment(4, 2, ocfs2.MAX_NODES, 1, 10)
+ adjustment = gtk.Adjustment(4, 1, ocfs2.MAX_SLOTS, 1, 10)
gtk.SpinButton.__init__(self, adjustment=adjustment)
self.set_numeric(True)
- label = 'Number of _nodes'
+ label = 'Number of _node slots'
def get_arg(self):
s = self.get_text()
Modified: trunk/ocfs2console/ocfs2interface/nodeconfig.py
===================================================================
--- trunk/ocfs2console/ocfs2interface/nodeconfig.py 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/ocfs2console/ocfs2interface/nodeconfig.py 2005-05-23 23:35:49 UTC (rev 909)
@@ -223,9 +223,9 @@
self.set_response_sensitive(gtk.RESPONSE_APPLY, state)
def add_node(self, b):
- if len(self.store) == ocfs2.MAX_NODES:
+ if len(self.store) == o2cb.NM_MAX_NODES:
error_box(self, 'Cannot have more than %d nodes in a cluster' %
- ocfs2.MAX_NODES)
+ o2cb.NM_MAX_NODES)
return
node_attrs = self.node_query(title='Add Node')
Modified: trunk/ocfs2console/ocfs2interface/o2cbmodule.c
===================================================================
--- trunk/ocfs2console/ocfs2interface/o2cbmodule.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/ocfs2console/ocfs2interface/o2cbmodule.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -28,7 +28,6 @@
#include "o2cb.h"
#include "o2cb_abi.h"
-#include "ocfs2_nodemanager.h"
/* FIXME: right now we don't wrap the init function */
@@ -541,7 +540,7 @@
ADD_INT_CONSTANT (API_VERSION);
ADD_INT_CONSTANT (MAX_NODES);
- ADD_INT_CONSTANT (INVALID_SLOT_NUM);
+ ADD_INT_CONSTANT (INVALID_NODE_NUM);
ADD_INT_CONSTANT (MAX_NAME_LEN);
Modified: trunk/ocfs2console/ocfs2interface/ocfs2module.c
===================================================================
--- trunk/ocfs2console/ocfs2interface/ocfs2module.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/ocfs2console/ocfs2interface/ocfs2module.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -143,7 +143,7 @@
static PyMemberDef dinode_members[] = {
DINODE_STR_MEMBER (signature),
DINODE_U32_MEMBER (generation),
- DINODE_S16_MEMBER (suballoc_node),
+ DINODE_S16_MEMBER (suballoc_slot),
DINODE_U16_MEMBER (suballoc_bit),
DINODE_U32_MEMBER (clusters),
DINODE_U32_MEMBER (uid),
@@ -392,7 +392,7 @@
SUPER_U32_MEMBER (feature_ro_compat),
SUPER_U32_MEMBER (blocksize_bits),
SUPER_U32_MEMBER (clustersize_bits),
- SUPER_U16_MEMBER (max_nodes),
+ SUPER_U16_MEMBER (max_slots),
{"s_label", T_STRING_INPLACE, offsetof (SuperBlock, super.s_label), RO},
{"fs", T_OBJECT, offsetof (SuperBlock, fs_obj), RO},
{0}
@@ -684,17 +684,17 @@
PyObject *kwargs)
{
errcode_t ret;
- int type, node_num = -1;
+ int type, slot_num = OCFS2_INVALID_SLOT;
uint64_t blkno;
- static char *kwlist[] = { "type", "node_num", NULL };
+ static char *kwlist[] = { "type", "slot_num", NULL };
if (!PyArg_ParseTupleAndKeywords (args, kwargs,
"i|i:lookup_system_inode", kwlist,
- &type, &node_num))
+ &type, &slot_num))
return NULL;
- CHECK_ERROR (ocfs2_lookup_system_inode(self->fs, type, node_num, &blkno));
+ CHECK_ERROR (ocfs2_lookup_system_inode(self->fs, type, slot_num, &blkno));
return PyLong_FromUnsignedLongLong (blkno);
}
@@ -1082,13 +1082,13 @@
ADD_INT_CONSTANT (MAX_FILENAME_LEN);
- ADD_INT_CONSTANT (MAX_NODES);
+ ADD_INT_CONSTANT (MAX_SLOTS);
+ ADD_INT_CONSTANT (INVALID_SLOT);
+
ADD_INT_CONSTANT (VOL_UUID_LEN);
ADD_INT_CONSTANT (MAX_VOL_LABEL_LEN);
- ADD_INT_CONSTANT (MAX_CLUSTER_NAME_LEN);
-
ADD_INT_CONSTANT (MIN_JOURNAL_SIZE);
ADD_INT_CONSTANT (MAX_JOURNAL_SIZE);
@@ -1141,8 +1141,6 @@
ADD_INT_CONSTANT (LOCAL_ALLOC_SYSTEM_INODE);
ADD_INT_CONSTANT (NUM_SYSTEM_INODES);
- //ADD_INT_CONSTANT (MAX_NODE_NAME_LEN);
-
#undef ADD_INT_CONSTANT
}
Modified: trunk/ocfs2console/ocfs2interface/tune.py
===================================================================
--- trunk/ocfs2console/ocfs2interface/tune.py 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/ocfs2console/ocfs2interface/tune.py 2005-05-23 23:35:49 UTC (rev 909)
@@ -22,7 +22,7 @@
from guiutil import Dialog, set_props, error_box, format_bytes
from process import Process
-from fswidgets import NumNodes, VolumeLabel
+from fswidgets import NumSlots, VolumeLabel
base_command = ('tunefs.ocfs2', '-x')
@@ -41,15 +41,15 @@
empty_ok = True
-class TuneNumNodes(NumNodes):
+class TuneNumSlots(NumSlots):
def __init__(self, device=None):
- NumNodes.__init__(self)
+ NumSlots.__init__(self)
fs = ocfs2.Filesystem(device)
- self.set_range(fs.fs_super.s_max_nodes, ocfs2.MAX_NODES)
+ self.set_range(fs.fs_super.s_max_nodes, ocfs2.MAX_SLOTS)
- title = 'Edit Node Count'
- action = 'Changing node count'
+ title = 'Edit Node Slot Count'
+ action = 'Changing node slot count'
empty_ok = False
Modified: trunk/sizetest/sizetest.c
===================================================================
--- trunk/sizetest/sizetest.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/sizetest/sizetest.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -106,7 +106,7 @@
SHOW_OFFSET(ocfs2_extent_block, h_signature);
SHOW_OFFSET(ocfs2_extent_block, h_reserved1);
- SHOW_OFFSET(ocfs2_extent_block, h_suballoc_node);
+ SHOW_OFFSET(ocfs2_extent_block, h_suballoc_slot);
SHOW_OFFSET(ocfs2_extent_block, h_suballoc_bit);
SHOW_OFFSET(ocfs2_extent_block, h_fs_generation);
SHOW_OFFSET(ocfs2_extent_block, h_blkno);
@@ -138,7 +138,7 @@
SHOW_OFFSET(ocfs2_super_block, s_system_dir_blkno);
SHOW_OFFSET(ocfs2_super_block, s_blocksize_bits);
SHOW_OFFSET(ocfs2_super_block, s_clustersize_bits);
- SHOW_OFFSET(ocfs2_super_block, s_max_nodes);
+ SHOW_OFFSET(ocfs2_super_block, s_max_slots);
SHOW_OFFSET(ocfs2_super_block, s_reserved1);
SHOW_OFFSET(ocfs2_super_block, s_reserved2);
SHOW_OFFSET(ocfs2_super_block, s_first_cluster_group);
@@ -169,7 +169,7 @@
SHOW_OFFSET(ocfs2_dinode, i_signature);
SHOW_OFFSET(ocfs2_dinode, i_generation);
- SHOW_OFFSET(ocfs2_dinode, i_suballoc_node);
+ SHOW_OFFSET(ocfs2_dinode, i_suballoc_slot);
SHOW_OFFSET(ocfs2_dinode, i_suballoc_bit);
SHOW_OFFSET(ocfs2_dinode, i_reserved0);
SHOW_OFFSET(ocfs2_dinode, i_clusters);
@@ -186,8 +186,10 @@
SHOW_OFFSET(ocfs2_dinode, i_blkno);
SHOW_OFFSET(ocfs2_dinode, i_last_eb_blk);
SHOW_OFFSET(ocfs2_dinode, i_fs_generation);
+ SHOW_OFFSET(ocfs2_dinode, i_atime_nsec);
+ SHOW_OFFSET(ocfs2_dinode, i_ctime_nsec);
+ SHOW_OFFSET(ocfs2_dinode, i_mtime_nsec);
SHOW_OFFSET(ocfs2_dinode, i_reserved1);
- SHOW_OFFSET(ocfs2_dinode, i_reserved2);
SHOW_OFFSET(ocfs2_dinode, id1.i_pad1);
SHOW_OFFSET(ocfs2_dinode, id1.dev1.i_rdev);
Modified: trunk/tunefs.ocfs2/tunefs.c
===================================================================
--- trunk/tunefs.ocfs2/tunefs.c 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/tunefs.ocfs2/tunefs.c 2005-05-23 23:35:49 UTC (rev 909)
@@ -67,7 +67,7 @@
#endif
typedef struct _ocfs2_tune_opts {
- uint16_t num_nodes;
+ uint16_t num_slots;
uint64_t vol_size;
uint64_t jrnl_size;
char *vol_label;
@@ -86,7 +86,8 @@
static void usage(const char *progname)
{
- fprintf(stderr, "usage: %s [-L volume-label] [-N number-of-nodes]\n"
+ fprintf(stderr, "usage: %s [-N number-of-node-slots] "
+ "[-L volume-label]\n"
"\t[-J journal-options] [-S volume-size] [-qvV] "
"device\n",
progname);
@@ -244,7 +245,7 @@
static struct option long_options[] = {
{ "label", 1, 0, 'L' },
- { "nodes", 1, 0, 'N' },
+ { "node-slots", 1, 0, 'N' },
{ "verbose", 0, 0, 'v' },
{ "quiet", 0, 0, 'q' },
{ "version", 0, 0, 'V' },
@@ -281,17 +282,19 @@
break;
case 'N':
- opts.num_nodes = strtoul(optarg, &dummy, 0);
+ opts.num_slots = strtoul(optarg, &dummy, 0);
- if (opts.num_nodes > OCFS2_MAX_NODES ||
+ if (opts.num_slots > OCFS2_MAX_SLOTS ||
*dummy != '\0') {
com_err(opts.progname, 0,
- "Number of nodes must be no more than %d",
- OCFS2_MAX_NODES);
+ "Number of node slots must be no more "
+ "than %d",
+ OCFS2_MAX_SLOTS);
exit(1);
- } else if (opts.num_nodes < 2) {
+ } else if (opts.num_slots < 2) {
com_err(opts.progname, 0,
- "Initial nodes must be at least 2");
+ "Number of node slots must be at "
+ "least 2");
exit(1);
}
break;
@@ -346,10 +349,10 @@
return ;
}
-static errcode_t add_nodes(ocfs2_filesys *fs)
+static errcode_t add_slots(ocfs2_filesys *fs)
{
errcode_t ret = 0;
- uint16_t old_num = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
+ uint16_t old_num = OCFS2_RAW_SB(fs->fs_super)->s_max_slots;
char fname[SYSTEM_FILE_NAME_MAX];
uint64_t blkno;
int i, j;
@@ -357,7 +360,7 @@
int ftype;
for (i = OCFS2_LAST_GLOBAL_SYSTEM_INODE + 1; i < NUM_SYSTEM_INODES; ++i) {
- for (j = old_num; j < opts.num_nodes; ++j) {
+ for (j = old_num; j < opts.num_slots; ++j) {
sprintf(fname, ocfs2_system_inodes[i].si_name, j);
asprintf(&display_str, "Adding %s...", fname);
printf("%s", display_str);
@@ -426,7 +429,7 @@
ocfs2_dinode *di;
int i;
int cs_bits = OCFS2_RAW_SB(fs->fs_super)->s_clustersize_bits;
- uint16_t max_nodes = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
+ uint16_t max_slots = OCFS2_RAW_SB(fs->fs_super)->s_max_slots;
ret = ocfs2_malloc_block(fs->fs_io, &buf);
if (ret)
@@ -435,7 +438,7 @@
*dirty = 0;
*jrnl_size = 0;
- for (i = 0; i < max_nodes; ++i) {
+ for (i = 0; i < max_slots; ++i) {
ret = ocfs2_lookup_system_inode(fs, JOURNAL_SYSTEM_INODE, i,
&blkno);
if (ret)
@@ -452,8 +455,8 @@
*dirty = di->id1.journal1.ij_flags & OCFS2_JOURNAL_DIRTY_FL;
if (*dirty) {
com_err(opts.progname, 0,
- "Node %d's journal is dirty. Run fsck.ocfs2 "
- "to replay all dirty journals.", i);
+ "Node slot %d's journal is dirty. Run "
+ "fsck.ocfs2 to replay all dirty journals.", i);
break;
}
}
@@ -476,17 +479,17 @@
return ;
}
-static errcode_t update_nodes(ocfs2_filesys *fs, int *changed)
+static errcode_t update_slots(ocfs2_filesys *fs, int *changed)
{
errcode_t ret = 0;
block_signals(SIG_BLOCK);
- ret = add_nodes(fs);
+ ret = add_slots(fs);
block_signals(SIG_UNBLOCK);
if (ret)
return ret;
- OCFS2_RAW_SB(fs->fs_super)->s_max_nodes = opts.num_nodes;
+ OCFS2_RAW_SB(fs->fs_super)->s_max_slots = opts.num_slots;
*changed = 1;
return ret;
@@ -561,7 +564,7 @@
char jrnl_file[40];
uint64_t blkno;
int i;
- uint16_t max_nodes = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
+ uint16_t max_slots = OCFS2_RAW_SB(fs->fs_super)->s_max_slots;
uint32_t num_clusters;
char *buf = NULL;
ocfs2_dinode *di;
@@ -573,7 +576,7 @@
if (ret)
return ret;
- for (i = 0; i < max_nodes; ++i) {
+ for (i = 0; i < max_slots; ++i) {
snprintf (jrnl_file, sizeof(jrnl_file),
ocfs2_system_inodes[JOURNAL_SYSTEM_INODE].si_name, i);
@@ -643,7 +646,7 @@
errcode_t ret = 0;
ocfs2_filesys *fs = NULL;
int upd_label = 0;
- int upd_nodes = 0;
+ int upd_slots = 0;
int upd_jrnls = 0;
int upd_vsize = 0;
uint16_t tmp;
@@ -713,15 +716,16 @@
OCFS2_RAW_SB(fs->fs_super)->s_label, opts.vol_label);
}
- /* validate num nodes */
- if (opts.num_nodes) {
- tmp = OCFS2_RAW_SB(fs->fs_super)->s_max_nodes;
- if (opts.num_nodes > tmp) {
- printf("Changing number of nodes from %d to %d\n",
- tmp, opts.num_nodes);
+ /* validate num slots */
+ if (opts.num_slots) {
+ tmp = OCFS2_RAW_SB(fs->fs_super)->s_max_slots;
+ if (opts.num_slots > tmp) {
+ printf("Changing number of node slots from %d to %d\n",
+ tmp, opts.num_slots);
} else {
- printf("ERROR: Nodes (%d) has to be larger than "
- "configured nodes (%d)\n", opts.num_nodes, tmp);
+ printf("ERROR: Node slots (%d) has to be larger than "
+ "configured node slots (%d)\n",
+ opts.num_slots, tmp);
goto unlock;
}
@@ -741,7 +745,7 @@
printf("Changing journal size %"PRIu64" to %"PRIu64"\n",
def_jrnl_size, opts.jrnl_size);
else {
- if (!opts.num_nodes) {
+ if (!opts.num_slots) {
printf("ERROR: Journal size %"PRIu64" has to be larger "
"than %"PRIu64"\n", opts.jrnl_size, def_jrnl_size);
goto unlock;
@@ -779,22 +783,24 @@
printf("Changed volume label\n");
}
- /* update number of nodes */
- if (opts.num_nodes) {
- ret = update_nodes(fs, &upd_nodes);
+ /* update number of slots */
+ if (opts.num_slots) {
+ ret = update_slots(fs, &upd_slots);
if (ret) {
- com_err(opts.progname, ret, "while updating nodes");
+ com_err(opts.progname, ret,
+ "while updating node slots");
goto unlock;
}
- if (upd_nodes)
- printf("Added nodes\n");
+ if (upd_slots)
+ printf("Added node slots\n");
}
/* update journal size */
if (opts.jrnl_size) {
ret = update_journal_size(fs, &upd_jrnls);
if (ret) {
- com_err(opts.progname, ret, "while updating journal size");
+ com_err(opts.progname, ret,
+ "while updating journal size");
goto unlock;
}
if (upd_jrnls)
@@ -813,7 +819,7 @@
}
/* write superblock */
- if (upd_label || upd_nodes || upd_vsize) {
+ if (upd_label || upd_slots || upd_vsize) {
block_signals(SIG_BLOCK);
ret = ocfs2_write_super(fs);
if (ret) {
Modified: trunk/tunefs.ocfs2/tunefs.ocfs2.8.in
===================================================================
--- trunk/tunefs.ocfs2/tunefs.ocfs2.8.in 2005-05-23 21:39:32 UTC (rev 908)
+++ trunk/tunefs.ocfs2/tunefs.ocfs2.8.in 2005-05-23 23:35:49 UTC (rev 909)
@@ -12,8 +12,8 @@
\fIvolume\-label\fR specifiy the new label name of a device. The maximum \fIvolume-label\fR lenght allowed is 64 bytes.
.TP
-\fB\-N\fR \fInumber\-of\-nodes\fR
-\fInumber\-of\-nodes\fR specify the number of nodes that will be sharing a specific OCFS2 partition. The maximum value allowed for \fInumber\-of\-nodes\fR is 255. Note that one can increase the number of nodes, but not decrease it. Future versions may allow decrease of the number of nodes.
+\fB\-N\fR \fInumber\-of\-node\-slots\fR
+\fInumber\-of\-node\-slots\fR specify the maximum number of nodes that can simultaneously mount the specific OCFS2 partition. The maximum value allowed for \fInumber\-of\-node\-slots\fR is 255. Note that one can increase the number of node slots, but not decrease it. Future versions may allow decrease of the number of node slots.
.TP
\fB\-J\fR \fIjournal\-options\fR
More information about the Ocfs2-tools-commits
mailing list