diff options
author | Daniel Hellstrom <daniel@gaisler.com> | 2013-03-19 13:29:58 +0100 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2013-03-19 13:29:58 +0100 |
commit | 0e0c086ee95d95fa7e2edf56f313758a892e1cac (patch) | |
tree | b4f2de0d2b2587e59259d12eaeb54cc19629f169 /cpukit/libfs/src/rfs/rtems-rfs-rtems.c | |
parent | 944f85f0e00877ca946efda9cd1767c4ce2c449b (diff) | |
parent | 0ae9ee1da48d7deab49e42aa789ba02de8501047 (diff) |
Merge official 4.10.2 sources into rcc-1.2 branchrcc-v1.2.9
Diffstat (limited to 'cpukit/libfs/src/rfs/rtems-rfs-rtems.c')
-rw-r--r-- | cpukit/libfs/src/rfs/rtems-rfs-rtems.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c index ac9ae4abdd..26b57ff062 100644 --- a/cpukit/libfs/src/rfs/rtems-rfs-rtems.c +++ b/cpukit/libfs/src/rfs/rtems-rfs-rtems.c @@ -1268,8 +1268,40 @@ rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry, { rtems_rfs_rtems_private* rtems; rtems_rfs_file_system* fs; + uint32_t flags = 0; + uint32_t max_held_buffers = RTEMS_RFS_FS_MAX_HELD_BUFFERS; + const char* options = data; int rc; + /* + * Parse the options the user specifiies. + */ + while (options) + { + printf ("options=%s\n", options); + if (strncmp (options, "hold-bitmaps", + sizeof ("hold-bitmaps") - 1) == 0) + flags |= RTEMS_RFS_FS_BITMAPS_HOLD; + else if (strncmp (options, "no-local-cache", + sizeof ("no-local-cache") - 1) == 0) + flags |= RTEMS_RFS_FS_NO_LOCAL_CACHE; + else if (strncmp (options, "max-held-bufs", + sizeof ("max-held-bufs") - 1) == 0) + { + max_held_buffers = strtoul (options + sizeof ("max-held-bufs"), 0, 0); + } + else + return rtems_rfs_rtems_error ("initialise: invalid option", EINVAL); + + options = strchr (options, ','); + if (options) + { + ++options; + if (*options == '\0') + options = NULL; + } + } + rtems = malloc (sizeof (rtems_rfs_rtems_private)); if (!rtems) return rtems_rfs_rtems_error ("initialise: local data", ENOMEM); @@ -1291,7 +1323,7 @@ rtems_rfs_rtems_initialise (rtems_filesystem_mount_table_entry_t* mt_entry, return rtems_rfs_rtems_error ("initialise: cannot lock access mutex", rc); } - rc = rtems_rfs_fs_open (mt_entry->dev, rtems, 0, &fs); + rc = rtems_rfs_fs_open (mt_entry->dev, rtems, flags, max_held_buffers, &fs); if (rc) { free (rtems); |