[Ocfs-tools-commits] rev 5 - in trunk: debugocfs format format/inc fsck load_ocfs ocfs_uid_gen ocfstool

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Feb 5 17:25:05 CST 2004


Author: manish
Date: 2004-02-05 17:25:02 -0600 (Thu, 05 Feb 2004)
New Revision: 5

Removed:
   trunk/debugocfs/debugocfs.1.in
   trunk/format/inc/resize.h
   trunk/format/mkfs.ocfs.1.in
   trunk/format/resize.c
   trunk/format/resizeocfs.1.in
   trunk/fsck/fsck.ocfs.1.in
   trunk/load_ocfs/load_ocfs.1.in
   trunk/ocfs_uid_gen/ocfs_uid_gen.1.in
   trunk/ocfstool/ocfstool.1.in
Log:
old files


Deleted: trunk/debugocfs/debugocfs.1.in
===================================================================
--- trunk/debugocfs/debugocfs.1.in	2004-02-05 01:20:59 UTC (rev 4)
+++ trunk/debugocfs/debugocfs.1.in	2004-02-05 23:25:02 UTC (rev 5)
@@ -1,108 +0,0 @@
-.TH "debugocfs" "1" "November 2003" "Version @VERSION@" "OCFS Manual Pages"
-.SH "NAME"
-debugocfs \- Utility to dump information from an OCFS partition.
-.SH "SYNOPSIS"
-\fBdebugocfs\fR [\-?] [\-h] [\-g] [\-l] [\-v range] [\-p range] [\-d /dir/name] [\-D /dir/name] [\-f /file/name [\-s /path/to/file]] [\-a range] [\-A range] [\-b range] [\-B range] [\-r range] [\-c range] [\-L range] [\-M range] [\-n nodenum] /dev/name
-.SH "DESCRIPTION"
-.PP 
-\fBdebugocfs\fR is a utility used to dump an OCFS file system information. The \fBdebugocfs\fR utility is to be used under support direction and should use a bound specific raw device instead of the proper device (/dev/sdxx).
-.SH "OPTIONS"
-.TP
-\fB\-h\fR 
-Dumps the OCFS header information.
-
-.TP
-\fB\-g\fR 
-Dumps the OCFS bitmap information.
-
-.TP
-\fB\-l\fR 
-Dumps the OCFS full listing of all file entries.
-
-.TP
-\fB\-v\fR 
-Dumps the OCFS vote sector information.
-
-.TP
-\fB\-2\fR 
-Prints 8-byte number as 2 4byte numbers.
-
-.TP
-\fB\-p\fR \fIrange\fR
-Dumps the OCFS publish sector for a given \fIrange\fR.. 
-
-
-.TP
-\fB\-d\fR \fI/dir/name/\fR
-Dumps first ocfs_dir_node structure for a given path "\fI/dir/name\fR".
-
-.TP
-\fB\-D\fR \fI/dir/name\fR
-Dumps all ocfs_dir_node structures for a given path "\fI/dir/name\fR".
-
-.TP
-\fB\-f\fR \fI/file/name\fR
-Dumps ocfs_file_entry structure for a given file "\fI/file/name\fR".
-
-.TP
-\fB\-F\fR \fI/file/name\fR
-Dumps ocfs_file_entry and ocfs_extent_group structures for a given file "\fI/file/name\fR".
-
-.TP
-\fB\-s\fR \fI/path/to/file\fR
-suck file out to a given location "\fI/path/to/file\fR".
-
-.TP
-\fB\-a\fR \fIrange\fR
-Dumps file allocation system file for a given \fIrange\fR.
-
-.TP
-\fB\-A\fR \fIrange\fR
-Dumps dir allocation system file for a given \fIrange\fR.
-
-.TP
-\fB\-b\fR \fIrange\fR
-Dumps file allocation bitmap system file for a given \fIrange\fR.
-
-.TP
-\fB\-B\fR \fIrange\fR
-Dumps dir allocation bitmap system file for a given \fIrange\fR.
-
-.TP
-\fB\-r\fR \fIrange\fR
-Recover log file system file for a given \fIrange\fR.
-
-.TP
-\fB\-c\fR \fIrange\fR
-Cleanup log system file for a given \fIrange\fR.
-
-.TP
-\fB\-L\fR \fIrange\fR
-dumps vol metadata log system file for a given \fIrange\fR.
-
-.TP
-\fB\-M\fR \fIrange\fR
-dumps vol metadata system file for a given \fIrange\fR.
-
-.TP
-\fB\-n\fR \fInodename\fR
-Perform action as node number given
-
-.TP
-\fB/dev/name:\fR 
-Readable bound raw device (/dev/raw/rawxx). One needs to bind a Linux raw character device to the block device (/dev/sdxx) in order to use this program.
-
-.TP
-\fBrange:\fR 
-Node numbers to inspect (0-31), commas and dashes ok (i.e.:\fI0-3,5,14-17\fR).
-.SH "BUGS"
-Stuff.
-
-.SH "SEE ALSO"
-.BR ocfs(5)
-
-.SH "AUTHORS"
-Oracle Corporation
-
-.SH "COPYRIGHT"
-Copyright \(co 2002 Oracle Corporation

Deleted: trunk/format/inc/resize.h
===================================================================
--- trunk/format/inc/resize.h	2004-02-05 01:20:59 UTC (rev 4)
+++ trunk/format/inc/resize.h	2004-02-05 23:25:02 UTC (rev 5)
@@ -1,55 +0,0 @@
-/*
- * resize.h
- *
- * Function prototypes for related 'C' file.
- *
- * 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 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 _RESIZE_H_
-#define _RESIZE_H_
-
-#include <signal.h>
-#include <ctype.h>
-#include <limits.h>
-
-/* function prototypes */
-
-int read_options(int argc, char **argv);
-
-bool validate_options(void);
-
-int update_volume_header(int file, ocfs_vol_disk_hdr *volhdr,
-			 __u32 sect_size, __u64 vol_size, bool *update);
-
-int update_node_cfg(int file, ocfs_vol_disk_hdr *volhdr, __u64 cfg_hdr_off,
-		    __u64 cfg_node_off, __u64 new_cfg_off,
-		    ocfs_node_config_hdr *node_hdr,
-		    ocfs_disk_node_config_info *node_info, __u32 sect_size,
-		    bool *update);
-
-void handle_signal(int sig);
-
-int print_node_cfgs(int file, ocfs_vol_disk_hdr *volhdr, __u32 sect_size);
-
-int process_new_volsize(int file, ocfs_vol_disk_hdr *volhdr, __u32 sect_size,
-		       	__u64 vol_size, bool *update);
-
-#endif /* _RESIZE_H_ */

Deleted: trunk/format/mkfs.ocfs.1.in
===================================================================
--- trunk/format/mkfs.ocfs.1.in	2004-02-05 01:20:59 UTC (rev 4)
+++ trunk/format/mkfs.ocfs.1.in	2004-02-05 23:25:02 UTC (rev 5)
@@ -1,72 +0,0 @@
-.TH "mkfs.ocfs" "1" "November 2003" "Version @VERSION@" "OCFS Manual Pages"
-.SH "NAME"
-mkfs.ocfs \- Build an OCFS file system.
-.SH "SYNOPSIS"
-\fBmkfs.ocfs\fR \-b block\-size [\-C] [\-F] [\-g gid] [\-h] \-L volume\-label \-m mount\-path [\-n] [\-p permissions] [\-q] [\-u uid] [\-V] device
-.SH "DESCRIPTION"
-.PP 
-\fBmkfs.ocfs\fR is used to build an OCFS file system on a device, usually a partition in a shared disk. \fBmkfs.ocfs\fR will not format a partition if a node has it mounted to prevent data loss. After the filesystem is formatted, it needs to be exclusively mounted by one node, usually node 0, for the first time. After the first mount, all subsequent mounts can be performed in parallel.
-.SH "OPTIONS"
-.TP
-\fB\-b\fR \fIblocksize\fR
-Block size in kilo bytes. The size of the blocksize (4k\-1M) will determine the maximum filesystem size possible for the OCFS (32Gb\-8Tb).
-
-.TP
-\fB\-C\fR 
-Clear all data blocks. Use this option only if it is really necessary to clear all blocks. This will slow down the process.
-
-.TP
-\fB\-F\fR 
-Force format. Use this option only if formatting an existing OCFS partition.
-
-.TP
-\fB\-g\fR \fIgid\fR 
-Set the \fIgid\fR for the root directory. On mount time, it will automatcially
-assign the \fIgid\fR specified by this parameter to the mount point. One may
-use the \fIgid\fR or the group name (i.e.:1011 or \fIdba\fR).
-
-.TP
-\fB\-h\fR 
-Help. 
-
-.TP
-\fB\-L\fR \fIVolume label\fR
-Volume label. Allows mount of the file system using LABEL=<Volume Label> instead of device name.
-
-.TP
-\fB\-m\fR \fImount point\fR
-Mount point where the formatted device will be mounted.
-
-.TP
-\fB\-n\fR 
-Query only. Will not build the filesystem.
-
-.TP
-\fB\-p\fR \fINNNN\fR
-Permissions \fINNNN\fR for the root directory. On mount, it will automatcially assign the permission specified by this parameter to the mount point.
-
-.TP
-\fB\-q\fR 
-Quiet execution.
-
-.TP
-\fB\-u\fR \fIuid\fR
-Set the \fIuid\fR for the root directory. On mount time, it will automatcially
-assign \fIuid\fR specified by this parameter to the mount point. One can use
-the \fIuid\fR or the username (i.e.:1011 or \fIoracle\fR).
-
-.TP
-\fB\-V\fR 
-Print version and exit.
-
-.SH "BUGS"
-Stuff.
-
-.SH "SEE ALSO"
-.BR ocfs(5)
-
-.SH "AUTHORS"
-Oracle Corporation
-
-.SH "COPYRIGHT"
-Copyright \(co 2002 Oracle Corporation

Deleted: trunk/format/resize.c
===================================================================
--- trunk/format/resize.c	2004-02-05 01:20:59 UTC (rev 4)
+++ trunk/format/resize.c	2004-02-05 23:25:02 UTC (rev 5)
@@ -1,720 +0,0 @@
-/*
- * resize.c
- *
- * ocfs resize utility
- *
- * 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 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 <format.h>
-#include <resize.h>
-
-ocfs_options opts = {
-	.device = "",
-	.block_size = 0,
-	.clear_data_blocks = false,
-	.force_op = false,
-	.gid = -1,
-	.volume_label = "",
-	.mount_point = "",
-	.query_only = false,
-	.perms = -1,
-	.quiet = false,
-	.uid = -1,
-	.print_progress = false,
-	.slot_num = OCFS_INVALID_NODE_NUM,
-	.device_size = 0,
-	.list_nodes = false
-};
-
-bool ignore_signal = false;
-int file = 0;
-int rawminor = 0;
-char rawdev[FILE_NAME_SIZE];
-
-char *usage_string =
-"usage: resizeocfs [-F] [-g gid] [-h] [-l] [-n] [-N nodenum] [-p permissions]\n"
-"                  [-q] [-S size] [-u uid] [-V] device\n\n"
-"	-F Force resize existing OCFS volume\n"
-"	-g Group ID for the root directory\n"
-"	-h Help\n"
-"	-l List all the node config slots\n"
-"	-n Query only\n"
-"	-N Node config slot be to be cleared\n"
-"	-p Permissions for the root directory\n"
-"	-q Quiet execution\n"
-"	-S Volume size, e.g., 50G (M for mega, G for giga, T for tera)\n"
-"	-u User ID for the root directory\n"
-"	-V Print version and exit\n";
-
-/*
- * main()
- *
- */
-int main(int argc, char **argv)
-{
-	ocfs_vol_disk_hdr *volhdr = NULL;
-	ocfs_node_config_hdr *node_hdr = NULL;
-	ocfs_disk_node_config_info *node_info = NULL;
-	__u32 sect_size = OCFS_SECTOR_SIZE;
-	__u64 vol_size = 0;
-	__u64 offset;
-	bool ocfs_vol = false;
-	char proceed;
-	bool update = false;
-	char *node_names[OCFS_MAXIMUM_NODES];
-	__u32 nodemap = 0;
-	int i;
-	__u64 cfg_hdr_off = 0;
-	__u64 cfg_node_off = 0;
-	__u64 new_cfg_off = 0;
-
-	for (i = 0; i < OCFS_MAXIMUM_NODES; ++i)
-		node_names[i] = NULL;
-
-	/* Set ctrl-c handler */
-	if (signal(SIGINT, handle_signal) == SIG_ERR) {
-		fprintf(stderr, "Could not set SIGINT\n");
-		goto bail;
-	}
-
-	/* Read the options */
-	if (!read_options(argc, argv))
-		goto bail;
-
-	/* Validate the options */
-	if (!validate_options())
-		goto bail;
-
-	/* Open the disk */
-	if (!(file = OpenDisk(opts.device)))
-		goto bail;
-
-	/* Allocate mem */
-	volhdr = MemAlloc(OCFS_SECTOR_SIZE);
-	node_hdr = MemAlloc(OCFS_SECTOR_SIZE);
-	node_info = MemAlloc(OCFS_SECTOR_SIZE);
-	if (!volhdr || !node_hdr || !node_info)
-		goto bail;
-
-	/* Is this an existing ocfs volume */
-	if (!is_ocfs_volume(file, volhdr, &ocfs_vol, sect_size))
-		goto bail;
-
-
-	/* Abort if not an ocfs volume */
-	if (!ocfs_vol) {
-		fprintf(stderr, "%s is not an ocfs volume.\nAborting.\n",
-			opts.device);
-		goto bail;
-	}
-
-	if (opts.list_nodes) {
-		print_node_cfgs(file, volhdr, sect_size);
-		goto bail;
-	}
-
-	/* Get the partition Information */
-	if (!(GetDiskGeometry(file, &vol_size, &sect_size)))
-		goto bail;
-
-	if (opts.device_size) {
-		if (!(validate_volume_size(opts.device_size, vol_size)))
-			goto bail;
-		vol_size = opts.device_size;
-	}
-
-	/* close and open after binding to raw */
-	safeclose(file);
-
-	/* bind device to raw */
-	if (bind_raw(opts.device, &rawminor, rawdev, sizeof(rawdev)))
-		goto bail;
-
-	/* Open the disk */
-	if (!(file = OpenDisk(rawdev)))
-		goto bail;
-
-	/* read volume header */
-	if (!read_sectors(file, 0, 1, sect_size, (void *)volhdr))
-		goto bail;
-
-	/* Update node cfgs */
-	if (IS_VALID_NODE_NUM(opts.slot_num)) {
-		cfg_hdr_off = volhdr->node_cfg_off;
-		cfg_node_off = volhdr->node_cfg_off + (2 + opts.slot_num) * sect_size;
-		new_cfg_off = volhdr->new_cfg_off + sect_size;
-
-		if (!(update_node_cfg(file, volhdr, cfg_hdr_off, cfg_node_off,
-				      new_cfg_off, node_hdr, node_info,
-				      sect_size, &update)))
-			goto bail;
-	}
-
-	/* Update volume disk header */
-	if (opts.gid != -1 || opts.uid != -1 || opts.perms != -1 ||
-	    opts.device_size) {
-		if (!(update_volume_header(file, volhdr, sect_size, vol_size,
-					   &update)))
-			goto bail;
-	}
-
-	if (!update) {
-		printf("No changes made to the volume.\nAborting.\n");
-		goto bail;
-	}
-
-	/* query_only option bails you here */
-	if (opts.query_only) {
-		printf("Changes not written to disk.\n");
-		goto bail;
-	}
-
-	if (!opts.force_op) {
-		printf("Proceed (y/N): ");
-		proceed = getchar();
-		if (toupper(proceed) != 'Y') {
-			printf("Aborting operation.\n");
-			goto bail;
-		}
-	}
-
-	/* Check for heartbeat for any write operation */
-	if (!check_heart_beat(&file, rawdev, volhdr, &nodemap, sect_size))
-		goto bail;
-
-	if (nodemap) {
-		/* Exit as device is mounted on some node */
-		get_node_names(file, volhdr, node_names, sect_size);
-		printf("%s mounted on nodes:", opts.device);
-		print_node_names(node_names, nodemap);
-		printf("Aborting.\n");
-		goto bail;
-	}
-
-	/* do not allow interrupts */
-	ignore_signal = true;
-
-	/* Write node cfgs */
-	if (IS_VALID_NODE_NUM(opts.slot_num)) {
-		if (!write_sectors(file, cfg_hdr_off, 1, sect_size,
-				   (void *)node_hdr))
-			goto bail;
-		if (!write_sectors(file, cfg_node_off, 1, sect_size,
-				   (void *)node_info))
-			goto bail;
-		if (!write_sectors(file, new_cfg_off, 1, sect_size,
-				   (void *)node_hdr))
-			goto bail;
-	}
-
-	/* Write volume disk header */
-	if (opts.gid != -1 || opts.uid != -1 || opts.perms != -1 ||
-	    opts.device_size) {
-		offset = volhdr->start_off;
-		if (!write_sectors(file, offset, 1, sect_size, (void *)volhdr))
-			goto bail;
-	}
-
-	printf("Changes written to disk.\n");
-
-bail:
-	safefree(volhdr);
-	safefree(node_hdr);
-	safefree(node_info);
-
-	for (i = 0; i < OCFS_MAXIMUM_NODES; ++i)
-		safefree(node_names[i]);
-
-	safeclose(file);
-	unbind_raw(rawminor, rawdev);
-	return 0;
-}				/* main */
-
-
-/*
- * read_options()
- *
- * resizeocfs [ -C ] [ -f ] [ -g gid] [ -L label] [ -m mount-point]
- *            [ -p permissions] [ -q ] [ -S size] [ -u uid] [ -V ] device
- *
- */
-int read_options(int argc, char **argv)
-{
-	int i;
-	int ret = 1;
-	char tmp[128];
-	char *p;
-	__u64 fac = 1;
-	long double size;
-
-	if (argc < 2) {
-		version(argv[0]);
-		usage();
-		ret = 0;
-		goto bail;
-	}
-
-	for (i = 1; i < argc && ret; i++) {
-		switch(*argv[i]) {
-		case '-':
-			switch(*++argv[i]) {
-			case 'C':	/* clear all data blocks */
-				opts.clear_data_blocks = true;
-				break;
-
-			case 'F':	/* force resize */
-				opts.force_op = true;
-				break;
-
-			case 'g':	/* gid */
-				++i;
-				if (i < argc && argv[i])
-					opts.gid = get_gid(argv[i]);
-				else {
-					fprintf(stderr, "Invalid group id.\n"
-						"Aborting.\n");
-					ret = 0;
-				}
-				break;
-
-			case 'h':	/* help */
-				version(argv[0]);
-				usage();
-				ret = 0;
-				break;
-
-			case 'l':	/* list node configs */
-				opts.list_nodes = true;
-				break;
-
-			case 'n':	/* query */
-				opts.query_only = true;
-				break;
-
-			case 'N':	/* node cfg slot */
-				++i;
-				if (i < argc && argv[i])
-					opts.slot_num = atoi(argv[i]);
-				else {
-					fprintf(stderr,"Invalid node config slot.\n"
-						"Aborting.\n");
-					ret = 0;
-				}
-				break;
-
-			case 'p':	/* permissions */
-				++i;
-				if (i < argc && argv[i]) {
-					opts.perms = strtoul(argv[i], NULL, 8);
-					opts.perms &= 0007777;
-				} else {
-					fprintf(stderr,"Invalid permissions.\n"
-						"Aborting.\n");
-					ret = 0;
-				}
-				break;
-
-			case 'q':	/* quiet */
-				opts.quiet = true;
-				break;
-
-			case 'S':	/* device size */
-				++i;
-				if (i < argc && argv[i]) {
-					strcpy(tmp, argv[i]);
-					size = strtold(tmp, &p);
-					if (p)
-						MULT_FACTOR(*p, fac);
-					opts.device_size = (__u64)(size * fac);
-				} else {
-					fprintf(stderr,"Invalid device size.\n"
-						"Aborting.\n");
-					ret = 0;
-				}
-				break;
-
-			case 'u':	/* uid */
-				++i;
-				if (i < argc && argv[i])
-					opts.uid = get_uid(argv[i]);
-				else {
-					fprintf(stderr,"Invalid user id.\n"
-						"Aborting.\n");
-					ret = 0;
-				}
-				break;
-
-			case 'V':	/* print version */
-				version(argv[0]);
-				ret = 0;
-				break;
-
-			case 'x':	/* used for debugocfs */
-				opts.print_progress = true;
-				break;
-
-			default:
-				fprintf(stderr, "Invalid switch -%c.\n"
-					"Aborting.\n", *argv[i]);
-				ret = 0;
-				break;
-			}
-			break;
-
-		default:
-			strncpy(opts.device, argv[i], FILE_NAME_SIZE);
-			break;
-		}
-	}
-
-      bail:
-	return ret;
-}				/* read_options */
-
-
-/*
- * validate_options()
- *
- */
-bool validate_options(void)
-{
-	if (opts.device[0] == '\0') {
-		fprintf(stderr, "Error: Device not specified.\n");
-		usage();
-		return 0;
-	}
-
-	if (opts.slot_num != OCFS_INVALID_NODE_NUM) {
-		if (opts.slot_num < 0 || opts.slot_num >= OCFS_MAXIMUM_NODES) {
-			fprintf(stderr, "Error: Invalid node config slot "
-			       	"specified.\n");
-			usage();
-			return 0;
-		}
-	}
-
-	return 1;
-}				/* validate_options */
-
-
-/*
- * update_volume_header()
- *
- */
-int update_volume_header(int file, ocfs_vol_disk_hdr *volhdr, __u32 sect_size,
-			 __u64 vol_size, bool *update)
-{
-	int ret = 1;
-
-	if (opts.uid != -1) {
-		if (getpwuid(opts.uid)) {
-			printf("Changing uid from %d to %d\n", volhdr->uid,
-			       opts.uid);
-			volhdr->uid = opts.uid;
-			*update = true;
-		} else {
-			fprintf (stderr, "Error: Invalid uid %d\n", opts.uid); 
-			ret = 0;
-			goto bail;
-		}
-	}
-
-	if (opts.gid != -1) {
-		if (getgrgid(opts.gid)) {
-			printf("Changing gid from %d to %d\n", volhdr->gid,
-			       opts.gid);
-			volhdr->gid = opts.gid;
-			*update = true;
-		} else {
-			fprintf (stderr, "Error: Invalid gid %d\n", opts.gid); 
-			ret = 0;
-			goto bail;
-		}
-	}
-
-	if (opts.perms != -1) {
-		if (opts.perms >= 0000 && opts.perms <= 07777) {
-			printf("Changing permissions from 0%o to 0%o\n",
-			       volhdr->prot_bits, opts.perms);
-			volhdr->prot_bits = opts.perms;
-			*update = true;
-		} else {
-			fprintf (stderr, "Error permissions 0%o\n", opts.perms);
-			ret = 0;
-			goto bail;
-		}
-	}
-
-	if (opts.device_size) {
-		ret = process_new_volsize(file, volhdr, sect_size, vol_size,
-					  update);
-		if (ret)
-			*update = true;
-	}
-
-bail:
-	return ret;
-}				/* update_volume_header */
-
-/*
- * update_node_cfg()
- *
- */
-int update_node_cfg(int file, ocfs_vol_disk_hdr *volhdr, __u64 cfg_hdr_off,
-		    __u64 cfg_node_off, __u64 new_cfg_off,
-		    ocfs_node_config_hdr *node_hdr,
-		    ocfs_disk_node_config_info *node_info, __u32 sect_size,
-		    bool *update)
-{
-	bool ret = 0;
-	ocfs_guid guid;
-
-	if (!read_sectors(file, cfg_hdr_off, 1, sect_size, (void *)node_hdr))
-		goto bail;
-
-	if (!read_sectors(file, cfg_node_off, 1, sect_size, (void *)node_info))
-		goto bail;
-
-	memset(&guid, 0, sizeof(ocfs_guid));
-
-	if (memcmp(&node_info->guid, &guid, sizeof(guid))) {
-		printf("Clearing node number %d used by node %s\n",
-		       opts.slot_num, node_info->node_name);
-		node_hdr->num_nodes--;
-		node_hdr->cfg_seq_num++;
-		memset(node_info, 0, sizeof(ocfs_disk_node_config_info));
-		*update = true;
-	} else {
-		fprintf(stderr, "Node number %d is not in use\n",
-		       	opts.slot_num);
-	}
-
-	ret = 1;
-bail:
-	return ret;
-}				/* update_node_cfg */
-
-/*
- * handle_signal()
- */
-void handle_signal(int sig)
-{
-	switch (sig) {
-	case SIGINT:
-		if (!ignore_signal) {
-			fprintf(stderr, "\nOperation interrupted.\nAborting.\n");
-			safeclose(file);
-			unbind_raw(rawminor, rawdev);
-			exit(1);
-		}
-		break;
-
-	default:
-		break;
-	}
-
-	if (sig != SIGINT)
-		signal(sig, handle_signal);
-
-	return ;
-}				/* handle_signal */
-
-/*
- * print_node_cfgs()
- *
- */
-int print_node_cfgs(int file, ocfs_vol_disk_hdr *volhdr, __u32 sect_size)
-{
-	char *buf = NULL;
-	char *p;
-	int len;
-	int ret = 0;
-	int i;
-	ocfs_disk_node_config_info *conf;
-
-	len = volhdr->node_cfg_size;
-	if (!(buf = (char *) MemAlloc(len)))
-		goto bail;
-	else
-		memset(buf, 0, len);
-
-	if (!SetSeek(file, volhdr->node_cfg_off))
-		goto bail;
-
-	if (!(Read(file, len, buf)))
-		goto bail;
-
-	p = buf + (sect_size * 2);
-
-	printf ("%2s %-32s %-15s %-7s %-s\n", "#", "Name", "IP Address", "IP Port", "Node GUID");
-	printf ("%2s %-32s %-15s %-7s %-s\n", "=", "================================",
-	       	"===============", "=======", "================================");
-	for (i = 0; i < OCFS_MAXIMUM_NODES; ++i, p += sect_size) {
-		conf = (ocfs_disk_node_config_info *)p;
-		if (!conf->node_name[0])
-			continue;
-		printf ("%2d %-32s %-15s %-7d %*s\n", i, conf->node_name,
-		       	conf->ipc_config.ip_addr, conf->ipc_config.ip_port,
-		       	GUID_LEN, conf->guid.guid);
-	}
-
-	ret = 1;
-      bail:
-	safefree(buf);
-	return ret;
-}				/* print_node_cfgs */
-
-
-/*
- * process_new_volsize()
- *
- */
-int process_new_volsize(int file, ocfs_vol_disk_hdr *volhdr, __u32 sect_size,
-		       	__u64 vol_size, bool *update)
-{
-	__u64 end_free_sz;
-	__u64 new_data_sz;
-	__u64 old_num_blks, new_num_blks;
-	__u64 max_vol_sz, min_vol_sz;
-	__u8 *bitmap = NULL;
-	__u32 num_sectors;
-	__u32 new_bitmap_sz;
-	__u32 old_num_bytes, new_num_bytes;
-	__u32 i;
-	__u32 byte_ind, bit_ind;
-	__u8 *p;
-	int ret = 0;
-	char str1[100], str2[100];
-
-	if (vol_size > volhdr->device_size) {
-		end_free_sz = OCFS_NUM_END_SECTORS * sect_size;
-		new_data_sz = vol_size - volhdr->data_start_off - end_free_sz;
-
-		new_num_blks = (__u64)(new_data_sz / volhdr->cluster_size);
-		old_num_blks = volhdr->num_clusters;
-
-		if (new_num_blks == old_num_blks) {
-			fprintf(stderr, "No change in number of blocks (%llu)."
-				"\nAborting.\n", old_num_blks);
-			goto bail;
-		}
-
-		new_bitmap_sz = OCFS_BUFFER_ALIGN(((new_num_blks + 7) / 8),
-						  sect_size);
-		if (new_bitmap_sz > OCFS_MAX_BITMAP_SIZE) {
-			max_vol_sz = OCFS_MAX_BITMAP_SIZE * 8 *
-				     volhdr->cluster_size;
-			max_vol_sz += volhdr->data_start_off + end_free_sz;
-
-			num_to_str(volhdr->cluster_size, str1);
-			num_to_str(max_vol_sz, str2);
-			fprintf(stderr, "With a %s block size, the max "
-				"volume size can be %s.\nAborting.\n",
-				str1, str2);
-			goto bail;
-		}
-
-		if (!opts.quiet) {
-			printf("Increasing volume size from %llu bytes to %llu bytes.\n",
-			       volhdr->device_size, vol_size);
-			printf("Increasing number of blocks from %llu to %llu."
-			       "\n", volhdr->num_clusters, new_num_blks);
-		}
-
-		volhdr->device_size = vol_size;
-		volhdr->num_clusters = new_num_blks;
-		*update = true;
-
-	} else if (vol_size < volhdr->device_size) {
-		end_free_sz = OCFS_NUM_END_SECTORS * sect_size;
-		new_data_sz = vol_size - volhdr->data_start_off - end_free_sz;
-
-		new_num_blks = new_data_sz / volhdr->cluster_size;
-		old_num_blks = volhdr->num_clusters;
-
-		if (new_num_blks == old_num_blks) {
-			fprintf(stderr, "No change in number of blocks (%llu)."
-				"\nAborting.\n", old_num_blks);
-			goto bail;
-		}
-
-		if (!(bitmap = (char *) MemAlloc(OCFS_MAX_BITMAP_SIZE)))
-			goto bail;
-
-		/* read the bitmap */
-		num_sectors = OCFS_MAX_BITMAP_SIZE / sect_size;
-		if (!read_sectors(file, volhdr->bitmap_off, num_sectors,
-				  sect_size, (void *)bitmap))
-			goto bail;
-
-#define GET_LAST_BYTE(num_bytes, num_blocks)		\
-		do {					\
-			num_bytes = (num_blocks) / 8;	\
-			if ((num_blocks) % 8)		\
-				++(num_bytes);		\
-		} while (0)
-
-		GET_LAST_BYTE(new_num_bytes, new_num_blks);
-		GET_LAST_BYTE(old_num_bytes, old_num_blks);
-
-		for (i = old_num_bytes, p = bitmap + old_num_bytes;
-		     i > new_num_bytes - 1; --i, --p)
-			if (*p)
-				break;
-
-		byte_ind = i;
-		if (byte_ind > new_num_bytes - 1) {
-			char x = 0x80;
-			for (i = 8; i > 0; --i, x >>= 1) {
-				if (*p & x)
-					break;
-			}
-
-			bit_ind = i;
-
-			min_vol_sz = (byte_ind - 1) * 8 * volhdr->cluster_size;
-			min_vol_sz += bit_ind * volhdr->cluster_size;
-			min_vol_sz += volhdr->data_start_off + end_free_sz;
-
-			fprintf(stderr, "Due to disk usage, the volume size "
-				"cannot be smaller than %llu bytes.\nAborting.\n",
-				min_vol_sz);
-			goto bail;
-		}
-
-		if (!opts.quiet) {
-			printf("Decreasing volume size from %llu bytes to %llu bytes.\n",
-			       volhdr->device_size, vol_size);
-			printf("Decreasing number of blocks from %llu to %llu."
-			       "\n", volhdr->num_clusters, new_num_blks);
-		}
-
-		volhdr->device_size = vol_size;
-		volhdr->num_clusters = new_num_blks;
-		*update = true;
-	}
-
-	ret = 1;
-
-bail:
-	safefree(bitmap);
-	return ret;
-}				/* process_new_volsize */

Deleted: trunk/format/resizeocfs.1.in
===================================================================
--- trunk/format/resizeocfs.1.in	2004-02-05 01:20:59 UTC (rev 4)
+++ trunk/format/resizeocfs.1.in	2004-02-05 23:25:02 UTC (rev 5)
@@ -1,72 +0,0 @@
-.TH "resizeocfs" "19" "January 2004" "Version @VERSION@" "OCFS Manual Pages"
-.SH "NAME"
-resizeocfs \- Change Filesystem Metadata and resize existing OCFS volume.
-.SH "SYNOPSIS"
-\fBresizeocfs\fR [\-F] [\-g gid] [\-h] [\-l] [\-n] [\-N nodenum] [\-p permissions] [\-q] [\-S size] [\-u uid] [\-V] device
-.SH "DESCRIPTION"
-.PP 
-\fBresizeocfs\fR is used to maintain metadata information in an OCFS file system or to resize it. This command should be used carefully as it may affect applications that have access to the filesystem.
-.SH "OPTIONS"
-.TP
-\fB\-F\fR 
-Force resize existing OCFS volume.
-
-.TP
-\fB\-g\fR \fIgid\fR 
-Change the group ID for the root directory. On mount time, it will
-automatically assign the \fIgid\fR specified by this parameter to the mount
-point. One may use the \fIgid\fR or the group name(i.e:1011 or \fIdba\fR).
-
-.TP
-\fB\-h\fR 
-Help. 
-
-.TP
-\fB\-l\fR 
-List all the node config slots. With this command, one can list all nodes that once mounted the specified OCFS device.
-
-.TP
-\fB\-n\fR 
-Query only. Will not perform any change to the filesystem.
-
-.TP
-\fB\-N\fR \fInodenum\fR
-Node config slot be to be cleared. This is used to remove a specific node that
-used to be part of the cluster from the used slots list. Only one slot can be
-cleared at the time.
-
-.TP
-\fB\-p\fR \fINNNN\fR
-Permissions \fINNNN\fR for the root directory. On mount, it will automatcially
-assign the permission specified by this parameter to the mount point.
-
-.TP
-\fB\-q\fR 
-Quiet execution.
-
-.TP
-\fB\-S\fR \fIsize\fR
-Volume \fIsize\fR for the root directory, e.g., 50G (M for mega, G for giga, T
-for tera).
-
-.TP
-\fB\-u\fR \fIuid\fR
-Change the user ID owner of the root directory. On mount time, it will
-automatcially assign \fIuid\fR specified by this parameter to the mount
-point. One may use the \fIuid\fR or the username (i.e.:1011 or \fIoracle\fR).
-
-.TP
-\fB\-V\fR 
-Print version and exit.
-
-.SH "BUGS"
-Stuff.
-
-.SH "SEE ALSO"
-.BR ocfs(5)
-
-.SH "AUTHORS"
-Oracle Corporation
-
-.SH "COPYRIGHT"
-Copyright \(co 2002 Oracle Corporation

Deleted: trunk/fsck/fsck.ocfs.1.in
===================================================================
--- trunk/fsck/fsck.ocfs.1.in	2004-02-05 01:20:59 UTC (rev 4)
+++ trunk/fsck/fsck.ocfs.1.in	2004-02-05 23:25:02 UTC (rev 5)
@@ -1,49 +0,0 @@
-.TH "fsck.ocfs" "1" "November 2003" "Version @VERSION@" "OCFS Manual Pages"
-.SH "NAME"
-fsck.ocfs \- Build an OCFS file system.
-.SH "SYNOPSIS"
-\fBfsck.ocfs\fR \-w  [\-V] [\-v] [\-q] device 
-.SH "DESCRIPTION"
-.PP 
-\fBfsck.ocfs\fR is used to check an OCFS file system on a device, usually a
-partition in a shared disk. \fBfsck.ocfs\fR will work read-only if \-w is not
-specified in the command line. This was done to allow users to run fsck while
-the OCFS filesystem is actually mounted and active. The \fBfsck.ocfs\fR
-command will look for the first available raw device in the list that is
-available and automatically bind the device specified to it and unbind when it
-is done. The command will fail if there is no free raw device availabe for
-use, so it is suggested to the user to keep at least one raw device configured
-and free for \fBfsck.ocfs\fR to use. One can also bind the devices to a
-specific raw devices and use them instead of the block device. The \fBfsck.ocfs\fR
-uses a raw device to get o_direct behavior.
-
-.SH "OPTIONS"
-.TP
-\fB\-w\fR 
-This option tell \fBfsck.ocfs\fR that it is going to run in read/write
-mode. This option should only be specified with the device properly unmounted
-on all nodes.
-
-.TP
-\fB\-V\fR 
-Display \fBfsck.ocfs\fR version.
-
-.TP
-\fB\-v\fR 
-Run \fBfsck.ocfs\fR in verbose mode.
-
-.TP
-\fB\-q\fR 
-Run \fBfsck.ocfs\fR in quiet mode.
-   
-.SH "BUGS"
-Stuff.
-
-.SH "SEE ALSO"
-.BR ocfs(5)
-
-.SH "AUTHORS"
-Oracle Corporation
-
-.SH "COPYRIGHT"
-Copyright \(co 2002 Oracle Corporation

Deleted: trunk/load_ocfs/load_ocfs.1.in
===================================================================
--- trunk/load_ocfs/load_ocfs.1.in	2004-02-05 01:20:59 UTC (rev 4)
+++ trunk/load_ocfs/load_ocfs.1.in	2004-02-05 23:25:02 UTC (rev 5)
@@ -1,22 +0,0 @@
-.TH "load_ocfs" "1" "November 2003" "Version @VERSION@" "OCFS Manual Pages"
-.SH "NAME"
-load_ocfs \- Load the ocfs.o module according to the setup file /etc/ocfs.conf.
-.SH "SYNOPSIS"
-\fBload_ocfs\fR 
-.SH "DESCRIPTION"
-.PP 
-\fBload_ocfs\fR is used to load the \fIocfs.o\fR module into the kernel area. During the load process, it will validate all the parameters set in the file \fI/etc/ocfs.conf\fR. If the \fI/etc/ocfs.o\fR file is missing, then the module will not be loaded. Use the \fIocfstool\fR utility to generate the proper \fI/etc/ocfs.conf\fR file before using \fIload_ocfs\fR.
-.SH "OPTIONS"
-.TP
-
-.SH "BUGS"
-Stuff.
-
-.SH "SEE ALSO"
-.BR ocfs(5) ocfstool(1)
-
-.SH "AUTHORS"
-Oracle Corporation
-
-.SH "COPYRIGHT"
-Copyright \(co 2002 Oracle Corporation

Deleted: trunk/ocfs_uid_gen/ocfs_uid_gen.1.in
===================================================================
--- trunk/ocfs_uid_gen/ocfs_uid_gen.1.in	2004-02-05 01:20:59 UTC (rev 4)
+++ trunk/ocfs_uid_gen/ocfs_uid_gen.1.in	2004-02-05 23:25:02 UTC (rev 5)
@@ -1,29 +0,0 @@
-.TH "ocfs_uid_gen" "1" "November 2003" "Version @VERSION@" "OCFS Manual Pages"
-.SH "NAME"
-ocfs_uid_gen \- Create or Recover the GUID for a node.
-.SH "SYNOPSIS"
-\fBocfs_uid_gen\fR [-c|-r]
-.SH "DESCRIPTION"
-.PP 
-\fBocfs_uid_gen\fR is used to create a GUID or recover a lost GUID. It uses the NIC MAC address to generate the GUID and needs to be executed only once in most of the situations. The first time it is executed, it has to be invoked with the \-c option. The only exception is when the NIC that is used by ocfs is replaced, in this case, the \-r option should be used. When the \-r option is invoked to recover a GUID, the first mount needs to be invoked using the arguments "\-o reclaimid" or the mount will fail.
-
-.SH "OPTIONS"
-.TP
-\fB\-c\fR 
-Create a new GUID for a new node before it enters the cluster.
-.TP
-\fB\-r\fR 
-Recover the GUID, inserting the new MAC address.  This operation is only for existing nodes whose MAC address has changed.
-.TP
-
-.SH "BUGS"
-Stuff.
-
-.SH "SEE ALSO"
-.BR ocfs(5)  ocfstool(1)
-
-.SH "AUTHORS"
-Oracle Corporation
-
-.SH "COPYRIGHT"
-Copyright \(co 2002 Oracle Corporation

Deleted: trunk/ocfstool/ocfstool.1.in
===================================================================
--- trunk/ocfstool/ocfstool.1.in	2004-02-05 01:20:59 UTC (rev 4)
+++ trunk/ocfstool/ocfstool.1.in	2004-02-05 23:25:02 UTC (rev 5)
@@ -1,24 +0,0 @@
-.TH OCFSTOOL 1 "August 2002" "Version @VERSION@" "OCFS Manual Pages"
-.SH NAME
-ocfstool - GUI frontend for OCFS management and debugging
-.SH SYNOPSIS
-.B ocfstool
-
-.SH DESCRIPTION
-.PP
-\fBocfstool\fP is a GUI frontend for managing and debugging OCFS volumes on
-the system. One can mount and unmount volumes, format, view overview
-information and individual files, see the current node map, and block
-bitmap.
-
-.SH BUGS
-Stuff.
-
-.SH SEE ALSO
-.BR ocfs(5)
-
-.SH AUTHORS
-Oracle Corporation
-
-.SH COPYRIGHT
-Copyright \(co 2002 Oracle Corporation



More information about the Ocfs-tools-commits mailing list