Added mkfatfs() test
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@806 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
dd7f63b94a
commit
871a684fc6
44
COPYING
Executable file
44
COPYING
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
/*************************************************************************
|
||||||
|
* *
|
||||||
|
* COPYING -- Describes the terms under which Nuttx is distributed. A *
|
||||||
|
* copy of the BSD-style licensing is included in this file. In my *
|
||||||
|
* words -- I believe that you should free to use NuttX in any *
|
||||||
|
* environmnet, private, private, commercial, open, closed, etc. *
|
||||||
|
* provided only that you repect the modest copyright notices as *
|
||||||
|
* described in license (below). Please feel free to contact me if you *
|
||||||
|
* have any licensing concerns. *
|
||||||
|
* *
|
||||||
|
*************************************************************************
|
||||||
|
* *
|
||||||
|
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. *
|
||||||
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> *
|
||||||
|
* *
|
||||||
|
* Redistribution and use in source and binary forms, with or without *
|
||||||
|
* modification, are permitted provided that the following conditions *
|
||||||
|
* are met: *
|
||||||
|
* *
|
||||||
|
* 1. Redistributions of source code must retain the above copyright *
|
||||||
|
* notice, this list of conditions and the following disclaimer. *
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright *
|
||||||
|
* notice, this list of conditions and the following disclaimer in *
|
||||||
|
* the documentation and/or other materials provided with the *
|
||||||
|
* distribution. *
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be *
|
||||||
|
* used to endorse or promote products derived from this software *
|
||||||
|
* without specific prior written permission. *
|
||||||
|
* *
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS *
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED *
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN *
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE. *
|
||||||
|
* *
|
||||||
|
*************************************************************************/
|
||||||
|
|
@ -389,4 +389,5 @@
|
|||||||
* Moved all FAT related files from fs to fs/fat
|
* Moved all FAT related files from fs to fs/fat
|
||||||
* Implemented mkfatfs(), a non-standard API to create a FAT filesystem on a
|
* Implemented mkfatfs(), a non-standard API to create a FAT filesystem on a
|
||||||
block device (not yet tested).
|
block device (not yet tested).
|
||||||
|
* Added a test for mkfatfs() on a RAM disk in examples/mount
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<tr align="center" bgcolor="#e4e4e4">
|
<tr align="center" bgcolor="#e4e4e4">
|
||||||
<td>
|
<td>
|
||||||
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
|
||||||
<p>Last Updated: August 9, 2008</p>
|
<p>Last Updated: August 10, 2008</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -1038,6 +1038,7 @@ nuttx-0.3.12 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
|||||||
* Moved all FAT related files from fs to fs/fat
|
* Moved all FAT related files from fs to fs/fat
|
||||||
* Implemented mkfatfs(), a non-standard API to create a FAT filesystem on a
|
* Implemented mkfatfs(), a non-standard API to create a FAT filesystem on a
|
||||||
block device (not yet tested).
|
block device (not yet tested).
|
||||||
|
* Added a test for mkfatfs() on a RAM disk in examples/mount
|
||||||
|
|
||||||
pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
pascal-0.1.3 2008-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
|
||||||
|
@ -109,7 +109,22 @@ examples/mount
|
|||||||
This contains a simple test of filesystem mountpoints.
|
This contains a simple test of filesystem mountpoints.
|
||||||
|
|
||||||
* CONFIG_EXAMPLES_MOUNT_DEVNAME
|
* CONFIG_EXAMPLES_MOUNT_DEVNAME
|
||||||
The name of the device to mount. Default: "/dev/ram0"
|
The name of the user-provided block device to mount.
|
||||||
|
If CONFIG_EXAMPLES_MOUNT_DEVNAME is not provided, then
|
||||||
|
a RAM disk will be configured.
|
||||||
|
|
||||||
|
* CONFIG_EXAMPLES_MOUNT_NSECTORS
|
||||||
|
The number of "sectors" in the RAM disk used when
|
||||||
|
CONFIG_EXAMPLES_MOUNT_DEVNAME is not defined.
|
||||||
|
|
||||||
|
* CONFIG_EXAMPLES_MOUNT_SECTORSIZE
|
||||||
|
The size of each sectors in the RAM disk used when
|
||||||
|
CONFIG_EXAMPLES_MOUNT_DEVNAME is not defined.
|
||||||
|
|
||||||
|
* CONFIG_EXAMPLES_MOUNT_RAMDEVNO
|
||||||
|
The RAM device minor number used to mount the RAM disk used
|
||||||
|
when CONFIG_EXAMPLES_MOUNT_DEVNAME is not defined. The
|
||||||
|
default is zero (meaning that "/dev/ram0" will be used).
|
||||||
|
|
||||||
examples/null
|
examples/null
|
||||||
^^^^^^^^^^^^^
|
^^^^^^^^^^^^^
|
||||||
@ -144,6 +159,8 @@ examples/pashello
|
|||||||
examples/pipe
|
examples/pipe
|
||||||
^^^^^^^^^^^^^
|
^^^^^^^^^^^^^
|
||||||
|
|
||||||
A test of the mkfifo() and pipe() APIs.
|
A test of the mkfifo() and pipe() APIs.
|
||||||
|
|
||||||
|
|
||||||
|
* CONFIG_EXAMPLES_PIPE_STACKSIZE
|
||||||
|
Sets the size of the stack to use when creating the child tasks.
|
||||||
|
The default size is 1024.
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
ASRCS =
|
ASRCS =
|
||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
CSRCS = mount_main.c
|
CSRCS = mount_main.c ramdisk.c
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
|
92
examples/mount/mount.h
Normal file
92
examples/mount/mount.h
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* examples/mount/mount.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
* used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __EXAMPLES_MOUNT_MOUNT_H
|
||||||
|
#define __EXAMPLES_MOUNT_MOUNT_H
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* Configure the test */
|
||||||
|
|
||||||
|
#if defined(CONFIG_EXAMPLES_MOUNT_DEVNAME)
|
||||||
|
# undef CONFIG_EXAMPLES_MOUNT_NSECTORS
|
||||||
|
# undef CONFIG_EXAMPLES_MOUNT_SECTORSIZE
|
||||||
|
# undef CONFIG_EXAMPLES_MOUNT_RAMDEVNO
|
||||||
|
# define MOUNT_DEVNAME CONFIG_EXAMPLES_MOUNT_DEVNAME
|
||||||
|
#else
|
||||||
|
# if !defined(CONFIG_FS_FAT)
|
||||||
|
# error "CONFIG_FS_FAT required in this configuration"
|
||||||
|
# endif
|
||||||
|
# if !defined(CONFIG_EXAMPLES_MOUNT_SECTORSIZE)
|
||||||
|
# define CONFIG_EXAMPLES_MOUNT_SECTORSIZE 512
|
||||||
|
# endif
|
||||||
|
# if !defined(CONFIG_EXAMPLES_MOUNT_NSECTORS)
|
||||||
|
# define CONFIG_EXAMPLES_MOUNT_NSECTORS 2048
|
||||||
|
# endif
|
||||||
|
# if !defined(CONFIG_EXAMPLES_MOUNT_RAMDEVNO)
|
||||||
|
# define CONFIG_EXAMPLES_MOUNT_RAMDEVNO 0
|
||||||
|
# endif
|
||||||
|
# define MKMOUNT_DEVNAME(m) "/dev/ram" #m
|
||||||
|
# define MOUNT_DEVNAME MKMOUNT_DEVNAME(CONFIG_EXAMPLES_MOUNT_RAMDEVNO)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Types
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Variables
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
extern const char g_source[]; /* Mount 'source' path */
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Function Prototypes
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef CONFIG_EXAMPLES_MOUNT_DEVNAME
|
||||||
|
extern int create_ramdisk(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __EXAMPLES_MOUNT_MOUNT_H */
|
@ -50,14 +50,12 @@
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include "mount.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef CONFIG_EXAMPLES_MOUNT_DEVNAME
|
|
||||||
# define CONFIG_EXAMPLES_MOUNT_DEVNAME "/dev/ram0"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define TEST_USE_STAT 1
|
#define TEST_USE_STAT 1
|
||||||
#define TEST_SHOW_DIRECTORIES 1
|
#define TEST_SHOW_DIRECTORIES 1
|
||||||
#define TEST_USE_STATFS 1
|
#define TEST_USE_STATFS 1
|
||||||
@ -70,7 +68,6 @@
|
|||||||
* Private Data
|
* Private Data
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static const char g_source[] = CONFIG_EXAMPLES_MOUNT_DEVNAME;
|
|
||||||
static const char g_mntdir[] = "/mnt";
|
static const char g_mntdir[] = "/mnt";
|
||||||
static const char g_target[] = "/mnt/fs";
|
static const char g_target[] = "/mnt/fs";
|
||||||
static const char g_filesystemtype[] = "vfat";
|
static const char g_filesystemtype[] = "vfat";
|
||||||
@ -89,6 +86,12 @@ static int g_nerrors = 0;
|
|||||||
|
|
||||||
static char g_namebuffer[256];
|
static char g_namebuffer[256];
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
const char g_source[] = MOUNT_DEVNAME;
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -157,7 +160,7 @@ static void show_statfs(const char *path)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("show_statfs: ERROR statfs(%s) failed with errno=%d\n",
|
printf("show_statfs: ERROR statfs(%s) failed with errno=%d\n",
|
||||||
path, *get_errno_ptr());
|
path, errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -179,7 +182,8 @@ static void show_directories(const char *path, int indent)
|
|||||||
dirp = opendir(path);
|
dirp = opendir(path);
|
||||||
if ( !dirp )
|
if ( !dirp )
|
||||||
{
|
{
|
||||||
printf("show_directories: ERROR opendir(\"%s\") failed with errno=%d\n", path, *get_errno_ptr());
|
printf("show_directories: ERROR opendir(\"%s\") failed with errno=%d\n",
|
||||||
|
path, errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -228,10 +232,10 @@ static void fail_read_open(const char *path, int expectederror)
|
|||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
else if (*get_errno_ptr() != expectederror)
|
else if (errno != expectederror)
|
||||||
{
|
{
|
||||||
printf("fail_read_open: ERROR open(%s) failed with errno=%d (expected %d)\n",
|
printf("fail_read_open: ERROR open(%s) failed with errno=%d (expected %d)\n",
|
||||||
path, *get_errno_ptr(), expectederror);
|
path, errno, expectederror);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -254,7 +258,7 @@ static void read_test_file(const char *path)
|
|||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
printf("read_test_file: ERROR failed to open %s, errno=%d\n",
|
printf("read_test_file: ERROR failed to open %s, errno=%d\n",
|
||||||
path, *get_errno_ptr());
|
path, errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -264,7 +268,7 @@ static void read_test_file(const char *path)
|
|||||||
if (nbytes < 0)
|
if (nbytes < 0)
|
||||||
{
|
{
|
||||||
printf("read_test_file: ERROR failed to read from %s, errno=%d\n",
|
printf("read_test_file: ERROR failed to read from %s, errno=%d\n",
|
||||||
path, *get_errno_ptr());
|
path, errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -292,7 +296,7 @@ static void write_test_file(const char *path)
|
|||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
printf("write_test_file: ERROR failed to open %s for writing, errno=%d\n",
|
printf("write_test_file: ERROR failed to open %s for writing, errno=%d\n",
|
||||||
path, *get_errno_ptr());
|
path, errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -301,7 +305,7 @@ static void write_test_file(const char *path)
|
|||||||
if (nbytes < 0)
|
if (nbytes < 0)
|
||||||
{
|
{
|
||||||
printf("write_test_file: ERROR failed to write to %s, errno=%d\n",
|
printf("write_test_file: ERROR failed to write to %s, errno=%d\n",
|
||||||
path, *get_errno_ptr());
|
path, errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -330,10 +334,10 @@ static void fail_mkdir(const char *path, int expectederror)
|
|||||||
printf("fail_mkdir: ERROR mkdir(%s) succeeded\n", path);
|
printf("fail_mkdir: ERROR mkdir(%s) succeeded\n", path);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
else if (*get_errno_ptr() != expectederror)
|
else if (errno != expectederror)
|
||||||
{
|
{
|
||||||
printf("fail_mkdir: ERROR mkdir(%s) failed with errno=%d (expected %d)\n",
|
printf("fail_mkdir: ERROR mkdir(%s) failed with errno=%d (expected %d)\n",
|
||||||
path, *get_errno_ptr(), expectederror);
|
path, errno, expectederror);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -352,7 +356,7 @@ static void succeed_mkdir(const char *path)
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
printf("succeed_mkdir: ERROR mkdir(%s) failed with errno=%d\n",
|
printf("succeed_mkdir: ERROR mkdir(%s) failed with errno=%d\n",
|
||||||
path, *get_errno_ptr());
|
path, errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -375,10 +379,10 @@ static void fail_rmdir(const char *path, int expectederror)
|
|||||||
printf("fail_rmdir: ERROR rmdir(%s) succeeded\n", path);
|
printf("fail_rmdir: ERROR rmdir(%s) succeeded\n", path);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
else if (*get_errno_ptr() != expectederror)
|
else if (errno != expectederror)
|
||||||
{
|
{
|
||||||
printf("fail_rmdir: ERROR rmdir(%s) failed with errno=%d (expected %d)\n",
|
printf("fail_rmdir: ERROR rmdir(%s) failed with errno=%d (expected %d)\n",
|
||||||
path, *get_errno_ptr(), expectederror);
|
path, errno, expectederror);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -397,7 +401,7 @@ static void succeed_rmdir(const char *path)
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
printf("succeed_rmdir: ERROR rmdir(%s) failed with errno=%d\n",
|
printf("succeed_rmdir: ERROR rmdir(%s) failed with errno=%d\n",
|
||||||
path, *get_errno_ptr());
|
path, errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -420,10 +424,10 @@ static void fail_unlink(const char *path, int expectederror)
|
|||||||
printf("fail_unlink: ERROR unlink(%s) succeeded\n", path);
|
printf("fail_unlink: ERROR unlink(%s) succeeded\n", path);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
else if (*get_errno_ptr() != expectederror)
|
else if (errno != expectederror)
|
||||||
{
|
{
|
||||||
printf("fail_unlink: ERROR unlink(%s) failed with errno=%d (expected %d)\n",
|
printf("fail_unlink: ERROR unlink(%s) failed with errno=%d (expected %d)\n",
|
||||||
path, *get_errno_ptr(), expectederror);
|
path, errno, expectederror);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -444,7 +448,7 @@ static void succeed_unlink(const char *path)
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
printf("succeed_unlink: ERROR unlink(%s) failed with errno=%d\n",
|
printf("succeed_unlink: ERROR unlink(%s) failed with errno=%d\n",
|
||||||
path, *get_errno_ptr());
|
path, errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -468,10 +472,10 @@ static void fail_rename(const char *oldpath, const char *newpath, int expecteder
|
|||||||
oldpath, newpath);
|
oldpath, newpath);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
else if (*get_errno_ptr() != expectederror)
|
else if (errno != expectederror)
|
||||||
{
|
{
|
||||||
printf("fail_rename: ERROR rename(%s->%s) failed with errno=%d (expected %d)\n",
|
printf("fail_rename: ERROR rename(%s->%s) failed with errno=%d (expected %d)\n",
|
||||||
oldpath, newpath, *get_errno_ptr(), expectederror);
|
oldpath, newpath, errno, expectederror);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -490,7 +494,7 @@ static void succeed_rename(const char *oldpath, const char *newpath)
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
printf("succeed_rename: ERROR rename(%s->%s) failed with errno=%d\n",
|
printf("succeed_rename: ERROR rename(%s->%s) failed with errno=%d\n",
|
||||||
oldpath, newpath, *get_errno_ptr());
|
oldpath, newpath, errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -516,10 +520,10 @@ static void fail_stat(const char *path, int expectederror)
|
|||||||
show_stat(path, &buf);
|
show_stat(path, &buf);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
else if (*get_errno_ptr() != expectederror)
|
else if (errno != expectederror)
|
||||||
{
|
{
|
||||||
printf("fail_stat: ERROR stat(%s) failed with errno=%d (expected %d)\n",
|
printf("fail_stat: ERROR stat(%s) failed with errno=%d (expected %d)\n",
|
||||||
path, *get_errno_ptr(), expectederror);
|
path, errno, expectederror);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -543,7 +547,7 @@ static void succeed_stat(const char *path)
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
printf("succeed_stat: ERROR stat(%s) failed with errno=%d\n",
|
printf("succeed_stat: ERROR stat(%s) failed with errno=%d\n",
|
||||||
path, *get_errno_ptr());
|
path, errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -576,6 +580,16 @@ int user_start(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
#ifndef CONFIG_EXAMPLES_MOUNT_DEVNAME
|
||||||
|
/* Create a RAM disk for the test */
|
||||||
|
|
||||||
|
ret = create_ramdisk();
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
printf("user_start: ERROR failed to create RAM disk\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Mount the test file system (see arch/sim/src/up_deviceimage.c */
|
/* Mount the test file system (see arch/sim/src/up_deviceimage.c */
|
||||||
|
|
||||||
printf("user_start: mounting %s filesystem at target=%s with source=%s\n",
|
printf("user_start: mounting %s filesystem at target=%s with source=%s\n",
|
||||||
@ -722,7 +736,7 @@ int user_start(int argc, char *argv[])
|
|||||||
ret = umount(g_target);
|
ret = umount(g_target);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
{
|
{
|
||||||
printf("user_start: ERROR umount() failed, errno %d\n", *get_errno_ptr());
|
printf("user_start: ERROR umount() failed, errno %d\n", errno);
|
||||||
g_nerrors++;
|
g_nerrors++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
138
examples/mount/ramdisk.c
Normal file
138
examples/mount/ramdisk.c
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* examples/mount/ramdisk.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
* used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <debug.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <nuttx/ramdisk.h>
|
||||||
|
#include <nuttx/mkfatfs.h>
|
||||||
|
|
||||||
|
#include "mount.h"
|
||||||
|
|
||||||
|
#ifndef CONFIG_EXAMPLES_MOUNT_DEVNAME
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#define BUFFER_SIZE (CONFIG_EXAMPLES_MOUNT_NSECTORS*CONFIG_EXAMPLES_MOUNT_SECTORSIZE)
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Types
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Function Prototypes
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
static struct fat_format_s g_fmt = FAT_FORMAT_INITIALIZER;
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: create_ramdisk
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Create a RAM disk of the specified size formatting with a FAT file
|
||||||
|
* system
|
||||||
|
*
|
||||||
|
* Input Parameters:
|
||||||
|
* None
|
||||||
|
*
|
||||||
|
* Return:
|
||||||
|
* Zero on success, a negated errno on failure.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int create_ramdisk(void)
|
||||||
|
{
|
||||||
|
char *pbuffer;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
/* Allocate a buffer to hold the file system image. */
|
||||||
|
|
||||||
|
pbuffer = (char*)malloc(BUFFER_SIZE);
|
||||||
|
if (!pbuffer)
|
||||||
|
{
|
||||||
|
dbg("Failed to allocate ramdisk of size %d\n", BUFFER_SIZE);
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Register a RAMDISK device to manage this RAM image */
|
||||||
|
|
||||||
|
ret = rd_register(CONFIG_EXAMPLES_MOUNT_RAMDEVNO,
|
||||||
|
pbuffer,
|
||||||
|
CONFIG_EXAMPLES_MOUNT_NSECTORS,
|
||||||
|
CONFIG_EXAMPLES_MOUNT_NSECTORS,
|
||||||
|
TRUE);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
dbg("Failed to register ramdisk at %s\n", g_source);
|
||||||
|
free(pbuffer);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create a FAT filesystem on the ramdisk */
|
||||||
|
|
||||||
|
ret = mkfatfs(g_source, &g_fmt);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
dbg("Failed to create FAT filesystem on ramdisk at %s\n", g_source);
|
||||||
|
/* free(pbuffer); -- RAM disk is registered */
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif /* !CONFIG_EXAMPLES_MOUNT_DEVNAME */
|
@ -136,8 +136,13 @@ static inline uint32
|
|||||||
mkfatfs_nfatsect12(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
mkfatfs_nfatsect12(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
||||||
uint32 navailsects)
|
uint32 navailsects)
|
||||||
{
|
{
|
||||||
uint32 denom ;
|
#ifdef CONFIG_HAVE_LONG_LONG
|
||||||
|
uint64 denom;
|
||||||
|
uint64 numer;
|
||||||
|
#else
|
||||||
|
uint32 denom;
|
||||||
uint32 numer;
|
uint32 numer;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* For FAT12, the cluster number is held in a 12-bit number or 1.5 bytes per
|
/* For FAT12, the cluster number is held in a 12-bit number or 1.5 bytes per
|
||||||
* cluster reference. So each FAT sector will hold sectorsize/1.5 cluster
|
* cluster reference. So each FAT sector will hold sectorsize/1.5 cluster
|
||||||
@ -165,18 +170,24 @@ mkfatfs_nfatsect12(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
|||||||
* navailsects > 0x55555555 - 2 * clustersize
|
* navailsects > 0x55555555 - 2 * clustersize
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef CONFIG_HAVE_LONG_LONG
|
||||||
if (navailsects <= (0x55555555 - (1 << (fmt->ff_clustshift + 1))))
|
if (navailsects <= (0x55555555 - (1 << (fmt->ff_clustshift + 1))))
|
||||||
{
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
denom = (fmt->ff_nfats << 1) + fmt->ff_nfats
|
denom = (fmt->ff_nfats << 1) + fmt->ff_nfats
|
||||||
+ (var->fv_sectorsize << (fmt->ff_clustshift + 1));
|
+ (var->fv_sectorsize << (fmt->ff_clustshift + 1));
|
||||||
numer = (navailsects << 1) + navailsects
|
numer = (navailsects << 1) + navailsects
|
||||||
+ (1 << (fmt->ff_clustshift + 2)) + (1 << (fmt->ff_clustshift + 1));
|
+ (1 << (fmt->ff_clustshift + 2)) + (1 << (fmt->ff_clustshift + 1));
|
||||||
return (numer + denom - 1) / denom;
|
return (uint32)((numer + denom - 1) / denom);
|
||||||
|
|
||||||
|
#ifndef CONFIG_HAVE_LONG_LONG
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -202,8 +213,13 @@ static inline uint32
|
|||||||
mkfatfs_nfatsect16(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
mkfatfs_nfatsect16(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
||||||
uint32 navailsects)
|
uint32 navailsects)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_HAVE_LONG_LONG
|
||||||
|
uint64 denom;
|
||||||
|
uint64 numer;
|
||||||
|
#else
|
||||||
uint32 denom;
|
uint32 denom;
|
||||||
uint32 numer;
|
uint32 numer;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* For FAT16, the cluster number is held in a 16-bit number or 2 bytes per
|
/* For FAT16, the cluster number is held in a 16-bit number or 2 bytes per
|
||||||
* cluster reference. So each FAT sector will hold sectorsize/2 cluster
|
* cluster reference. So each FAT sector will hold sectorsize/2 cluster
|
||||||
@ -237,7 +253,7 @@ mkfatfs_nfatsect16(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
|||||||
denom = fmt->ff_nfats + (var->fv_sectorsize << (fmt->ff_clustshift - 1));
|
denom = fmt->ff_nfats + (var->fv_sectorsize << (fmt->ff_clustshift - 1));
|
||||||
numer = navailsects + (1 << (fmt->ff_clustshift + 1));
|
numer = navailsects + (1 << (fmt->ff_clustshift + 1));
|
||||||
}
|
}
|
||||||
return (numer + denom - 1) / denom;
|
return (uint32)((numer + denom - 1) / denom);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -263,8 +279,13 @@ static inline uint32
|
|||||||
mkfatfs_nfatsect32(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
mkfatfs_nfatsect32(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
||||||
uint32 navailsects)
|
uint32 navailsects)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_HAVE_LONG_LONG
|
||||||
|
uint64 denom;
|
||||||
|
uint64 numer;
|
||||||
|
#else
|
||||||
uint32 denom;
|
uint32 denom;
|
||||||
uint32 numer;
|
uint32 numer;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* For FAT32, the cluster number is held in a 32-bit number or 4 bytes per
|
/* For FAT32, the cluster number is held in a 32-bit number or 4 bytes per
|
||||||
* cluster reference. So each FAT sector will hold sectorsize/4 cluster
|
* cluster reference. So each FAT sector will hold sectorsize/4 cluster
|
||||||
@ -283,7 +304,7 @@ mkfatfs_nfatsect32(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
|||||||
* nfatsects = (navailsects + 3 * clustersize) /
|
* nfatsects = (navailsects + 3 * clustersize) /
|
||||||
* (nfats + sectorsize * clustersize / 4)
|
* (nfats + sectorsize * clustersize / 4)
|
||||||
*
|
*
|
||||||
* Overflow in the calculation of the numerator could occur if:
|
* Overflow in the 32-bit calculation of the numerator could occur if:
|
||||||
*
|
*
|
||||||
* navailsects > 0xffffffff - 3 * clustersize
|
* navailsects > 0xffffffff - 3 * clustersize
|
||||||
*/
|
*/
|
||||||
@ -303,7 +324,7 @@ mkfatfs_nfatsect32(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
|
|||||||
denom = fmt->ff_nfats + (var->fv_sectorsize << (fmt->ff_clustshift - 2));
|
denom = fmt->ff_nfats + (var->fv_sectorsize << (fmt->ff_clustshift - 2));
|
||||||
numer = navailsects + (1 << (fmt->ff_clustshift + 1)) + (1 << fmt->ff_clustshift);
|
numer = navailsects + (1 << (fmt->ff_clustshift + 1)) + (1 << fmt->ff_clustshift);
|
||||||
}
|
}
|
||||||
return (numer + denom - 1) / denom;
|
return (uint32)((numer + denom - 1) / denom);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -885,7 +906,7 @@ int mkfatfs_configfatfs(FAR struct fat_format_s *fmt,
|
|||||||
|
|
||||||
if (fmt->ff_backupboot <= 1 || fmt->ff_backupboot >= fmt->ff_rsvdseccount)
|
if (fmt->ff_backupboot <= 1 || fmt->ff_backupboot >= fmt->ff_rsvdseccount)
|
||||||
{
|
{
|
||||||
fdbg("Invalid backup boot sector: %d\n", fmt->ff_backupboot)
|
fdbg("Invalid backup boot sector: %d\n", fmt->ff_backupboot);
|
||||||
fmt->ff_backupboot = 0;
|
fmt->ff_backupboot = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -922,7 +943,7 @@ int mkfatfs_configfatfs(FAR struct fat_format_s *fmt,
|
|||||||
fdbg("Sector size: %d bytes\n", var->fv_sectorsize);
|
fdbg("Sector size: %d bytes\n", var->fv_sectorsize);
|
||||||
fdbg("Number of sectors: %d sectors\n", fmt->ff_nsectors);
|
fdbg("Number of sectors: %d sectors\n", fmt->ff_nsectors);
|
||||||
fdbg("FAT size: %d bits\n", var->fv_fattype);
|
fdbg("FAT size: %d bits\n", var->fv_fattype);
|
||||||
fdbg("Number FATs: %d\n", fmt->ff_fats);
|
fdbg("Number FATs: %d\n", fmt->ff_nfats);
|
||||||
fdbg("Sectors per cluster: %d sectors\n", 1 << fmt->ff_clustshift);
|
fdbg("Sectors per cluster: %d sectors\n", 1 << fmt->ff_clustshift);
|
||||||
fdbg("FS size: %d sectors\n", var->fv_nfatsects);
|
fdbg("FS size: %d sectors\n", var->fv_nfatsects);
|
||||||
fdbg(" %d clusters\n", var->fv_nclusters);
|
fdbg(" %d clusters\n", var->fv_nclusters);
|
||||||
|
@ -104,7 +104,7 @@ static inline int mkfatfs_getgeometry(FAR struct fat_format_s *fmt,
|
|||||||
if (fmt->ff_nsectors > geometry.geo_nsectors)
|
if (fmt->ff_nsectors > geometry.geo_nsectors)
|
||||||
{
|
{
|
||||||
fdbg("User maxblocks (%d) exceeds blocks on device (%d)\n",
|
fdbg("User maxblocks (%d) exceeds blocks on device (%d)\n",
|
||||||
mt->ff_maxblocks, geometry.geo_nsectors);
|
fmt->ff_nsectors, geometry.geo_nsectors);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -197,7 +197,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt)
|
|||||||
|
|
||||||
if (fmt->ff_nfats < 1 || fmt->ff_nfats > 4)
|
if (fmt->ff_nfats < 1 || fmt->ff_nfats > 4)
|
||||||
{
|
{
|
||||||
fdbg("Invalid number of fats: %d\n", fmt->ff_fats);
|
fdbg("Invalid number of fats: %d\n", fmt->ff_nfats);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ int close_blockdriver(FAR struct inode *inode)
|
|||||||
|
|
||||||
if (!INODE_IS_BLOCK(inode))
|
if (!INODE_IS_BLOCK(inode))
|
||||||
{
|
{
|
||||||
fdbg("%s is not a block driver\n", pathname);
|
fdbg("inode is not a block driver\n");
|
||||||
ret = -ENOTBLK;
|
ret = -ENOTBLK;
|
||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
* Definitions
|
* Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#define MKFATFS_DEFAULT_BBCHECK FALSE /* FALSE: No bad block check */
|
|
||||||
#define MKFATFS_DEFAULT_NFATS 2 /* 2: Default number of FATs */
|
#define MKFATFS_DEFAULT_NFATS 2 /* 2: Default number of FATs */
|
||||||
#define MKFATFS_DEFAULT_FATTYPE 0xff /* 0: Autoselect FAT size */
|
#define MKFATFS_DEFAULT_FATTYPE 0xff /* 0: Autoselect FAT size */
|
||||||
#define MKFATFS_DEFAULT_CLUSTSIZE 0 /* 0: Autoselect cluster size */
|
#define MKFATFS_DEFAULT_CLUSTSIZE 0 /* 0: Autoselect cluster size */
|
||||||
@ -57,12 +56,11 @@
|
|||||||
#define MKFATFS_DEFAULT_RSVDSECCOUNT 0 /* 0: Autoselect number reserved sectors (usually 32) */
|
#define MKFATFS_DEFAULT_RSVDSECCOUNT 0 /* 0: Autoselect number reserved sectors (usually 32) */
|
||||||
#define MKFATFS_DEFAULT_HIDSEC 0 /* No hidden sectors */
|
#define MKFATFS_DEFAULT_HIDSEC 0 /* No hidden sectors */
|
||||||
#define MKFATFS_DEFAULT_VOLUMEID 0 /* No volume ID */
|
#define MKFATFS_DEFAULT_VOLUMEID 0 /* No volume ID */
|
||||||
#define MKFATFS_DEFAULT_MAXBLOCKS 0 /* 0: Use all blocks on device */
|
#define MKFATFS_DEFAULT_NSECTORS 0 /* 0: Use all sectors on device */
|
||||||
|
|
||||||
#define FAT_FORMAT_INITIALIZER \
|
#define FAT_FORMAT_INITIALIZER \
|
||||||
{ \
|
{ \
|
||||||
MKFATFS_DEFAULT_BBCHECK, \
|
MKFATFS_DEFAULT_NFATS, \
|
||||||
MKFATFS_DEFAULT_NFAT, \
|
|
||||||
MKFATFS_DEFAULT_FATTYPE, \
|
MKFATFS_DEFAULT_FATTYPE, \
|
||||||
MKFATFS_DEFAULT_CLUSTSIZE, \
|
MKFATFS_DEFAULT_CLUSTSIZE, \
|
||||||
MKFATFS_DEFAULT_VOLUMELABEL, \
|
MKFATFS_DEFAULT_VOLUMELABEL, \
|
||||||
@ -71,7 +69,7 @@
|
|||||||
MKFATFS_DEFAULT_RSVDSECCOUNT, \
|
MKFATFS_DEFAULT_RSVDSECCOUNT, \
|
||||||
MKFATFS_DEFAULT_HIDSEC, \
|
MKFATFS_DEFAULT_HIDSEC, \
|
||||||
MKFATFS_DEFAULT_VOLUMEID, \
|
MKFATFS_DEFAULT_VOLUMEID, \
|
||||||
MKFATFS_DEFAULT_MAXBLOCKS \
|
MKFATFS_DEFAULT_NSECTORS \
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user