Changeset 5d2ae6e2 in rtems


Ignore:
Timestamp:
Apr 25, 2014, 7:30:37 AM (5 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11, master
Children:
e306f3df
Parents:
c9a0a10
Message:

libfs/rfs: Fix the fstime failures for the RFS file system.

Location:
cpukit/libfs/src/rfs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/rfs/rtems-rfs-file.c

    rc9a0a10 r5d2ae6e2  
    353353
    354354  length = false;
    355   mtime = false;
     355  mtime = !read;
    356356
    357357  if (!read &&
     
    362362                                         handle->bpos.boff);
    363363    length = true;
    364     mtime = true;
    365364  }
    366365
     
    426425  {
    427426    rtems_rfs_file_set_bpos (handle, pos);
    428    
     427
    429428    /*
    430429     * If the file has a block check if it maps to the current position and it
     
    436435      rtems_rfs_buffer_block block;
    437436      int                    rc;
    438      
     437
    439438      rc = rtems_rfs_block_map_find (rtems_rfs_file_fs (handle),
    440439                                     rtems_rfs_file_map (handle),
     
    444443        return rc;
    445444      if (rtems_rfs_buffer_bnum (&handle->buffer) != block)
    446       {       
     445      {
    447446        rc = rtems_rfs_buffer_handle_release (rtems_rfs_file_fs (handle),
    448447                                              rtems_rfs_file_buffer (handle));
     
    462461      return rc;
    463462  }
    464  
     463
    465464  *new_pos = pos;
    466465  return 0;
     
    479478
    480479  size = rtems_rfs_file_size (handle);
    481  
     480
    482481  /*
    483482   * If the file is same size do nothing else grow or shrink it ?
     
    609608    handle->shared->size.count  = rtems_rfs_block_map_count (map);
    610609    handle->shared->size.offset = rtems_rfs_block_map_size_offset (map);
    611 
    612     if (rtems_rfs_file_update_mtime (handle))
    613       handle->shared->mtime = time (NULL);
    614   }
    615  
     610  }
     611
     612  if (rtems_rfs_file_update_mtime (handle))
     613    handle->shared->mtime = time (NULL);
     614
    616615  return 0;
    617616}
  • cpukit/libfs/src/rfs/rtems-rfs-inode.c

    rc9a0a10 r5d2ae6e2  
    44 * @brief RTEMS File Systems Inode Routines
    55 * @ingroup rtems_rfs
    6  * 
     6 *
    77 * These functions manage inodes in the RFS file system. An inode is part of a
    88 * block that reside after the bitmaps in the group.
     
    286286    rtems_rfs_inode_set_links (&parent_inode,
    287287                               rtems_rfs_inode_get_links (&parent_inode) + 1);
     288
     289  /*
     290   * Update the parent's mtime.
     291   */
     292  rc = rtems_rfs_inode_time_stamp_now (&parent_inode, true, true);
     293  if (rc > 0)
     294  {
     295    rtems_rfs_inode_delete (fs, &inode);
     296    rtems_rfs_inode_close (fs, &inode);
     297    return rc;
     298  }
    288299
    289300  rc = rtems_rfs_inode_close (fs, &parent_inode);
Note: See TracChangeset for help on using the changeset viewer.