[Ocfs-tools-commits] smushran commits r227 - trunk/fsck
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Feb 10 16:56:59 CST 2005
Author: smushran
Date: 2005-02-10 16:56:56 -0600 (Thu, 10 Feb 2005)
New Revision: 227
Modified:
trunk/fsck/blked.c
Log:
Added N param to disable raw binding in blked
Modified: trunk/fsck/blked.c
===================================================================
--- trunk/fsck/blked.c 2005-01-12 00:56:41 UTC (rev 226)
+++ trunk/fsck/blked.c 2005-02-10 22:56:56 UTC (rev 227)
@@ -93,12 +93,15 @@
}
while (1) {
- c = getopt(argc, argv, "InwvV?h:l:o:t:");
+ c = getopt(argc, argv, "NInwvV?h:l:o:t:");
if (c == -1)
break;
switch (c) {
+ case 'N':
+ ctxt.dev_is_file = true;
+ break;
case 'I':
ctxt.hide_invalids = false;
break;
@@ -174,12 +177,16 @@
else
ctxt.flags = O_RDONLY | O_LARGEFILE;
- if (bind_raw(ctxt.device, &ctxt.raw_minor, ctxt.raw_device, sizeof(ctxt.raw_device)))
- goto bail;
+ if (!ctxt.dev_is_file) {
+ if (bind_raw(ctxt.device, &ctxt.raw_minor, ctxt.raw_device,
+ sizeof(ctxt.raw_device)))
+ goto bail;
+ if (ctxt.verbose)
+ CLEAR_AND_PRINT("Bound %s to %s", ctxt.device,
+ ctxt.raw_device);
+ } else
+ strcpy(ctxt.raw_device, ctxt.device);
- if (ctxt.verbose)
- CLEAR_AND_PRINT("Bound %s to %s", ctxt.device, ctxt.raw_device);
-
if ((fd = myopen(ctxt.raw_device, ctxt.flags)) == -1) {
LOG_ERROR("Error opening %s.\n%s.", ctxt.raw_device,
strerror(errno));
More information about the Ocfs-tools-commits
mailing list