"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "include/ntfs-3g/logfile.h" between
ntfs-3g_ntfsprogs-2016.2.22.tgz and ntfs-3g_ntfsprogs-2017.3.23.tgz

About: NTFS-3G is a read-write NTFS driver for Linux and other operating systems. It provides safe handling of the Windows XP, Windows Server 2003, Windows 2000, Windows Vista, Windows Server 2008, Windows 7 and Windows 8 NTFS file systems.

logfile.h  (ntfs-3g_ntfsprogs-2016.2.22.tgz):logfile.h  (ntfs-3g_ntfsprogs-2017.3.23.tgz)
/* /*
* logfile.h - Exports for $LogFile handling. Originated from the Linux-NTFS pr oject. * logfile.h - Exports for $LogFile handling. Originated from the Linux-NTFS pr oject.
* *
* Copyright (c) 2000-2005 Anton Altaparmakov * Copyright (c) 2000-2005 Anton Altaparmakov
* Copyright (c) 2016 Jean-Pierre Andre
* *
* This program/include file is free software; you can redistribute it and/or * 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 * 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 * by the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program/include file is distributed in the hope that it will be * This program/include file is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
skipping to change at line 96 skipping to change at line 97
between 4096 and 8192. Otherwise this is between 4096 and 8192. Otherwise this is
set to the system page size instead. */ set to the system page size instead. */
/* 24*/ le16 restart_area_offset;/* Byte offset from the start of this he ader to /* 24*/ le16 restart_area_offset;/* Byte offset from the start of this he ader to
the RESTART_AREA. Value has to be aligned the RESTART_AREA. Value has to be aligned
to 8-byte boundary. When creating, set this to 8-byte boundary. When creating, set this
to be after the usa. */ to be after the usa. */
/* 26*/ sle16 minor_ver; /* Log file minor version. Only check if major /* 26*/ sle16 minor_ver; /* Log file minor version. Only check if major
version is 1. */ version is 1. */
/* 28*/ sle16 major_ver; /* Log file major version. We only suppo rt /* 28*/ sle16 major_ver; /* Log file major version. We only suppo rt
version 1.1. */ version 1.1. */
/* sizeof() = 30 (0x1e) bytes */ /* 30*/ le16 usn;
/* sizeof() = 32 (0x20) bytes */
} __attribute__((__packed__)) RESTART_PAGE_HEADER; } __attribute__((__packed__)) RESTART_PAGE_HEADER;
/* /*
* Constant for the log client indices meaning that there are no client records * Constant for the log client indices meaning that there are no client records
* in this particular client array. Also inside the client records themselves, * in this particular client array. Also inside the client records themselves,
* this means that there are no client records preceding or following this one. * this means that there are no client records preceding or following this one.
*/ */
#define LOGFILE_NO_CLIENT const_cpu_to_le16(0xffff)
#define LOGFILE_NO_CLIENT_CPU 0xffff #define LOGFILE_NO_CLIENT_CPU 0xffff
#define LOGFILE_NO_CLIENT const_cpu_to_le16(LOGFILE_NO_CLIENT_CPU)
/* /*
* These are the so far known RESTART_AREA_* flags (16-bit) which contain * These are the so far known RESTART_AREA_* flags (16-bit) which contain
* information about the log file in which they are present. * information about the log file in which they are present.
*/ */
enum { enum {
RESTART_VOLUME_IS_CLEAN = const_cpu_to_le16(0x0002), RESTART_VOLUME_IS_CLEAN = const_cpu_to_le16(0x0002),
RESTART_SPACE_FILLER = 0xffff, /* gcc: Force enum bit width to 16. */ RESTART_SPACE_FILLER = 0xffff, /* gcc: Force enum bit width to 16. */
} __attribute__((__packed__)); } __attribute__((__packed__));
skipping to change at line 324 skipping to change at line 326
alignment). */ alignment). */
le16 usa_count; /* See NTFS_RECORD definition in layout.h. */ le16 usa_count; /* See NTFS_RECORD definition in layout.h. */
union { union {
leLSN last_lsn; leLSN last_lsn;
sle64 file_offset; sle64 file_offset;
} __attribute__((__packed__)) copy; } __attribute__((__packed__)) copy;
le32 flags; le32 flags;
le16 page_count; le16 page_count;
le16 page_position; le16 page_position;
union { le16 next_record_offset;
struct { le16 reserved[3];
le16 next_record_offset; leLSN last_end_lsn;
u8 reserved[6];
leLSN last_end_lsn;
} __attribute__((__packed__)) packed;
} __attribute__((__packed__)) header;
} __attribute__((__packed__)) RECORD_PAGE_HEADER; } __attribute__((__packed__)) RECORD_PAGE_HEADER;
/** /**
* enum LOG_RECORD_FLAGS - Possible 16-bit flags for log records. * enum LOG_RECORD_FLAGS - Possible 16-bit flags for log records.
* *
* Some flags describe what kind of update is being logged.
*
* (Or is it log record pages?) * (Or is it log record pages?)
*/ */
typedef enum { typedef enum {
LOG_RECORD_MULTI_PAGE = const_cpu_to_le16(0x0001), /* ??? */ LOG_RECORD_MULTI_PAGE = const_cpu_to_le16(0x0001), /* ??? */
/* The flags below were introduced in Windows 10 */
LOG_RECORD_DELETING = const_cpu_to_le16(0x0002),
LOG_RECORD_ADDING = const_cpu_to_le16(0x0004),
LOG_RECORD_SIZE_PLACE_HOLDER = 0xffff, LOG_RECORD_SIZE_PLACE_HOLDER = 0xffff,
/* This has nothing to do with the log record. It is only so /* This has nothing to do with the log record. It is only so
gcc knows to make the flags 16-bit. */ gcc knows to make the flags 16-bit. */
} __attribute__((__packed__)) LOG_RECORD_FLAGS; } __attribute__((__packed__)) LOG_RECORD_FLAGS;
/** /**
* struct LOG_CLIENT_ID - The log client id structure identifying a log client. * struct LOG_CLIENT_ID - The log client id structure identifying a log client.
*/ */
typedef struct { typedef struct {
le16 seq_number; le16 seq_number;
le16 client_index; le16 client_index;
} __attribute__((__packed__)) LOG_CLIENT_ID; } __attribute__((__packed__)) LOG_CLIENT_ID;
/*
* LOG_RECORD_TYPE : types of log records
*/
enum {
LOG_STANDARD = const_cpu_to_le32(1),
LOG_CHECKPOINT = const_cpu_to_le32(2),
LOG_RECORD_TYPE_PLACE_HOLDER = 0xffffffffU
} ;
typedef le32 LOG_RECORD_TYPE;
/*
* ATTRIBUTE_FLAGS : flags describing the kind of NTFS record
* is being updated.
* These flags were introduced in Vista, only two flags are known?
*/
enum {
ACTS_ON_MFT = const_cpu_to_le16(2),
ACTS_ON_INDX = const_cpu_to_le16(8),
ATTRIBUTE_FLAGS_PLACE_HOLDER = 0xffff,
} ;
typedef le16 ATTRIBUTE_FLAGS;
#define LOG_RECORD_HEAD_SZ 0x30 /* size of header of struct LOG_RECORD */
/** /**
* struct LOG_RECORD - Log record header. * struct LOG_RECORD - Log record header.
* *
* Each log record seems to have a constant size of 0x70 bytes. * Each log record seems to have a constant size of 0x70 bytes.
*/ */
typedef struct { typedef struct {
leLSN this_lsn; leLSN this_lsn;
leLSN client_previous_lsn; leLSN client_previous_lsn;
leLSN client_undo_next_lsn; leLSN client_undo_next_lsn;
le32 client_data_length; le32 client_data_length;
LOG_CLIENT_ID client_id; LOG_CLIENT_ID client_id;
le32 record_type; LOG_RECORD_TYPE record_type;
le32 transaction_id; le32 transaction_id;
le16 flags; LOG_RECORD_FLAGS log_record_flags;
le16 reserved_or_alignment[3]; le16 reserved_or_alignment[3];
/* Now are at ofs 0x30 into struct. */ /* Now are at ofs 0x30 into struct. */
le16 redo_operation; le16 redo_operation;
le16 undo_operation; le16 undo_operation;
le16 redo_offset; le16 redo_offset;
le16 redo_length; le16 redo_length;
le16 undo_offset; union {
le16 undo_length; struct {
le16 target_attribute; le16 undo_offset;
le16 lcns_to_follow; /* Number of lcn_list entries le16 undo_length;
le16 target_attribute;
le16 lcns_to_follow; /* Number of lcn_list entries
following this entry. */ following this entry. */
/* Now at ofs 0x40. */ /* Now at ofs 0x40. */
le16 record_offset; le16 record_offset;
le16 attribute_offset; le16 attribute_offset;
le32 alignment_or_reserved; le16 cluster_index;
leVCN target_vcn; ATTRIBUTE_FLAGS attribute_flags;
leVCN target_vcn;
/* Now at ofs 0x50. */ /* Now at ofs 0x50. */
struct { /* Only present if lcns_to_follow leLCN lcn_list[0]; /* Only present if lcns_to_follow
is not 0. */ is not 0. */
leLCN lcn; } __attribute__((__packed__));
} __attribute__((__packed__)) lcn_list[0]; struct {
leLSN transaction_lsn;
leLSN attributes_lsn;
leLSN names_lsn;
leLSN dirty_pages_lsn;
le64 unknown_list[0];
} __attribute__((__packed__));
} __attribute__((__packed__));
} __attribute__((__packed__)) LOG_RECORD; } __attribute__((__packed__)) LOG_RECORD;
/**
* struct BITMAP_ACTION - Bitmap change being logged
*/
struct BITMAP_ACTION {
le32 firstbit;
le32 count;
} ;
/**
* struct ATTR - Attribute record.
*
* The format of an attribute record has changed from Windows 10.
* The old format was 44 bytes long, despite having 8 bytes fields,
* and this leads to alignment problems in arrays.
* This problem does not occur in the new format, which is shorter.
* The format being used can generally be determined from size.
*/
typedef struct { /* Format up to Win10 (44 bytes) */
le64 unknown1;
le64 unknown2;
le64 inode;
leLSN lsn;
le32 unknown3;
le32 type;
le32 unknown4;
} __attribute__((__packed__)) ATTR_OLD;
typedef struct { /* Format since Win10 (40 bytes) */
le64 unknown1;
le64 unknown2;
le32 type;
le32 unknown3;
le64 inode;
leLSN lsn;
} __attribute__((__packed__)) ATTR_NEW;
extern BOOL ntfs_check_logfile(ntfs_attr *log_na, RESTART_PAGE_HEADER **rp); extern BOOL ntfs_check_logfile(ntfs_attr *log_na, RESTART_PAGE_HEADER **rp);
extern BOOL ntfs_is_logfile_clean(ntfs_attr *log_na, RESTART_PAGE_HEADER *rp); extern BOOL ntfs_is_logfile_clean(ntfs_attr *log_na, RESTART_PAGE_HEADER *rp);
extern int ntfs_empty_logfile(ntfs_attr *na); extern int ntfs_empty_logfile(ntfs_attr *na);
#endif /* defined _NTFS_LOGFILE_H */ #endif /* defined _NTFS_LOGFILE_H */
 End of changes. 14 change blocks. 
23 lines changed or deleted 99 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS