Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / fs / ntfs / types.h
index a33fc63..6e4a7e3 100644 (file)
@@ -2,7 +2,7 @@
  * types.h - Defines for NTFS Linux kernel driver specific types.
  *          Part of the Linux-NTFS project.
  *
- * Copyright (c) 2001-2004 Anton Altaparmakov
+ * Copyright (c) 2001-2005 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
 #ifndef _LINUX_NTFS_TYPES_H
 #define _LINUX_NTFS_TYPES_H
 
+#include <linux/types.h>
+
+typedef __le16 le16;
+typedef __le32 le32;
+typedef __le64 le64;
+typedef __u16 __bitwise sle16;
+typedef __u32 __bitwise sle32;
+typedef __u64 __bitwise sle64;
+
 /* 2-byte Unicode character type. */
-typedef u16 ntfschar;
+typedef le16 ntfschar;
 #define UCHAR_T_SIZE_BITS 1
 
 /*
@@ -32,7 +41,9 @@ typedef u16 ntfschar;
  * and VCN, to allow for type checking and better code readability.
  */
 typedef s64 VCN;
+typedef sle64 leVCN;
 typedef s64 LCN;
+typedef sle64 leLCN;
 
 /*
  * The NTFS journal $LogFile uses log sequence numbers which are signed 64-bit
@@ -40,34 +51,15 @@ typedef s64 LCN;
  * code readability.
  */
 typedef s64 LSN;
+typedef sle64 leLSN;
 
-/**
- * run_list_element - in memory vcn to lcn mapping array element
- * @vcn:       starting vcn of the current array element
- * @lcn:       starting lcn of the current array element
- * @length:    length in clusters of the current array element
- *
- * The last vcn (in fact the last vcn + 1) is reached when length == 0.
- *
- * When lcn == -1 this means that the count vcns starting at vcn are not
- * physically allocated (i.e. this is a hole / data is sparse).
- */
-typedef struct {       /* In memory vcn to lcn mapping structure element. */
-       VCN vcn;        /* vcn = Starting virtual cluster number. */
-       LCN lcn;        /* lcn = Starting logical cluster number. */
-       s64 length;     /* Run length in clusters. */
-} run_list_element;
-
-/**
- * run_list - in memory vcn to lcn mapping array including a read/write lock
- * @rl:                pointer to an array of run list elements
- * @lock:      read/write spinlock for serializing access to @rl
- *
+/*
+ * The NTFS transaction log $UsnJrnl uses usn which are signed 64-bit values.
+ * We define our own type USN, to allow for type checking and better code
+ * readability.
  */
-typedef struct {
-       run_list_element *rl;
-       struct rw_semaphore lock;
-} run_list;
+typedef s64 USN;
+typedef sle64 leUSN;
 
 typedef enum {
        FALSE = 0,