Whamcloud - gitweb
libext2fs: allocate clusters to files in expand_dir.c and mkjournal.c
[tools/e2fsprogs.git] / lib / ext2fs / nt_io.c
index 4b3ce47..0f10543 100644 (file)
@@ -1,15 +1,14 @@
 /*
-/*
  * nt_io.c --- This is the Nt I/O interface to the I/O manager.
  *
  * Implements a one-block write-through cache.
  *
  * Copyright (C) 1993, 1994, 1995 Theodore Ts'o.
- * Copyright (C) 1998 Andrey Shedel
+ * Copyright (C) 1998 Andrey Shedel (andreys@ns.cr.cyco.com)
  *
  * %Begin-Header%
- * This file may be redistributed under the terms of the GNU Public
- * License.
+ * This file may be redistributed under the terms of the GNU Library
+ * General Public License, version 2.
  * %End-Header%
  */
 
@@ -179,7 +178,7 @@ NtDelayExecution(
 #include <malloc.h>
 
 #include <linux/types.h>
-#include <linux/ext2_fs.h>
+#include "ext2_fs.h"
 #include <errno.h>
 
 #include "et/com_err.h"
@@ -442,7 +441,7 @@ _OpenNtName(
                                                &ObjectAttributes,
                                                &IoStatusBlock,
                                                FILE_SHARE_WRITE | FILE_SHARE_READ,
-                                               FILE_SYNCHRONOUS_IO_ALERT);
+                                               FILE_SYNCHRONOUS_IO_NONALERT);
 
        if(!NT_SUCCESS(Status))
        {
@@ -460,7 +459,7 @@ _OpenNtName(
                                                        &ObjectAttributes,
                                                        &IoStatusBlock,
                                                        FILE_SHARE_WRITE | FILE_SHARE_READ,
-                                                       FILE_SYNCHRONOUS_IO_ALERT);
+                                                       FILE_SYNCHRONOUS_IO_NONALERT);
 
                //
                // Try to satisfy mode
@@ -478,7 +477,7 @@ _OpenNtName(
                                                        &ObjectAttributes,
                                                        &IoStatusBlock,
                                                        FILE_SHARE_WRITE | FILE_SHARE_READ,
-                                                       FILE_SYNCHRONOUS_IO_ALERT);
+                                                       FILE_SYNCHRONOUS_IO_NONALERT);
                }
        }
 
@@ -1169,7 +1168,7 @@ nt_open(const char *name, int flags, io_channel *channel)
                // Lock/dismount
                //
 
-               if(!NT_SUCCESS(_LockDrive(NtData->Handle)) || !NT_SUCCESS(_DismountDrive(NtData->Handle)))
+               if(!NT_SUCCESS(_LockDrive(NtData->Handle)) /*|| !NT_SUCCESS(_DismountDrive(NtData->Handle))*/)
                {
                        NtData->OpenedReadonly = TRUE;
                }
@@ -1192,11 +1191,7 @@ nt_open(const char *name, int flags, io_channel *channel)
 
                        if (NULL != io)
                        {
-                               if(NULL != io->name)
-                               {
-                                       free(io->name);
-                               }
-
+                               free(io->name);
                                free(io);
                        }
 
@@ -1208,11 +1203,7 @@ nt_open(const char *name, int flags, io_channel *channel)
                                        _CloseDisk(NtData->Handle);
                                }
 
-                               if(NULL != NtData->Buffer)
-                               {
-                                       free(NtData->Buffer);
-                               }
-
+                               free(NtData->Buffer);
                                free(NtData);
                        }
                }
@@ -1246,12 +1237,7 @@ nt_close(io_channel channel)
                return 0;
        }
 
-       if(NULL != channel->name)
-       {
-               free(channel->name);
-       }
-
-
+       free(channel->name);
        free(channel);
 
        if (NULL != NtData)
@@ -1263,11 +1249,7 @@ nt_close(io_channel channel)
                        _CloseDisk(NtData->Handle);
                }
 
-               if(NULL != NtData->Buffer)
-               {
-                       free(NtData->Buffer);
-               }
-
+               free(NtData->Buffer);
                free(NtData);
        }