Changes by: antona
Update of /cvsroot/linux-ntfs/linux-ntfs/include
In directory usw-pr-cvs1:/tmp/cvs-serv10451/include
Modified Files:
Makefile.am Makefile.in inode.h unistr.h
Log Message:
Add foundation of new inode API.
Index: Makefile.am
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/Makefile.am,v
retrieving revision 1.9
retrieving revision 1.10
diff -U2 -r1.9 -r1.10
--- Makefile.am 14 Apr 2002 13:56:44 -0000 1.9
+++ Makefile.am 19 Apr 2002 18:23:56 -0000 1.10
@@ -28,5 +28,4 @@
# Don't need these distributed.
#EXTRA_DIST = \
-# attrib_RE.h \
-# mft_old.h
+# attrib_RE.h
Index: Makefile.in
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/Makefile.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -U2 -r1.14 -r1.15
--- Makefile.in 14 Apr 2002 13:58:54 -0000 1.14
+++ Makefile.in 19 Apr 2002 18:23:56 -0000 1.15
@@ -265,6 +265,5 @@
# Don't need these distributed.
#EXTRA_DIST = \
-# attrib_RE.h \
-# mft_old.h
+# attrib_RE.h
# Tell versions [3.59,3.63) of GNU make to not export all variables.
Index: inode.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/inode.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -U2 -r1.2 -r1.3
--- inode.h 15 Apr 2002 22:35:07 -0000 1.2
+++ inode.h 19 Apr 2002 18:23:56 -0000 1.3
@@ -1,7 +1,6 @@
/*
- * inode.h - Defines for NTFS inode structures. Part of the Linux-NTFS project.
+ * inode.h - Defines for NTFS inode handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2001,2002 Anton Altaparmakov.
- * Copyright (c) 2002 Richard Russon.
*
* This program/include file is free software; you can redistribute it and/or
@@ -37,12 +36,31 @@
NI_AttrListNonResident, /* 1: Attribute list is non-resident. Implies
NI_AttrList is set. */
+ NI_AttrListDirty, /* 1: Attribute list needs to be written to the
+ mft record and then to disk. */
} ntfs_inode_state_bits;
-#define NInoDirty(n_ino) test_bit(NI_Dirty, &(n_ino)->state)
-#define NInoSetDirty(n_ino) set_bit(NI_Dirty, &(n_ino)->state)
-#define NInoClearDirty(n_ino) clear_bit(NI_Dirty, &(n_ino)->state)
-
-#define NInoAttrList(n_ino) test_bit(NI_AttrList, &(n_ino)->state)
-#define NInoNonResident(n_ino) test_bit(NI_NonResident, &(n_ino)->state)
+#define test_nino_flag(ni, flag) test_bit(NI_##flag, (ni)->state)
+#define set_nino_flag(ni, flag) set_bit(NI_##flag, (ni)->state)
+#define clear_nino_flag(ni, flag) clear_bit(NI_##flag, (ni)->state)
+
+#define NInoDirty(ni) test_nino_flag(ni, Dirty)
+#define NInoSetDirty(ni) set_nino_flag(ni, Dirty)
+#define NInoClearDirty(ni) clear_nino_flag(ni, Dirty)
+
+#define NInoAttrList(ni) test_nino_flag(ni, AttrList)
+#define NInoSetAttrList(ni) set_nino_flag(ni, AttrList)
+#define NInoClearAttrList(ni) clear_nino_flag(ni, AttrList)
+
+#define test_nino_al_flag(ni, flag) test_nino_flag(ni, AttrList##flag)
+#define set_nino_al_flag(ni, flag) set_nino_flag(ni, AttrList##flag)
+#define clear_nino_al_flag(ni, flag) clear_nino_flag(ni, AttrList##flag)
+
+#define NInoAttrListNonResident(ni) test_nino_al_flag(ni, NonResident)
+#define NInoSetAttrListNonResident(ni) set_nino_al_flag(ni, NonResident)
+#define NInoClearAttrListNonResident(ni) clear_nino_al_flag(ni, NonResident)
+
+#define NInoAttrListDirty(ni) test_nino_al_flag(ni, Dirty)
+#define NInoAttrListSetDirty(ni) set_nino_al_flag(ni, Dirty)
+#define NInoAttrListClearDirty(ni) clear_nino_al_flag(ni, Dirty)
typedef struct _ntfs_inode ntfs_inode;
@@ -53,20 +71,21 @@
*/
struct _ntfs_inode {
- __u64 mft_no; /* Mft record number (inode number). */
- MFT_RECORD *mrec; /* The actual mft record of the inode. */
+ __u64 mft_no; /* Inode / mft record number. */
+ MFT_RECORD *mft_rec; /* The actual mft record of the inode. */
ntfs_volume *vol; /* Pointer to the ntfs volume of this inode. */
unsigned long state; /* NTFS specific flags describing this inode.
- See ntfs_inode_state_bits above. */
+ See ntfs_inode_flags above. */
/*
- * Attribute list support (only for use by the attribute lookup
- * functions). Setup during ntfs_open() for all inodes with attribute
- * lists. Only valid if NI_AttrList is set in state, and attr_list_rl is
- * further only valid if NI_AttrListNonResident is set.
+ * Attribute list support (for use by the attribute lookup functions).
+ * Setup during ntfs_open_inode() for all inodes with attribute lists.
+ * Only valid if NI_AttrList is set in state, further attr_list_rl is
+ * only valid if NI_AttrListNonResident is set.
*/
__u32 attr_list_size; /* Length of attribute list value in bytes. */
__u8 *attr_list; /* Attribute list value itself. */
run_list *attr_list_rl; /* Run list for the attribute list value. */
- __s32 nr_extents;/* For a base mft record, the number of attached extent
- inodes (0 if none), for extent records this is -1. */
+ __s32 nr_extents; /* For a base mft record, the number of
+ attached extent inodes (0 if none), for
+ extent records this is -1. */
union { /* This union is only used if nr_extents != 0. */
ntfs_inode **extent_ntfs_inos; /* For nr_extents > 0, array of
@@ -80,4 +99,8 @@
};
};
+
+extern ntfs_inode *ntfs_open_inode(const ntfs_volume *vol, const MFT_REF mref);
+
+extern int ntfs_close_inode(ntfs_inode *ni);
#endif /* _LINUX_NTFS_FS_INODE_H */
Index: unistr.h
===================================================================
RCS file: /cvsroot/linux-ntfs/linux-ntfs/include/unistr.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -U2 -r1.11 -r1.12
--- unistr.h 18 Apr 2002 17:20:05 -0000 1.11
+++ unistr.h 19 Apr 2002 18:23:56 -0000 1.12
@@ -59,5 +59,4 @@
extern int ntfs_ucstombs(const uchar_t *ins, const int ins_len, char **outs,
int outs_len);
-
extern int ntfs_mbstoucs(const char *ins, const int ins_len, uchar_t **outs,
int outs_len);
|