Changeset 8402

Show
Ignore:
Timestamp:
06/21/10 12:17:18 (3 years ago)
Author:
pcarns
Message:

merge patch submitted by Bart Taylor to correct an overflow in directio
method on 32 bit machines

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/pvfs-2-8-branch/src/io/trove/trove-dbpf/dbpf-bstream-direct.c

    r8196 r8402  
    110110 */ 
    111111#define BLOCK_MULTIPLES_MASK (~((uintptr_t) BLOCK_SIZE - 1)) 
     112#define BLOCK_MULTIPLES_MASK_OFFSET (~((off_t) BLOCK_SIZE - 1)) 
    112113 
    113114/* calculate the max offset that is a multiple of the block size but still 
    114115 * less than or equal to requested offset passed in 
    115116 */ 
    116 #define ALIGNED_OFFSET(__offset) (__offset & BLOCK_MULTIPLES_MASK) 
     117#define ALIGNED_OFFSET(__offset) (__offset & BLOCK_MULTIPLES_MASK_OFFSET) 
    117118 
    118119/* calculate the minimum size that is a multiple of the block size and 
     
    121122#define ALIGNED_SIZE(__offset, __size) \ 
    122123    (((__offset + __size + BLOCK_SIZE - 1) \ 
    123       & BLOCK_MULTIPLES_MASK) - ALIGNED_OFFSET(__offset)) 
     124      & BLOCK_MULTIPLES_MASK_OFFSET) - ALIGNED_OFFSET(__offset)) 
    124125 
    125126#define IS_ALIGNED_PTR(__ptr) \