Changeset 9b48dc6 in rtems


Ignore:
Timestamp:
Dec 18, 2013, 5:37:47 PM (5 years ago)
Author:
Alan Cudmore <alan.cudmore@…>
Branches:
4.11, master
Children:
a9619f3c
Parents:
e60b7b1
git-author:
Alan Cudmore <alan.cudmore@…> (12/18/13 17:37:47)
git-committer:
Chris Johns <chrisj@…> (12/19/13 00:07:41)
Message:

For PR 2162 - RFS File System - statvfs reports 1 block free

This is for the RFS file system. The statvfs call reports 1 block free
when the file system is full because it does not account for the superblock
in its calculation of free blocks.
This is a simple fix that adjusts the number of blocks reported to account
for the superblock. We may want to wait for a more complete solution such
as locating the superblock in each group.

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

Legend:

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

    re60b7b1 r9b48dc6  
    754754  sb->f_frsize  = rtems_rfs_fs_media_block_size (fs);
    755755  sb->f_blocks  = rtems_rfs_fs_media_blocks (fs);
    756   sb->f_bfree   = rtems_rfs_fs_blocks (fs) - blocks;
     756  sb->f_bfree   = rtems_rfs_fs_blocks (fs) - blocks - 1; /* do not count the superblock */
    757757  sb->f_bavail  = sb->f_bfree;
    758758  sb->f_files   = rtems_rfs_fs_inodes (fs);
  • cpukit/libfs/src/rfs/rtems-rfs-shell.c

    re60b7b1 r9b48dc6  
    150150  rtems_rfs_shell_unlock_rfs (fs);
    151151
    152   bpcent = (blocks * 1000) / rtems_rfs_fs_blocks (fs);
     152  bpcent = (blocks * 1000) / (rtems_rfs_fs_blocks (fs) - 1);
    153153  ipcent = (inodes * 1000) / rtems_rfs_fs_inodes (fs);
    154154
Note: See TracChangeset for help on using the changeset viewer.