Changeset 97ae192a in rtems


Ignore:
Timestamp:
Nov 3, 2011, 6:32:42 AM (8 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11, master
Children:
6167a5b
Parents:
b009f481
Message:

2011-11-03 Chris Johns <chrisj@…>

PR 1948/filesystem

  • libfs/src/rfs/rtems-rfs-file-system.c, libfs/src/rfs/rtems-rfs-file-system.h, libfs/src/rfs/rtems-rfs-format.c, libfs/src/rfs/rtems-rfs-rtems.c: Add support for mount passing an ASCIIZ string containing configuration options. Remove the hardcoded dir string and size. Fix comments.
  • libblock/src/bdbuf.c: Fix state labels in trace output.
Location:
cpukit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/src/bdbuf.c

    rb009f481 r97ae192a  
    291291{
    292292  const char* states[] =
    293     { "EM", "FR", "CH", "AC", "AM", "MD", "SY", "TR" };
     293    { "FR", "EM", "CH", "AC", "AM", "MD", "SY", "TR" };
    294294
    295295  printf ("bdbuf:users: %15s: [%" PRIu32 " (%s)] %td:%td = %" PRIu32 " %s\n",
  • cpukit/libfs/src/rfs/rtems-rfs-file-system.c

    rb009f481 r97ae192a  
    197197                   void*                   user,
    198198                   uint32_t                flags,
     199                   uint32_t                max_held_buffers,
    199200                   rtems_rfs_file_system** fs)
    200201{
     
    227228  rtems_chain_initialize_empty (&(*fs)->file_shares);
    228229
    229   (*fs)->max_held_buffers = RTEMS_RFS_FS_MAX_HELD_BUFFERS;
     230  (*fs)->max_held_buffers = max_held_buffers;
    230231  (*fs)->buffers_count = 0;
    231232  (*fs)->release_count = 0;
  • cpukit/libfs/src/rfs/rtems-rfs-file-system.h

    rb009f481 r97ae192a  
    385385 * @param fs The file system data filled in by this call.
    386386 * @param user A pointer to user data.
     387 * @param flags The initial set of user flags for the file system.
     388 * @param max_held_buffers The maximum number of buffers the RFS holds.
    387389 * @return int The error number (errno). No error if 0.
    388390 */
     
    390392                       void*                   user,
    391393                       uint32_t                flags,
     394                       uint32_t                max_held_buffers,
    392395                       rtems_rfs_file_system** fs);
    393396
  • cpukit/libfs/src/rfs/rtems-rfs-format.c

    rb009f481 r97ae192a  
    466466   * External API so returns -1.
    467467   */
    468   rc = rtems_rfs_fs_open (name, NULL, RTEMS_RFS_FS_FORCE_OPEN, &fs);
     468  rc = rtems_rfs_fs_open (name, NULL,
     469                          RTEMS_RFS_FS_FORCE_OPEN | RTEMS_RFS_FS_NO_LOCAL_CACHE,
     470                          0, &fs);
    469471  if (rc < 0)
    470472  {
  • cpukit/libfs/src/rfs/rtems-rfs-rtems.c

    rb009f481 r97ae192a  
    107107   
    108108    /*
    109      * Is this the end of the pathname we where given ?
     109     * Is this the end of the pathname we were given ?
    110110     */
    111111    if ((*path == '\0') || (pathlen == 0))
     
    138138
    139139    /*
    140      * Eat any separators at start of the path.
     140     * Eat any separators at the start of the path.
    141141     */
    142142    stripped = rtems_filesystem_prefix_separators (path, pathlen);
     
    147147    /*
    148148     * If the node is the current directory and there is more path to come move
    149      * on it else we are at the inode we want.
     149     * on to it otherwise we are at the inode we want.
    150150     */
    151151    if (rtems_rfs_current_dir (node))
     
    167167    {
    168168      /*
    169        * If we are at root inode of the file system we have a crossmount path.
     169       * If we are at the root inode of the file system we have a crossmount
     170       * path.
    170171       */
    171172      if (ino == RTEMS_RFS_ROOT_INO)
     
    184185       * We need to find the parent of this node.
    185186       */
    186       rc = rtems_rfs_dir_lookup_ino (fs, &inode, "..", 2, &ino, &doff);
     187      rc = rtems_rfs_dir_lookup_ino (fs, &inode,
     188                                     RTEMS_RFS_PARENT_DIR_STR,
     189                                     RTEMS_RFS_PARENT_DIR_SIZE, &ino, &doff);
    187190      if (rc > 0)
    188191      {
     
    309312   
    310313    /*
    311      * Is this the end of the pathname we where given ?
     314     * Is this the end of the pathname we were given ?
    312315     */
    313316    if (path == *name)
     
    336339    /*
    337340     * If the node is the current directory and there is more path to come move
    338      * on it else we are at the inode we want.
     341     * on to it otherwise we are at the inode we want.
    339342     */
    340343    if (rtems_rfs_current_dir (node))
     
    385388       * We need to find the parent of this node.
    386389       */
    387       rc = rtems_rfs_dir_lookup_ino (fs, &inode, "..", 2, &ino, &doff);
     390      rc = rtems_rfs_dir_lookup_ino (fs, &inode,
     391                                     RTEMS_RFS_PARENT_DIR_STR,
     392                                     RTEMS_RFS_PARENT_DIR_SIZE, &ino, &doff);
    388393      if (rc > 0)
    389394      {
     
    12251230  rtems_rfs_rtems_private* rtems;
    12261231  rtems_rfs_file_system*   fs;
     1232  uint32_t                 flags = 0;
     1233  uint32_t                 max_held_buffers = RTEMS_RFS_FS_MAX_HELD_BUFFERS;
     1234  const char*              options = data;
    12271235  int                      rc;
    12281236
     1237  /*
     1238   * Parse the options the user specifiies.
     1239   */
     1240  while (options)
     1241  {
     1242    printf ("options=%s\n", options);
     1243    if (strncmp (options, "hold-bitmaps",
     1244                 sizeof ("hold-bitmaps") - 1) == 0)
     1245      flags |= RTEMS_RFS_FS_BITMAPS_HOLD;
     1246    else if (strncmp (options, "no-local-cache",
     1247                      sizeof ("no-local-cache") - 1) == 0)
     1248      flags |= RTEMS_RFS_FS_NO_LOCAL_CACHE;
     1249    else if (strncmp (options, "max-held-bufs",
     1250                      sizeof ("max-held-bufs") - 1) == 0)
     1251    {
     1252      max_held_buffers = strtoul (options + sizeof ("max-held-bufs"), 0, 0);
     1253    }
     1254    else
     1255      return rtems_rfs_rtems_error ("initialise: invalid option", EINVAL);
     1256
     1257    options = strchr (options, ',');
     1258    if (options)
     1259    {
     1260      ++options;
     1261      if (*options == '\0')
     1262        options = NULL;
     1263    }
     1264  }
     1265 
    12291266  rtems = malloc (sizeof (rtems_rfs_rtems_private));
    12301267  if (!rtems)
     
    12481285  }
    12491286 
    1250   rc = rtems_rfs_fs_open (mt_entry->dev, rtems, 0, &fs);
     1287  rc = rtems_rfs_fs_open (mt_entry->dev, rtems, flags, max_held_buffers, &fs);
    12511288  if (rc)
    12521289  {
Note: See TracChangeset for help on using the changeset viewer.