[Ocfs2-tools-commits] zab commits r330 - trunk/fsck.ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Oct 14 13:03:50 CDT 2004
Author: zab
Date: 2004-10-14 13:03:48 -0500 (Thu, 14 Oct 2004)
New Revision: 330
Modified:
trunk/fsck.ocfs2/fsck.c
trunk/fsck.ocfs2/pass1.c
trunk/fsck.ocfs2/pass2.c
trunk/fsck.ocfs2/pass3.c
trunk/fsck.ocfs2/pass4.c
Log:
o some cheese fsck messages that have been sitting here for a while
Modified: trunk/fsck.ocfs2/fsck.c
===================================================================
--- trunk/fsck.ocfs2/fsck.c 2004-10-14 01:34:45 UTC (rev 329)
+++ trunk/fsck.ocfs2/fsck.c 2004-10-14 18:03:48 UTC (rev 330)
@@ -38,6 +38,7 @@
#include "pass2.h"
#include "pass3.h"
#include "pass4.h"
+#include "problem.h"
#include "util.h"
int verbose = 0;
@@ -149,6 +150,7 @@
int64_t blkno, blksize;
o2fsck_state _ost, *ost = &_ost;
int c, ret, rw = OCFS2_FLAG_RW;
+ struct stat st;
memset(ost, 0, sizeof(o2fsck_state));
ost->ost_ask = 1;
@@ -227,6 +229,12 @@
filename = argv[optind];
+ if (stat(filename, &st) == 0 && !S_ISBLK(st.st_mode) &&
+ !prompt(ost, PY, "%s isn't a special block device. Proceed "
+ "anyway?", filename)) {
+ exit(FSCK_ERROR);
+ }
+
/* XXX we'll decide on a policy for using o_direct in the future.
* for now we want to test against loopback files in ext3, say. */
ret = ocfs2_open(filename, rw | OCFS2_FLAG_BUFFERED, blkno,
@@ -260,6 +268,12 @@
/* XXX we don't use the bad blocks inode, do we? */
+ printf("Checking OCFS2 filesystem in %s:\n", filename);
+ printf(" number of blocks: %"PRIu64"\n", ost->ost_fs->fs_blocks);
+ 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);
+
ret = o2fsck_pass1(ost);
if (ret)
com_err(argv[0], ret, "pass1 failed");
@@ -282,6 +296,9 @@
"while closing file \"%s\"", filename);
}
+ /* XXX check if the fs is modified and yell something. */
+ printf("fsck completed successfully.\n");
+
out:
return 0;
}
Modified: trunk/fsck.ocfs2/pass1.c
===================================================================
--- trunk/fsck.ocfs2/pass1.c 2004-10-14 01:34:45 UTC (rev 329)
+++ trunk/fsck.ocfs2/pass1.c 2004-10-14 18:03:48 UTC (rev 330)
@@ -310,6 +310,8 @@
ocfs2_inode_scan *scan;
ocfs2_filesys *fs = ost->ost_fs;
+ printf("Pass 1: Checking inodes and blocks.\n");
+
ret = ocfs2_malloc_block(fs->fs_io, &buf);
if (ret) {
com_err(whoami, ret,
Modified: trunk/fsck.ocfs2/pass2.c
===================================================================
--- trunk/fsck.ocfs2/pass2.c 2004-10-14 01:34:45 UTC (rev 329)
+++ trunk/fsck.ocfs2/pass2.c 2004-10-14 18:03:48 UTC (rev 330)
@@ -556,6 +556,8 @@
.fs = ost->ost_fs,
};
+ printf("Pass 2: Checking directory entries.\n");
+
retval = ocfs2_malloc_block(ost->ost_fs->fs_io, &dd.buf);
if (retval)
return retval;
Modified: trunk/fsck.ocfs2/pass3.c
===================================================================
--- trunk/fsck.ocfs2/pass3.c 2004-10-14 01:34:45 UTC (rev 329)
+++ trunk/fsck.ocfs2/pass3.c 2004-10-14 18:03:48 UTC (rev 330)
@@ -206,6 +206,8 @@
{
o2fsck_dir_parent *dp;
+ printf("Pass 3: Checking directory connectivity.\n");
+
/* these could probably share more code. We might need to treat the
* other required directories like root here */
Modified: trunk/fsck.ocfs2/pass4.c
===================================================================
--- trunk/fsck.ocfs2/pass4.c 2004-10-14 01:34:45 UTC (rev 329)
+++ trunk/fsck.ocfs2/pass4.c 2004-10-14 18:03:48 UTC (rev 330)
@@ -42,6 +42,8 @@
char *buf = NULL;
errcode_t err;
+ printf("Pass 4: Checking inodes link counts.\n");
+
for (ino = 0;
ocfs2_bitmap_find_next_set(ost->ost_used_inodes, ino, &ino) != 0;
ino++) {
More information about the Ocfs2-tools-commits
mailing list