Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/include
In directory usw-pr-cvs1:/tmp/cvs-serv6561
Modified Files:
disk_io.h
Added Files:
bootsect.h
Log Message:
Added for now last header file for boot sector handling.
--- NEW FILE ---
/*
* bootsect.h - Exports for bootsector record handling. Part of the Linux-NTFS
* project.
*
* Copyright (c) 2000,2001 Anton Altaparmakov.
*
* This program/include file 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/include file 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 (in the main directory of the Linux-NTFS
* distribution in the file COPYING); if not, write to the Free Software
* Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef BOOTSECT_H
#define BOOTSECT_H
/* The NTFS OEMid */
#define magicNTFS cpu_to_le64(0x202020205346544e) /* "NTFS " */
/*
* Location of bootsector on partition:
* The standard PACKED_BOOT_SECTOR is on sector 0 of the partition.
* On NT4 and above there is one backup copy of the boot sector to
* be found on the last sector of the partition (not normally accessible
* from within Windows as the bootsector contained number of sectors value
* is one less than the actual value!).
* On versions of NT 3.51 and earlier, the backup copy was located at
* number of sectors/2, i.e. in the middle of the volume.
*/
/*
* BIOS parameter block (bpb) structure.
*/
typedef struct {
__u16 bytes_per_sector; /* Size of a sector in bytes. */
__u8 sectors_per_cluster; /* Size of a cluster in sectors. */
__u16 reserved_sectors; /* zero */
__u8 fats; /* zero */
__u16 root_entries; /* zero */
__u16 sectors; /* zero */
__u8 media_type; /* irrelevant */
__u16 sectors_per_fat; /* zero */
__u16 sectors_per_track; /* irrelevant */
__u16 heads; /* irrelevant */
__u32 hidden_sectors; /* zero */
__u32 large_sectors; /* zero */
} __attribute__ ((__packed__)) BIOS_PARAMETER_BLOCK;
/*
* Boot sector structure.
*/
typedef struct {
__u8 jump[3]; /* Irrelevant (jump to boot up code).*/
__u64 oem_id; /* Magic "NTFS ". */
BIOS_PARAMETER_BLOCK bpb; /* See BIOS_PARAMETER_BLOCK. */
__u8 unused[4]; /* zero */
__s64 number_of_sectors; /* Number of sectors in volume. Gives
maximum volume size of 2^63 sectors.
Assuming standard sector size of 512
bytes, the maximum byte size is
approx. 4.7x10^21 bytes. (-; */
__s64 mft_lcn; /* Cluster location of mft. */
__s64 mftmirr_lcn; /* Cluster lcoation of copy of mft. */
__s8 clusters_per_mft_record; /* Mft record size in clusters. */
__u8 reserved0[3]; /* zero */
__s8 clusters_per_index_block; /* Index block size in clusters. */
__u8 reserved1[3]; /* zero */
__s64 volume_serial_number; /* Irrelevant (serial number). */
__u32 checksum; /* Boot sector checksum. */
__u8 bootstrap[426]; /* Irrelevant (boot up code). */
__u16 end_of_sector_marker; /* 0xaa55 in little endian. */
} __attribute__ ((__packed__)) NTFS_BOOT_SECTOR;
/**
* is_boot_sector_ntfs - check a boot sector for describing an ntfs volume
* @b: buffer containing the boot sector
* @silent: if 1 don't display progress information
*
* This function checks the boot sector in @b for describing a valid ntfs
* volume. Return 1 if @b is a NTFS boot sector or 0 otherwise. If silent is 0
* progress output will be output to stdout. If silent is 1 no output to stdout
* will occur. Errors/warnings to stderr will occur disregarding the value of
* silent.
*/
int is_boot_sector_ntfs(PACKED_BOOT_SECTOR *b, int silent);
#endif /* defined BOOTSECT_H */
Index: disk_io.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/disk_io.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** disk_io.h 2001/01/24 18:44:31 1.1
--- disk_io.h 2001/01/24 20:37:36 1.2
***************
*** 36,40 ****
* This function will write @count bytes of data @b to file descriptor @fd at
* position @pos.
!
* On success return bytes written (0 means nothing written).
* On error return -1 with errno set appropriately to the return code of
--- 36,40 ----
* This function will write @count bytes of data @b to file descriptor @fd at
* position @pos.
! *
* On success return bytes written (0 means nothing written).
* On error return -1 with errno set appropriately to the return code of
|