summaryrefslogtreecommitdiff
path: root/nuttx/fs
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-05-13 21:47:36 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-05-13 21:47:36 +0000
commit116ec488ee7d616e562aecbc236e63ef43a90c7c (patch)
treebfd1c53f660743124cc5890a490afa460a23a1f2 /nuttx/fs
parent50f7cb8fa46cae9496b95559e4f2b0874bfa77ac (diff)
downloadpx4-nuttx-116ec488ee7d616e562aecbc236e63ef43a90c7c.tar.gz
px4-nuttx-116ec488ee7d616e562aecbc236e63ef43a90c7c.tar.bz2
px4-nuttx-116ec488ee7d616e562aecbc236e63ef43a90c7c.zip
Initial mount integration
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@222 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/fs')
-rw-r--r--nuttx/fs/fs_fat32.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/nuttx/fs/fs_fat32.c b/nuttx/fs/fs_fat32.c
index 35870b3ae..9edd320c4 100644
--- a/nuttx/fs/fs_fat32.c
+++ b/nuttx/fs/fs_fat32.c
@@ -480,8 +480,6 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
if (MBR_GETSIGNATURE(fs->fs_buffer) != 0xaa55 ||
MBR_GETROOTENTCNT(fs->fs_buffer) != 0 ||
- MBR_GETFATSZ16(fs->fs_buffer) != 0 ||
- MBR_GETTOTSEC16(fs->fs_buffer) != 0 ||
MBR_GETBYTESPERSEC(fs->fs_buffer) != fs->fs_hwsectorsize)
{
return -ENODEV;
@@ -495,7 +493,12 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
* Determine the number of sectors in a FAT.
*/
- fs->fs_fatsize = MBR_GETFATSZ32(fs->fs_buffer);
+ fs->fs_fatsize = MBR_GETFATSZ16(fs->fs_buffer); /* Should be zero */
+ if (!fs->fs_fatsize)
+ {
+ fs->fs_fatsize = MBR_GETFATSZ32(fs->fs_buffer);
+ }
+
if (fs->fs_fatsize >= fs->fs_hwnsectors)
{
return -ENODEV;
@@ -503,7 +506,12 @@ static int fat_checkbootrecord(struct fat_mountpt_s *fs)
/* Get the total number of sectors on the volume. */
- fs->fs_fattotsec = MBR_GETTOTSEC32(fs->fs_buffer);
+ fs->fs_fattotsec = MBR_GETTOTSEC16(fs->fs_buffer); /* Should be zero */
+ if (!fs->fs_fattotsec)
+ {
+ fs->fs_fattotsec = MBR_GETTOTSEC32(fs->fs_buffer);
+ }
+
if (fs->fs_fattotsec > fs->fs_hwnsectors)
{
return -ENODEV;