summaryrefslogtreecommitdiff
path: root/nuttx/fs/fs_internal.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-05-26 19:22:34 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-05-26 19:22:34 +0000
commita0fcefa90d39c5510c3f62bdbd3f2f128f211d6b (patch)
tree1deba65ce2f157d8f25da5498676e306742887e8 /nuttx/fs/fs_internal.h
parentf93e30156c033d77182a052549a5e355a5d0a5a0 (diff)
downloadpx4-nuttx-a0fcefa90d39c5510c3f62bdbd3f2f128f211d6b.tar.gz
px4-nuttx-a0fcefa90d39c5510c3f62bdbd3f2f128f211d6b.tar.bz2
px4-nuttx-a0fcefa90d39c5510c3f62bdbd3f2f128f211d6b.zip
Finish FAT directory operations; add option to disable mountpoints; fix ARM compile errors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@252 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/fs/fs_internal.h')
-rw-r--r--nuttx/fs/fs_internal.h57
1 files changed, 31 insertions, 26 deletions
diff --git a/nuttx/fs/fs_internal.h b/nuttx/fs/fs_internal.h
index c20ab2176..432344515 100644
--- a/nuttx/fs/fs_internal.h
+++ b/nuttx/fs/fs_internal.h
@@ -73,10 +73,34 @@
* Public Types
****************************************************************************/
-/* The internal representation of type DIR is just a
- * container for an inode reference and a dirent structure.
+/* The internal representation of type DIR is just a container for an inode
+ * reference, a position, a dirent structure, and file-system-specific
+ * information.
+ *
+ * For the root psuedo-file system, we need retain only the 'next' inode
+ * need for the next readdir() operation. We hold a reference on this
+ * inode so we know that it will persist until closedir is called.
+ */
+
+struct fs_psuedodir_s
+{
+ struct inode *fd_next; /* The inode for the next call to readdir() */
+};
+
+#ifdef CONFIG_FS_FAT
+/* For fat, we need to retun the start cluster, current cluster, current
+ * sector and current directory index.
*/
+struct fs_fatdir_s
+{
+ uint32 fd_startcluster; /* Start cluster number of the directory*/
+ uint32 fd_currcluster; /* Current cluster number being read*/
+ size_t fd_currsector; /* Current sector being read*/
+ unsigned int fd_index; /* Current index of the directory entry to read */
+};
+#endif
+
struct internal_dir_s
{
/* This is the node that was opened by opendir. The type of the inode
@@ -87,11 +111,11 @@ struct internal_dir_s
* closedir() is called (although inodes linked to this inode may change).
*/
- struct inode *root;
+ struct inode *fd_root;
/* This keeps track of the current directory position for telldir */
- off_t position;
+ off_t fd_position;
/* Retained control information depends on the type of file system that
* provides is provides the mountpoint. Ideally this information should
@@ -101,34 +125,15 @@ struct internal_dir_s
union
{
- /* For the root psuedo-file system, we need retain only the 'next' inode
- * need for the next readdir() operation. We hold a reference on this
- * inode so we know that it will persist until closedir is called.
- */
-
- struct
- {
- struct inode *next; /* The inode for the next call to readdir() */
- } psuedo;
-
+ struct fs_psuedodir_s psuedo;
#ifdef CONFIG_FS_FAT
- /* For fat, we need to retun the start cluster, current cluster, current
- * sector and current directory index.
- */
-
- struct
- {
- uint32 startcluster; /* Starting cluster of directory */
- uint32 currcluster; /* The current cluster being read */
- size_t currsector; /* The current sector being read */
- unsigned int dirindex; /* The next directory entry to read */
- } fat;
+ struct fs_fatdir_s fat;
#endif
} u;
/* In any event, this the actual struct dirent that is returned by readdir */
- struct dirent dir; /* Populated when readdir is called */
+ struct dirent fd_dir; /* Populated when readdir is called */
};
/****************************************************************************