Changeset d869c182 in rtems


Ignore:
Timestamp:
10/10/17 23:32:41 (6 years ago)
Author:
Fan Deng <enetor@…>
Branches:
5, master
Children:
9e8df1fe
Parents:
64908df
git-author:
Fan Deng <enetor@…> (10/10/17 23:32:41)
git-committer:
Chris Johns <chrisj@…> (04/11/18 01:51:57)
Message:

Fill in the correct d_off in rtems_rfs_dir_read.

rtems_rfs_dir_read searches the directory inode's entries list starting
at the specified offset until an empty entry (last entry) is encountered. It
fills in a struct dirent with the name of the entry, length of the name, ino of
the entry, and the absolute offset of the entry in the parent directory's
entries
list.

Unfortunately, the stock implementation of rtems_rfs_dir_read returns a
somewhat arbitrary offset (as dirent::d_off), while
rtems_rfs_dir_lookup_ino always returns the correct offset.

This change fixes that logic so the returned offset is accurate.

Tested by comparing the offset returned in dirent with the result of
rtems_rfs_dir_lookup_ino.

File:
1 edited

Legend:

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

    r64908df rd869c182  
    603603
    604604      memset (dirent, 0, sizeof (struct dirent));
    605       dirent->d_off = offset;
     605      dirent->d_off = rtems_rfs_block_get_pos (fs, &map.bpos);
    606606      dirent->d_reclen = sizeof (struct dirent);
    607607
Note: See TracChangeset for help on using the changeset viewer.