/*
-/*
* 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%
*/
#include <malloc.h>
#include <linux/types.h>
-#include <linux/ext2_fs.h>
+#include "ext2_fs.h"
#include <errno.h>
#include "et/com_err.h"
static errcode_t nt_flush(io_channel channel);
static struct struct_io_manager struct_nt_manager = {
- EXT2_ET_MAGIC_IO_MANAGER,
- "NT I/O Manager",
- nt_open,
- nt_close,
- nt_set_blksize,
- nt_read_blk,
- nt_write_blk,
- nt_flush
+ .magic = EXT2_ET_MAGIC_IO_MANAGER,
+ .name = "NT I/O Manager",
+ .open = nt_open,
+ .close = nt_close,
+ .set_blksize = nt_set_blksize,
+ .read_blk = nt_read_blk,
+ .write_blk = nt_write_blk,
+ .flush = nt_flush
};
-
-
//
// function to get API
//
&ObjectAttributes,
&IoStatusBlock,
FILE_SHARE_WRITE | FILE_SHARE_READ,
- FILE_SYNCHRONOUS_IO_ALERT);
+ FILE_SYNCHRONOUS_IO_NONALERT);
if(!NT_SUCCESS(Status))
{
&ObjectAttributes,
&IoStatusBlock,
FILE_SHARE_WRITE | FILE_SHARE_READ,
- FILE_SYNCHRONOUS_IO_ALERT);
+ FILE_SYNCHRONOUS_IO_NONALERT);
//
// Try to satisfy mode
&ObjectAttributes,
&IoStatusBlock,
FILE_SHARE_WRITE | FILE_SHARE_READ,
- FILE_SYNCHRONOUS_IO_ALERT);
+ FILE_SYNCHRONOUS_IO_NONALERT);
}
}
// 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;
}
if (NULL != io)
{
- if(NULL != io->name)
- {
- free(io->name);
- }
-
+ free(io->name);
free(io);
}
_CloseDisk(NtData->Handle);
}
- if(NULL != NtData->Buffer)
- {
- free(NtData->Buffer);
- }
-
+ free(NtData->Buffer);
free(NtData);
}
}
return 0;
}
- if(NULL != channel->name)
- {
- free(channel->name);
- }
-
-
+ free(channel->name);
free(channel);
if (NULL != NtData)
_CloseDisk(NtData->Handle);
}
- if(NULL != NtData->Buffer)
- {
- free(NtData->Buffer);
- }
-
+ free(NtData->Buffer);
free(NtData);
}