Changeset 54cad05 in rtems


Ignore:
Timestamp:
Jun 15, 2010, 11:35:05 PM (9 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10
Children:
64b287e3
Parents:
f5d125e
Message:

2010-06-15 Ralf Corsépius <ralf.corsepius@…>

  • libfs/src/rfs/rtems-rfs-dir.c: Various 64bit compatibility fixes. Add PRIdoff_t. Remove stray "\"s.
  • libfs/src/rfs/rtems-rfs-link.c: Various 64bit compatibility fixes.
Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rf5d125e r54cad05  
     12010-06-15      Ralf Corsépius <ralf.corsepius@rtems.org>
     2
     3        * libfs/src/rfs/rtems-rfs-dir.c: Various 64bit compatibility fixes.
     4        Add PRIdoff_t.
     5        Remove stray "\"s.
     6        * libfs/src/rfs/rtems-rfs-link.c: Various 64bit compatibility fixes.
     7
    182010-06-15      Ralf Corsépius <ralf.corsepius@rtems.org>
    29
  • cpukit/libfs/src/rfs/rtems-rfs-dir.c

    rf5d125e r54cad05  
    3030#endif
    3131
     32#include <inttypes.h>
     33
     34#if SIZEOF_OFF_T == 8
     35#define PRIdoff_t PRIo64
     36#elif SIZEOF_OFF_T == 4
     37#define PRIdoff_t PRIo32
     38#else
     39#error "unsupported size of off_t"
     40#endif
     41
    3242#include <rtems/rfs/rtems-rfs-block.h>
    3343#include <rtems/rfs/rtems-rfs-buffer.h>
     
    5969  {
    6070    int c;
    61     printf ("rtems-rfs: dir-lookup-ino: lookup ino: root=%ld, path=",
     71    printf ("rtems-rfs: dir-lookup-ino: lookup ino: root=%" PRId32 ", path=",
    6272            inode->ino);
    6373    for (c = 0; c < length; c++)
     
    7383  {
    7484    if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
    75       printf ("rtems-rfs: dir-lookup-ino: map open failed for ino %lu: %d: %s",
     85      printf ("rtems-rfs: dir-lookup-ino: map open failed for ino %" PRIu32 ": %d: %s",
    7686              rtems_rfs_inode_ino (inode), rc, strerror (rc));
    7787    return rc;
     
    8292  {
    8393    if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
    84       printf ("rtems-rfs: dir-lookup-ino: handle open failed for ino %lu: %d: %s",
     94      printf ("rtems-rfs: dir-lookup-ino: handle open failed for ino %" PRIu32 ": %d: %s",
    8595              rtems_rfs_inode_ino (inode), rc, strerror (rc));
    8696    rtems_rfs_block_map_close (fs, &map);
     
    122132      {
    123133        if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
    124           printf ("rtems-rfs: dir-lookup-ino: block read, ino=%lu block=%ld: %d: %s\n",
     134          printf ("rtems-rfs: dir-lookup-ino: block read, ino=%" PRIu32 " block=%" PRId32 ": %d: %s\n",
    125135                  rtems_rfs_inode_ino (inode), block, rc, strerror (rc));
    126136        break;
     
    151161        {
    152162          if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
    153             printf ("rtems-rfs: dir-lookup-ino: " \
    154                     "bad length or ino for ino %lu: %u/%ld @ %04lx\n",
     163            printf ("rtems-rfs: dir-lookup-ino: "
     164                    "bad length or ino for ino %" PRIu32 ": %u/%" PRId32 " @ %04" PRIx32 "\n",
    155165                    rtems_rfs_inode_ino (inode), elength, *ino, map.bpos.boff);
    156166          rc = EIO;
     
    161171        {
    162172          if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_CHECK))
    163             printf ("rtems-rfs: dir-lookup-ino: " \
    164                     "checking entry for ino %ld: off=%04lx length:%d ino:%ld\n",
     173            printf ("rtems-rfs: dir-lookup-ino: "
     174                    "checking entry for ino %" PRId32 ": off=%04" PRIx32 " length:%d ino:%" PRId32 "\n",
    165175                    rtems_rfs_inode_ino (inode), map.bpos.boff,
    166176                    elength, rtems_rfs_dir_entry_ino (entry));
     
    171181           
    172182            if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO_FOUND))
    173               printf ("rtems-rfs: dir-lookup-ino: " \
    174                       "entry found in ino %lu, ino=%lu offset=%lu\n",
     183              printf ("rtems-rfs: dir-lookup-ino: "
     184                      "entry found in ino %" PRIu32 ", ino=%" PRIu32 " offset=%" PRIu32 "\n",
    175185                      rtems_rfs_inode_ino (inode), *ino, *offset);
    176186
     
    191201        {
    192202          if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
    193             printf ("rtems-rfs: dir-lookup-ino: " \
    194                     "block map next block failed in ino %lu: %d: %s\n",
     203            printf ("rtems-rfs: dir-lookup-ino: "
     204                    "block map next block failed in ino %" PRIu32 ": %d: %s\n",
    195205                    rtems_rfs_inode_ino (inode), rc, strerror (rc));
    196206        }
     
    204214      rc = EIO;
    205215      if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_LOOKUP_INO))
    206         printf ("rtems-rfs: dir-lookup-ino: block is 0 in ino %lu: %d: %s\n",
     216        printf ("rtems-rfs: dir-lookup-ino: block is 0 in ino %" PRIu32 ": %d: %s\n",
    207217                rtems_rfs_inode_ino (inode), rc, strerror (rc));
    208218    }
     
    229239  {
    230240    int c;
    231     printf ("rtems-rfs: dir-add-entry: dir=%ld, name=",
     241    printf ("rtems-rfs: dir-add-entry: dir=%" PRId32 ", name=",
    232242            rtems_rfs_inode_ino (dir));
    233243    for (c = 0; c < length; c++)
     
    270280      {
    271281        if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
    272           printf ("rtems-rfs: dir-add-entry: " \
    273                   "block map find failed for ino %lu: %d: %s\n",
     282          printf ("rtems-rfs: dir-add-entry: "
     283                  "block map find failed for ino %" PRIu32 ": %d: %s\n",
    274284                  rtems_rfs_inode_ino (dir), rc, strerror (rc));
    275285        break;
     
    283293      {
    284294        if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
    285           printf ("rtems-rfs: dir-add-entry: " \
    286                   "block map grow failed for ino %lu: %d: %s\n",
     295          printf ("rtems-rfs: dir-add-entry: "
     296                  "block map grow failed for ino %" PRIu32 ": %d: %s\n",
    287297                  rtems_rfs_inode_ino (dir), rc, strerror (rc));
    288298        break;
     
    298308    {
    299309      if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
    300         printf ("rtems-rfs: dir-add-entry: " \
    301                 "block buffer req failed for ino %lu: %d: %s\n",
     310        printf ("rtems-rfs: dir-add-entry: "
     311                "block buffer req failed for ino %" PRIu32 ": %d: %s\n",
    302312                rtems_rfs_inode_ino (dir), rc, strerror (rc));
    303313      break;
     
    343353      {
    344354        if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_ADD_ENTRY))
    345           printf ("rtems-rfs: dir-add-entry: " \
    346                   "bad length or ino for ino %lu: %u/%ld @ %04x\n",
     355          printf ("rtems-rfs: dir-add-entry: "
     356                  "bad length or ino for ino %" PRIu32 ": %u/%" PRId32 " @ %04x\n",
    347357                  rtems_rfs_inode_ino (dir), elength, eino, offset);
    348358        rtems_rfs_buffer_handle_close (fs, &buffer);
     
    374384
    375385  if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
    376     printf ("rtems-rfs: dir-del-entry: dir=%ld, entry=%ld offset=%lu\n",
     386    printf ("rtems-rfs: dir-del-entry: dir=%" PRId32 ", entry=%" PRId32 " offset=%" PRIu32 "\n",
    377387            rtems_rfs_inode_ino (dir), ino, offset);
    378        
     388
    379389  rc = rtems_rfs_block_map_open (fs, dir, &map);
    380390  if (rc > 0)
     
    411421    {
    412422      if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
    413         printf ("rtems-rfs: dir-del-entry: " \
    414                 "block buffer req failed for ino %lu: %d: %s\n",
     423        printf ("rtems-rfs: dir-del-entry: "
     424                "block buffer req failed for ino %" PRIu32 ": %d: %s\n",
    415425                rtems_rfs_inode_ino (dir), rc, strerror (rc));
    416426      break;
     
    434444      {
    435445        if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
    436           printf ("rtems-rfs: dir-del-entry: " \
    437                   "bad length or ino for ino %lu: %u/%ld @ %04x\n",
     446          printf ("rtems-rfs: dir-del-entry: "
     447                  "bad length or ino for ino %" PRIu32 ": %u/%" PRId32 " @ %04x\n",
    438448                  rtems_rfs_inode_ino (dir), elength, eino, offset);
    439449        rc = EIO;
    440450        break;
    441451      }
    442        
     452
    443453      if (ino == rtems_rfs_dir_entry_ino (entry))
    444454      {
     
    458468
    459469        if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
    460           printf ("rtems-rfs: dir-del-entry: " \
    461                   "last block free for ino %lu: elength=%i offset=%d last=%s\n",
     470          printf ("rtems-rfs: dir-del-entry: "
     471                  "last block free for ino %" PRIu32 ": elength=%i offset=%d last=%s\n",
    462472                  ino, elength, offset,
    463473                  rtems_rfs_block_map_last (&map) ? "yes" : "no");
     
    470480          {
    471481            if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_DEL_ENTRY))
    472               printf ("rtems-rfs: dir-del-entry: " \
    473                       "block map shrink failed for ino %lu: %d: %s\n",
     482              printf ("rtems-rfs: dir-del-entry: "
     483                      "block map shrink failed for ino %" PRIu32 ": %d: %s\n",
    474484                      rtems_rfs_inode_ino (dir), rc, strerror (rc));
    475485          }
     
    518528
    519529  if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
    520     printf ("rtems-rfs: dir-read: dir=%ld offset=%Ld\n",
     530    printf ("rtems-rfs: dir-read: dir=%" PRId32 " offset=%" PRId64 "\n",
    521531            rtems_rfs_inode_ino (dir), offset);
    522532
     
    578588      {
    579589        if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
    580           printf ("rtems-rfs: dir-read: " \
    581                   "bad length or ino for ino %lu: %u/%ld @ %04lx\n",
     590          printf ("rtems-rfs: dir-read: "
     591                  "bad length or ino for ino %" PRIu32 ": %u/%" PRId32 " @ %04" PRIx32 "\n",
    582592                  rtems_rfs_inode_ino (dir), elength, eino, map.bpos.boff);
    583593        rc = EIO;
     
    609619     
    610620      if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
    611         printf ("rtems-rfs: dir-read: found off:%Ld ino:%ld name=%s\n",
    612                 (uint64_t) dirent->d_off, dirent->d_ino, dirent->d_name);
     621        printf ("rtems-rfs: dir-read: found off:%" PRIdoff_t " ino:%ld name=%s\n",
     622                dirent->d_off, dirent->d_ino, dirent->d_name);
    613623      break;
    614624    }
     
    617627   
    618628    if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
    619       printf ("rtems-rfs: dir-read: next block: off:%ld length:%zd\n",
    620               (uint32_t) offset, *length);
     629      printf ("rtems-rfs: dir-read: next block: off:%" PRId64 " length:%zd\n",
     630              offset, *length);
    621631     
    622632    rc = rtems_rfs_block_map_next_block (fs, &map, &block);
     
    641651
    642652  if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_READ))
    643     printf ("rtems-rfs: dir-empty: dir=%ld\n", rtems_rfs_inode_ino (dir));
     653    printf ("rtems-rfs: dir-empty: dir=%" PRId32 "\n", rtems_rfs_inode_ino (dir));
    644654
    645655  empty = true;
     
    693703      {
    694704        if (rtems_rfs_trace (RTEMS_RFS_TRACE_DIR_EMPTY))
    695           printf ("rtems-rfs: dir-empty: " \
    696                   "bad length or ino for ino %lu: %u/%ld @ %04x\n",
     705          printf ("rtems-rfs: dir-empty: "
     706                  "bad length or ino for ino %" PRIu32 ": %u/%" PRIu32 " @ %04x\n",
    697707                  rtems_rfs_inode_ino (dir), elength, eino, offset);
    698708        rc = EIO;
  • cpukit/libfs/src/rfs/rtems-rfs-link.c

    rf5d125e r54cad05  
    2323#endif
    2424
     25#include <inttypes.h>
     26
    2527#include <rtems/rfs/rtems-rfs-block.h>
    2628#include <rtems/rfs/rtems-rfs-buffer.h>
     
    4749  {
    4850    int c;
    49     printf ("rtems-rfs: link: parent(%lu) -> ", parent);
     51    printf ("rtems-rfs: link: parent(%" PRIu32 ") -> ", parent);
    5052    for (c = 0; c < length; c++)
    5153      printf ("%c", name[c]);
    52     printf ("(%lu)\n", target);
     54    printf ("(%" PRIu32 ")\n", target);
    5355  }
    5456
     
    119121
    120122  if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
    121     printf ("rtems-rfs: unlink: parent(%lu) -X-> (%lu)\n", parent, target);
     123    printf ("rtems-rfs: unlink: parent(%" PRIu32 ") -X-> (%" PRIu32 ")\n", parent, target);
    122124
    123125  rc = rtems_rfs_inode_open (fs, target, &target_inode, true);
     
    180182
    181183  if (rtems_rfs_trace (RTEMS_RFS_TRACE_UNLINK))
    182     printf ("rtems-rfs: unlink: target:%lu links:%u\n", target, links);
     184    printf ("rtems-rfs: unlink: target:%" PRIu32 " links:%u\n", target, links);
    183185
    184186  if (links > 1)
     
    259261  {
    260262    int c;
    261     printf ("rtems-rfs: symlink: parent:%lu name:", parent);
     263    printf ("rtems-rfs: symlink: parent:%" PRIu32 " name:", parent);
    262264    for (c = 0; c < length; c++)
    263265      printf ("%c", name[c]);
     
    368370 
    369371  if (rtems_rfs_trace (RTEMS_RFS_TRACE_SYMLINK_READ))
    370     printf ("rtems-rfs: symlink-read: link:%lu\n", link);
     372    printf ("rtems-rfs: symlink-read: link:%" PRIu32 "\n", link);
    371373
    372374  rc = rtems_rfs_inode_open (fs, link, &inode, true);
Note: See TracChangeset for help on using the changeset viewer.