You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2010/05/19 23:06:42 UTC
svn commit: r946395 [2/8] - in /trafficserver/traffic/trunk:
example/app-template/ iocore/aio/ iocore/block-cache/ iocore/cache/
iocore/cluster/ iocore/dns/ iocore/eventsystem/ iocore/hostdb/
iocore/hostdb/include/ iocore/net/ iocore/utils/ libinktomi+...
Modified: trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_CacheInternal.h Wed May 19 21:06:35 2010
@@ -66,8 +66,8 @@ class EvacuationBlock;
#else
#define CACHE_TRY_LOCK(_l, _m, _t) \
MUTEX_TRY_LOCK(_l, _m, _t); \
- if ((inku32)_t->generator.random() < \
- (inku32)(UINT_MAX *CACHE_LOCK_FAIL_RATE)) \
+ if ((uint32)_t->generator.random() < \
+ (uint32)(UINT_MAX *CACHE_LOCK_FAIL_RATE)) \
CACHE_MUTEX_RELEASE(_l)
#endif
@@ -230,9 +230,9 @@ struct CacheVC:CacheVConnection
{
CacheVC();
- VIO *do_io_read(Continuation *c, ink64 nbytes, MIOBuffer *buf);
- VIO *do_io_pread(Continuation *c, ink64 nbytes, MIOBuffer *buf, ink64 offset);
- VIO *do_io_write(Continuation *c, ink64 nbytes, IOBufferReader *buf, bool owner = false);
+ VIO *do_io_read(Continuation *c, int64 nbytes, MIOBuffer *buf);
+ VIO *do_io_pread(Continuation *c, int64 nbytes, MIOBuffer *buf, int64 offset);
+ VIO *do_io_write(Continuation *c, int64 nbytes, IOBufferReader *buf, bool owner = false);
void do_io_close(int lerrno = -1);
void reenable(VIO *avio);
void reenable_re(VIO *avio);
@@ -290,7 +290,7 @@ struct CacheVC:CacheVConnection
int do_write_call();
int do_write_lock();
int do_write_lock_call();
- int do_sync(inku32 target_write_serial);
+ int do_sync(uint32 target_write_serial);
int openReadClose(int event, Event *e);
int openReadReadDone(int event, Event *e);
@@ -418,9 +418,9 @@ struct CacheVC:CacheVConnection
#endif
int header_len; // for communicating with agg_copy
int frag_len; // for communicating with agg_copy
- inku32 write_len; // for communicating with agg_copy
- inku32 agg_len; // for communicating with aggWrite
- inku32 write_serial; // serial of the final write for SYNC
+ uint32 write_len; // for communicating with agg_copy
+ uint32 agg_len; // for communicating with aggWrite
+ uint32 write_serial; // serial of the final write for SYNC
Frag *frag; // arraylist of fragment offset
Frag integral_frags[INTEGRAL_FRAGS];
Part *part;
@@ -428,20 +428,20 @@ struct CacheVC:CacheVConnection
Event *trigger;
CacheKey *read_key;
ContinuationHandler save_handler;
- inku32 pin_in_cache;
+ uint32 pin_in_cache;
ink_hrtime start_time;
int base_stat;
int recursive;
int closed;
- ink64 seek_to; // pread offset
- ink64 offset; // offset into 'blocks' of data to write
- ink64 writer_offset; // offset of the writer for reading from a writer
- ink64 length; // length of data available to write
- ink64 doc_pos; // read position in 'buf'
- inku64 write_pos; // length written
- inku64 total_len; // total length written and available to write
- inku64 doc_len; // total_length (of the selected alternate for HTTP)
- inku64 update_len;
+ int64 seek_to; // pread offset
+ int64 offset; // offset into 'blocks' of data to write
+ int64 writer_offset; // offset of the writer for reading from a writer
+ int64 length; // length of data available to write
+ int64 doc_pos; // read position in 'buf'
+ uint64 write_pos; // length written
+ uint64 total_len; // total length written and available to write
+ uint64 doc_len; // total_length (of the selected alternate for HTTP)
+ uint64 update_len;
int fragment;
int scan_msec_delay;
CacheVC *write_vc;
@@ -453,7 +453,7 @@ struct CacheVC:CacheVConnection
union
{
- inku32 flags;
+ uint32 flags;
struct
{
unsigned int use_first_key:1;
@@ -746,8 +746,8 @@ Part::open_write(CacheVC *cont, int allo
if (!cont->f.remove) {
agg_error = (!cont->f.update && agg_todo_size > cache_config_agg_write_backlog);
#ifdef CACHE_AGG_FAIL_RATE
- agg_error = agg_error || ((inku32) mutex->thread_holding->generator.random() <
- (inku32) (UINT_MAX * CACHE_AGG_FAIL_RATE));
+ agg_error = agg_error || ((uint32) mutex->thread_holding->generator.random() <
+ (uint32) (UINT_MAX * CACHE_AGG_FAIL_RATE));
#endif
}
if (agg_error) {
@@ -853,28 +853,28 @@ dir_overwrite_lock(CacheKey *key, Part *
void TS_INLINE
rand_CacheKey(CacheKey *next_key, ProxyMutex *mutex)
{
- inku32 *b = (inku32 *) & next_key->b[0];
+ uint32 *b = (uint32 *) & next_key->b[0];
InkRand & g = mutex->thread_holding->generator;
for (int i = 0; i < 4; i++)
- b[i] = (inku32) g.random();
+ b[i] = (uint32) g.random();
}
-extern inku8 CacheKey_next_table[];
+extern uint8 CacheKey_next_table[];
void TS_INLINE
next_CacheKey(CacheKey *next_key, CacheKey *key)
{
- inku8 *b = (inku8 *) next_key;
- inku8 *k = (inku8 *) key;
+ uint8 *b = (uint8 *) next_key;
+ uint8 *k = (uint8 *) key;
b[0] = CacheKey_next_table[k[0]];
for (int i = 1; i < 16; i++)
b[i] = CacheKey_next_table[(b[i - 1] + k[i]) & 0xFF];
}
-extern inku8 CacheKey_prev_table[];
+extern uint8 CacheKey_prev_table[];
void TS_INLINE
prev_CacheKey(CacheKey *prev_key, CacheKey *key)
{
- inku8 *b = (inku8 *) prev_key;
- inku8 *k = (inku8 *) key;
+ uint8 *b = (uint8 *) prev_key;
+ uint8 *k = (uint8 *) key;
for (int i = 15; i > 0; i--)
b[i] = 256 + CacheKey_prev_table[k[i]] - k[i - 1];
b[0] = CacheKey_prev_table[k[0]];
@@ -917,8 +917,8 @@ CacheRemoveCont::event_handler(int event
return EVENT_DONE;
}
-ink64 cache_bytes_used(void);
-ink64 cache_bytes_total(void);
+int64 cache_bytes_used(void);
+int64 cache_bytes_total(void);
#ifdef DEBUG
#define CACHE_DEBUG_INCREMENT_DYN_STAT(_x) CACHE_INCREMENT_DYN_STAT(_x)
@@ -938,7 +938,7 @@ struct Cache
volatile int total_good_npart;
int total_npart;
volatile int ready;
- ink64 cache_size; //in store block size
+ int64 cache_size; //in store block size
CacheHostTable *hosttable;
volatile int total_initialized_part;
int scheme;
@@ -1070,7 +1070,7 @@ Cache::open_write(Continuation *cont, Ca
TS_INLINE unsigned int
cache_hash(INK_MD5 & md5)
{
- inku64 f = md5.fold();
+ uint64 f = md5.fold();
unsigned int mhash = (unsigned int) (f >> 32);
return mhash;
}
Modified: trafficserver/traffic/trunk/iocore/cache/P_CachePart.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_CachePart.h?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_CachePart.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_CachePart.h Wed May 19 21:06:35 2010
@@ -34,12 +34,12 @@
#define PART_MAGIC 0xF1D0F00D
#define START_BLOCKS 32 // 8k
-#define START_POS ((ink_off_t)START_BLOCKS * INK_BLOCK_SIZE)
+#define START_POS ((off_t)START_BLOCKS * INK_BLOCK_SIZE)
#define AGG_HEADER_SIZE INK_BLOCK_SIZE
#define AGG_SIZE (4 * 1024 * 1024) // 4MB
#define AGG_HIGH_WATER (AGG_SIZE / 2) // 2MB
#define EVACUATION_SIZE (2 * AGG_SIZE) // 8MB
-#define MAX_PART_SIZE ((ink_off_t)512 * 1024 * 1024 * 1024 * 1024)
+#define MAX_PART_SIZE ((off_t)512 * 1024 * 1024 * 1024 * 1024)
#define STORE_BLOCKS_PER_DISK_BLOCK (STORE_BLOCK_SIZE / INK_BLOCK_SIZE)
#define MAX_PART_BLOCKS (MAX_PART_SIZE / INK_BLOCK_SIZE)
#define TARGET_FRAG_SIZE (DEFAULT_MAX_BUFFER_SIZE - sizeofDoc)
@@ -65,11 +65,11 @@
// Documents
-#define DOC_MAGIC ((inku32)0x5F129B13)
-#define DOC_CORRUPT ((inku32)0xDEADBABE)
-#define DOC_NO_CHECKSUM ((inku32)0xA0B0C0D0)
+#define DOC_MAGIC ((uint32)0x5F129B13)
+#define DOC_CORRUPT ((uint32)0xDEADBABE)
+#define DOC_NO_CHECKSUM ((uint32)0xA0B0C0D0)
-#define sizeofDoc (((inku32)(uintptr_t)&((Doc*)0)->checksum)+(inku32)sizeof(inku32))
+#define sizeofDoc (((uint32)(uintptr_t)&((Doc*)0)->checksum)+(uint32)sizeof(uint32))
struct Cache;
struct Part;
@@ -83,16 +83,16 @@ struct PartHeaderFooter
unsigned int magic;
VersionNumber version;
time_t create_time;
- ink_off_t write_pos;
- ink_off_t last_write_pos;
- ink_off_t agg_pos;
- inku32 generation; // token generation (vary), this cannot be 0
- inku32 phase;
- inku32 cycle;
- inku32 sync_serial;
- inku32 write_serial;
- inku32 dirty;
- inku16 freelist[1];
+ off_t write_pos;
+ off_t last_write_pos;
+ off_t agg_pos;
+ uint32 generation; // token generation (vary), this cannot be 0
+ uint32 phase;
+ uint32 cycle;
+ uint32 sync_serial;
+ uint32 write_serial;
+ uint32 dirty;
+ uint16 freelist[1];
};
// Key and Earliest key for each fragment that needs to be evacuated
@@ -137,14 +137,14 @@ struct Part:public Continuation
PartHeaderFooter *header;
PartHeaderFooter *footer;
int segments;
- ink_off_t buckets;
- ink_off_t recover_pos;
- ink_off_t prev_recover_pos;
- ink_off_t scan_pos;
- ink_off_t skip; // start of headers
- ink_off_t start; // start of data
- ink_off_t len;
- ink_off_t data_blocks;
+ off_t buckets;
+ off_t recover_pos;
+ off_t prev_recover_pos;
+ off_t scan_pos;
+ off_t skip; // start of headers
+ off_t start; // start of data
+ off_t len;
+ off_t data_blocks;
int hit_evacuate_window;
AIOCallbackInternal io;
@@ -169,15 +169,15 @@ struct Part:public Continuation
CacheDisk *disk;
Cache *cache;
CachePart *cache_part;
- inku32 last_sync_serial;
- inku32 last_write_serial;
+ uint32 last_sync_serial;
+ uint32 last_write_serial;
bool recover_wrapped;
bool dir_sync_waiting;
bool dir_sync_in_progress;
bool writing_end_marker;
CacheKey first_fragment_key;
- ink64 first_fragment_offset;
+ int64 first_fragment_offset;
Ptr<IOBufferData> first_fragment_data;
void cancel_trigger();
@@ -197,7 +197,7 @@ struct Part:public Continuation
int clear_dir();
- int init(char *s, ink_off_t blocks, ink_off_t dir_skip, bool clear);
+ int init(char *s, off_t blocks, off_t dir_skip, bool clear);
int handle_dir_clear(int event, void *data);
int handle_dir_read(int event, void *data);
@@ -236,7 +236,7 @@ struct Part:public Continuation
int evacuateDocReadDone(int event, Event *e);
int evacuateDoc(int event, Event *e);
- int evac_range(ink_off_t start, ink_off_t end, int evac_phase);
+ int evac_range(off_t start, off_t end, int evac_phase);
void periodic_scan();
void scan_for_pinned_documents();
void evacuate_cleanup_blocks(int i);
@@ -290,31 +290,31 @@ struct CachePart
// element of the fragment table in the head of a multi-fragment document
struct Frag {
- inku64 offset; // start offset of data stored in this fragment
+ uint64 offset; // start offset of data stored in this fragment
};
// Note : hdr() needs to be 8 byte aligned.
// If you change this, change sizeofDoc above
struct Doc
{
- inku32 magic; // DOC_MAGIC
- inku32 len; // length of this segment
- inku64 total_len; // total length of document
+ uint32 magic; // DOC_MAGIC
+ uint32 len; // length of this segment
+ uint64 total_len; // total length of document
INK_MD5 first_key; // first key in document (http: vector)
INK_MD5 key;
- inku32 hlen; // header length
- inku32 ftype:8; // fragment type CACHE_FRAG_TYPE_XX
- inku32 flen:24; // fragment table length
- inku32 sync_serial;
- inku32 write_serial;
- inku32 pinned; // pinned until
- inku32 checksum;
+ uint32 hlen; // header length
+ uint32 ftype:8; // fragment type CACHE_FRAG_TYPE_XX
+ uint32 flen:24; // fragment table length
+ uint32 sync_serial;
+ uint32 write_serial;
+ uint32 pinned; // pinned until
+ uint32 checksum;
- inku32 data_len();
- inku32 prefix_len();
+ uint32 data_len();
+ uint32 prefix_len();
int single_fragment();
int no_data_in_fragment();
- inku32 nfrags();
+ uint32 nfrags();
char *hdr();
Frag *frags();
char *data();
@@ -333,7 +333,7 @@ extern unsigned short *part_hash_table;
TS_INLINE int
part_headerlen(Part *d) {
- return ROUND_TO_BLOCK(sizeof(PartHeaderFooter) + sizeof(inku16) * (d->segments-1));
+ return ROUND_TO_BLOCK(sizeof(PartHeaderFooter) + sizeof(uint16) * (d->segments-1));
}
TS_INLINE int
part_dirlen(Part * d)
@@ -366,18 +366,18 @@ part_in_phase_valid(Part * d, Dir * e)
{
return (dir_offset(e) - 1 < ((d->header->write_pos + d->agg_buf_pos - d->start) / INK_BLOCK_SIZE));
}
-TS_INLINE ink_off_t
+TS_INLINE off_t
part_offset(Part * d, Dir * e)
{
- return d->start + (ink_off_t) dir_offset(e) * INK_BLOCK_SIZE - INK_BLOCK_SIZE;
+ return d->start + (off_t) dir_offset(e) * INK_BLOCK_SIZE - INK_BLOCK_SIZE;
}
-TS_INLINE ink_off_t
-offset_to_part_offset(Part * d, ink_off_t pos)
+TS_INLINE off_t
+offset_to_part_offset(Part * d, off_t pos)
{
return ((pos - d->start + INK_BLOCK_SIZE) / INK_BLOCK_SIZE);
}
-TS_INLINE ink_off_t
-part_offset_to_offset(Part * d, ink_off_t pos)
+TS_INLINE off_t
+part_offset_to_offset(Part * d, off_t pos)
{
return d->start + pos * INK_BLOCK_SIZE - INK_BLOCK_SIZE;
}
@@ -391,12 +391,12 @@ part_in_phase_agg_buf_valid(Part * d, Di
{
return (part_offset(d, e) >= d->header->write_pos && part_offset(d, e) < (d->header->write_pos + d->agg_buf_pos));
}
-TS_INLINE inku32
+TS_INLINE uint32
Doc::prefix_len()
{
return sizeofDoc + hlen + flen;
}
-TS_INLINE inku32
+TS_INLINE uint32
Doc::data_len()
{
return len - sizeofDoc - hlen - flen;
@@ -406,7 +406,7 @@ Doc::single_fragment()
{
return (total_len && (data_len() == total_len));
}
-TS_INLINE inku32
+TS_INLINE uint32
Doc::nfrags() {
return flen / sizeof(Frag);
}
@@ -427,7 +427,7 @@ Doc::data()
}
int part_dir_clear(Part * d);
-int part_init(Part * d, char *s, ink_off_t blocks, ink_off_t skip, bool clear);
+int part_init(Part * d, char *s, off_t blocks, off_t skip, bool clear);
// inline Functions
@@ -482,9 +482,9 @@ Part::open_read(INK_MD5 * key)
TS_INLINE int
Part::within_hit_evacuate_window(Dir * xdir)
{
- ink_off_t oft = dir_offset(xdir) - 1;
- ink_off_t write_off = (header->write_pos + AGG_SIZE - start) / INK_BLOCK_SIZE;
- ink_off_t delta = oft - write_off;
+ off_t oft = dir_offset(xdir) - 1;
+ off_t write_off = (header->write_pos + AGG_SIZE - start) / INK_BLOCK_SIZE;
+ off_t delta = oft - write_off;
if (delta >= 0)
return delta < hit_evacuate_window;
else
Modified: trafficserver/traffic/trunk/iocore/cache/P_CacheTest.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_CacheTest.h?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_CacheTest.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_CacheTest.h Wed May 19 21:06:35 2010
@@ -63,7 +63,7 @@ struct CacheTestHost {
};
struct CacheTestHeader {
- inku64 serial;
+ uint64 serial;
};
struct CacheTestSM : RegressionSM {
@@ -80,13 +80,13 @@ struct CacheTestSM : RegressionSM {
CacheHTTPInfo info;
char urlstr[1024];
#endif
- ink64 total_size;
+ int64 total_size;
CacheKey key;
int repeat_count;
int expect_event;
int expect_initial_event;
int initial_event;
- inku64 content_salt;
+ uint64 content_salt;
CacheTestHeader header;
int end_memcpy_on_clone; // place all variables to be copied between these markers
Modified: trafficserver/traffic/trunk/iocore/cache/P_RamCache.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/P_RamCache.h?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/P_RamCache.h (original)
+++ trafficserver/traffic/trunk/iocore/cache/P_RamCache.h Wed May 19 21:06:35 2010
@@ -30,11 +30,11 @@
struct RamCache {
// returns 1 on found/stored, 0 on not found/stored, if provided auxkey1 and auxkey2 must match
- virtual int get(INK_MD5 *key, Ptr<IOBufferData> *ret_data, inku32 auxkey1 = 0, inku32 auxkey2 = 0) = 0;
- virtual int put(INK_MD5 *key, IOBufferData *data, inku32 len, bool copy = false, inku32 auxkey1 = 0, inku32 auxkey2 = 0) = 0;
- virtual int fixup(INK_MD5 *key, inku32 old_auxkey1, inku32 old_auxkey2, inku32 new_auxkey1, inku32 new_auxkey2) = 0;
+ virtual int get(INK_MD5 *key, Ptr<IOBufferData> *ret_data, uint32 auxkey1 = 0, uint32 auxkey2 = 0) = 0;
+ virtual int put(INK_MD5 *key, IOBufferData *data, uint32 len, bool copy = false, uint32 auxkey1 = 0, uint32 auxkey2 = 0) = 0;
+ virtual int fixup(INK_MD5 *key, uint32 old_auxkey1, uint32 old_auxkey2, uint32 new_auxkey1, uint32 new_auxkey2) = 0;
- virtual void init(ink64 max_bytes, Part *part) = 0;
+ virtual void init(int64 max_bytes, Part *part) = 0;
virtual ~RamCache() {};
};
Modified: trafficserver/traffic/trunk/iocore/cache/RamCacheCLFUS.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/RamCacheCLFUS.cc?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/RamCacheCLFUS.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/RamCacheCLFUS.cc Wed May 19 21:06:35 2010
@@ -45,20 +45,20 @@
struct RamCacheCLFUSEntry {
INK_MD5 key;
- inku32 auxkey1;
- inku32 auxkey2;
- inku64 hits;
- inku32 size; // memory used including paddding in buffer
- inku32 len; // actual data length
- inku32 compressed_len;
+ uint32 auxkey1;
+ uint32 auxkey2;
+ uint64 hits;
+ uint32 size; // memory used including paddding in buffer
+ uint32 len; // actual data length
+ uint32 compressed_len;
union {
struct {
- inku32 compressed:3; // compression type
- inku32 incompressible:1;
- inku32 lru:1;
- inku32 copy:1; // copy-in-copy-out
+ uint32 compressed:3; // compression type
+ uint32 incompressible:1;
+ uint32 lru:1;
+ uint32 copy:1; // copy-in-copy-out
};
- inku32 flags;
+ uint32 flags;
};
LINK(RamCacheCLFUSEntry, lru_link);
LINK(RamCacheCLFUSEntry, hash_link);
@@ -66,25 +66,25 @@ struct RamCacheCLFUSEntry {
};
struct RamCacheCLFUS : RamCache {
- ink64 max_bytes;
- ink64 bytes;
- ink64 objects;
+ int64 max_bytes;
+ int64 bytes;
+ int64 objects;
// returns 1 on found/stored, 0 on not found/stored, if provided auxkey1 and auxkey2 must match
- int get(INK_MD5 *key, Ptr<IOBufferData> *ret_data, inku32 auxkey1 = 0, inku32 auxkey2 = 0);
- int put(INK_MD5 *key, IOBufferData *data, inku32 len, bool copy = false, inku32 auxkey1 = 0, inku32 auxkey2 = 0);
- int fixup(INK_MD5 *key, inku32 old_auxkey1, inku32 old_auxkey2, inku32 new_auxkey1, inku32 new_auxkey2);
+ int get(INK_MD5 *key, Ptr<IOBufferData> *ret_data, uint32 auxkey1 = 0, uint32 auxkey2 = 0);
+ int put(INK_MD5 *key, IOBufferData *data, uint32 len, bool copy = false, uint32 auxkey1 = 0, uint32 auxkey2 = 0);
+ int fixup(INK_MD5 *key, uint32 old_auxkey1, uint32 old_auxkey2, uint32 new_auxkey1, uint32 new_auxkey2);
- void init(ink64 max_bytes, Part *part);
+ void init(int64 max_bytes, Part *part);
// private
Part *part; // for stats
- ink64 history;
+ int64 history;
int ibuckets;
int nbuckets;
DList(RamCacheCLFUSEntry, hash_link) *bucket;
Que(RamCacheCLFUSEntry, lru_link) lru[2];
- inku16 *seen;
+ uint16 *seen;
int ncompressed;
RamCacheCLFUSEntry *compressed; // first uncompressed lru[0] entry
void compress_entries(int do_at_most = INT_MAX);
@@ -109,11 +109,11 @@ const static int bucket_sizes[] = {
void RamCacheCLFUS::resize_hashtable() {
int anbuckets = bucket_sizes[ibuckets];
DDebug("ram_cache", "resize hashtable %d", anbuckets);
- ink64 s = anbuckets * sizeof(DList(RamCacheCLFUSEntry, hash_link));
+ int64 s = anbuckets * sizeof(DList(RamCacheCLFUSEntry, hash_link));
DList(RamCacheCLFUSEntry, hash_link) *new_bucket = (DList(RamCacheCLFUSEntry, hash_link) *)xmalloc(s);
memset(new_bucket, 0, s);
if (bucket) {
- for (ink64 i = 0; i < nbuckets; i++) {
+ for (int64 i = 0; i < nbuckets; i++) {
RamCacheCLFUSEntry *e = 0;
while ((e = bucket[i].pop()))
new_bucket[e->key.word(3) % anbuckets].push(e);
@@ -123,12 +123,12 @@ void RamCacheCLFUS::resize_hashtable() {
bucket = new_bucket;
nbuckets = anbuckets;
if (seen) xfree(seen);
- int size = bucket_sizes[ibuckets] * sizeof(inku16);
- seen = (inku16*)xmalloc(size);
+ int size = bucket_sizes[ibuckets] * sizeof(uint16);
+ seen = (uint16*)xmalloc(size);
memset(seen, 0, size);
}
-void RamCacheCLFUS::init(ink64 abytes, Part *apart) {
+void RamCacheCLFUS::init(int64 abytes, Part *apart) {
part = apart;
max_bytes = abytes;
DDebug("ram_cache", "initializing ram_cache %lld bytes", abytes);
@@ -139,7 +139,7 @@ void RamCacheCLFUS::init(ink64 abytes, P
#ifdef CHECK_ACOUNTING
static void check_accounting(RamCacheCLFUS *c) {
- ink64 x = 0, xsize = 0, h = 0;
+ int64 x = 0, xsize = 0, h = 0;
RamCacheCLFUSEntry *y = c->lru[0].head;
while (y) { x++; xsize += y->size + ENTRY_OVERHEAD; y = y->lru_link.next; }
y = c->lru[1].head;
@@ -152,10 +152,10 @@ static void check_accounting(RamCacheCLF
#define check_accounting(_c)
#endif
-int RamCacheCLFUS::get(INK_MD5 *key, Ptr<IOBufferData> *ret_data, inku32 auxkey1, inku32 auxkey2) {
+int RamCacheCLFUS::get(INK_MD5 *key, Ptr<IOBufferData> *ret_data, uint32 auxkey1, uint32 auxkey2) {
if (!max_bytes)
return 0;
- ink64 i = key->word(3) % nbuckets;
+ int64 i = key->word(3) % nbuckets;
RamCacheCLFUSEntry *e = bucket[i].head;
char *b = 0;
while (e) {
@@ -197,7 +197,7 @@ int RamCacheCLFUS::get(INK_MD5 *key, Ptr
IOBufferData *data = new_xmalloc_IOBufferData(b, e->len);
data->_mem_type = DEFAULT_ALLOC;
if (!e->copy) { // don't bother if we have to copy anyway
- ink64 delta = ((ink64)e->compressed_len) - (ink64)e->size;
+ int64 delta = ((int64)e->compressed_len) - (int64)e->size;
bytes += delta;
CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_bytes_stat, delta);
e->size = e->compressed_len;
@@ -253,7 +253,7 @@ void RamCacheCLFUS::tick() {
Lfree:
e->lru = 0;
history--;
- inku32 b = e->key.word(3) % nbuckets;
+ uint32 b = e->key.word(3) % nbuckets;
bucket[b].remove(e);
DDebug("ram_cache", "put %X %d %d size %d FREED", e->key.word(3), e->auxkey1, e->auxkey2, e->size);
THREAD_FREE(e, ramCacheCLFUSEntryAllocator, this_ethread());
@@ -291,7 +291,7 @@ RamCacheCLFUSEntry *RamCacheCLFUS::destr
e->data = NULL;
} else
history--;
- inku32 b = e->key.word(3) % nbuckets;
+ uint32 b = e->key.word(3) % nbuckets;
bucket[b].remove(e);
DDebug("ram_cache", "put %X %d %d DESTROYED", e->key.word(3), e->auxkey1, e->auxkey2);
THREAD_FREE(e, ramCacheCLFUSEntryAllocator, this_ethread());
@@ -367,7 +367,7 @@ void RamCacheCLFUS::compress_entries(int
memcpy(bb, b, l);
xfree(b);
e->compressed_len = l;
- ink64 delta = ((ink64)l) - (ink64)e->size;
+ int64 delta = ((int64)l) - (int64)e->size;
bytes += delta;
CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_bytes_stat, delta);
e->size = l;
@@ -376,7 +376,7 @@ void RamCacheCLFUS::compress_entries(int
e->compressed = 0;
bb = (char*)xmalloc(e->len);
memcpy(bb, e->data->data(), e->len);
- ink64 delta = ((ink64)e->len) - (ink64)e->size;
+ int64 delta = ((int64)e->len) - (int64)e->size;
bytes += delta;
CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_bytes_stat, delta);
e->size = e->len;
@@ -411,12 +411,12 @@ void RamCacheCLFUS::requeue_victims(RamC
}
}
-int RamCacheCLFUS::put(INK_MD5 *key, IOBufferData *data, inku32 len, bool copy, inku32 auxkey1, inku32 auxkey2) {
+int RamCacheCLFUS::put(INK_MD5 *key, IOBufferData *data, uint32 len, bool copy, uint32 auxkey1, uint32 auxkey2) {
if (!max_bytes)
return 0;
- inku32 i = key->word(3) % nbuckets;
+ uint32 i = key->word(3) % nbuckets;
RamCacheCLFUSEntry *e = bucket[i].head;
- inku32 size = copy ? len : data->block_size();
+ uint32 size = copy ? len : data->block_size();
while (e) {
if (e->key == *key) {
if (e->auxkey1 == auxkey1 && e->auxkey2 == auxkey2)
@@ -434,7 +434,7 @@ int RamCacheCLFUS::put(INK_MD5 *key, IOB
move_compressed(e);
lru[e->lru].remove(e);
lru[e->lru].enqueue(e);
- ink64 delta = ((ink64)size) - (ink64)e->size;
+ int64 delta = ((int64)size) - (int64)e->size;
bytes += delta;
CACHE_SUM_DYN_STAT_THREAD(cache_ram_cache_bytes_stat, delta);
if (!copy) {
@@ -461,9 +461,9 @@ int RamCacheCLFUS::put(INK_MD5 *key, IOB
if (bytes + size <= max_bytes)
goto Linsert;
if (!e) {
- inku32 s = key->word(3) % bucket_sizes[ibuckets];
- inku16 k = key->word(3) >> 16;
- inku16 kk = seen[s];
+ uint32 s = key->word(3) % bucket_sizes[ibuckets];
+ uint16 k = key->word(3) >> 16;
+ uint16 kk = seen[s];
seen[s] = k;
if (history >= objects && kk != k) {
DDebug("ram_cache", "put %X %d %d size %d UNSEEN", key->word(3), auxkey1, auxkey2, size);
@@ -569,10 +569,10 @@ Lhistory:
return 0;
}
-int RamCacheCLFUS::fixup(INK_MD5 * key, inku32 old_auxkey1, inku32 old_auxkey2, inku32 new_auxkey1, inku32 new_auxkey2) {
+int RamCacheCLFUS::fixup(INK_MD5 * key, uint32 old_auxkey1, uint32 old_auxkey2, uint32 new_auxkey1, uint32 new_auxkey2) {
if (!max_bytes)
return 0;
- inku32 i = key->word(3) % nbuckets;
+ uint32 i = key->word(3) % nbuckets;
RamCacheCLFUSEntry *e = bucket[i].head;
while (e) {
if (e->key == *key && e->auxkey1 == old_auxkey1 && e->auxkey2 == old_auxkey2) {
Modified: trafficserver/traffic/trunk/iocore/cache/RamCacheLRU.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/RamCacheLRU.cc?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/RamCacheLRU.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/RamCacheLRU.cc Wed May 19 21:06:35 2010
@@ -25,27 +25,27 @@
struct RamCacheLRUEntry {
INK_MD5 key;
- inku32 auxkey1;
- inku32 auxkey2;
+ uint32 auxkey1;
+ uint32 auxkey2;
LINK(RamCacheLRUEntry, lru_link);
LINK(RamCacheLRUEntry, hash_link);
Ptr<IOBufferData> data;
};
struct RamCacheLRU : RamCache {
- ink64 max_bytes;
- ink64 bytes;
- ink64 objects;
+ int64 max_bytes;
+ int64 bytes;
+ int64 objects;
// returns 1 on found/stored, 0 on not found/stored, if provided auxkey1 and auxkey2 must match
- int get(INK_MD5 *key, Ptr<IOBufferData> *ret_data, inku32 auxkey1 = 0, inku32 auxkey2 = 0);
- int put(INK_MD5 *key, IOBufferData *data, inku32 len, bool copy = false, inku32 auxkey1 = 0, inku32 auxkey2 = 0);
- int fixup(INK_MD5 *key, inku32 old_auxkey1, inku32 old_auxkey2, inku32 new_auxkey1, inku32 new_auxkey2);
+ int get(INK_MD5 *key, Ptr<IOBufferData> *ret_data, uint32 auxkey1 = 0, uint32 auxkey2 = 0);
+ int put(INK_MD5 *key, IOBufferData *data, uint32 len, bool copy = false, uint32 auxkey1 = 0, uint32 auxkey2 = 0);
+ int fixup(INK_MD5 *key, uint32 old_auxkey1, uint32 old_auxkey2, uint32 new_auxkey1, uint32 new_auxkey2);
- void init(ink64 max_bytes, Part *part);
+ void init(int64 max_bytes, Part *part);
// private
- inku16 *seen;
+ uint16 *seen;
Que(RamCacheLRUEntry, lru_link) lru;
DList(RamCacheLRUEntry, hash_link) *bucket;
int nbuckets;
@@ -69,11 +69,11 @@ const static int bucket_sizes[] = {
void RamCacheLRU::resize_hashtable() {
int anbuckets = bucket_sizes[ibuckets];
DDebug("ram_cache", "resize hashtable %d", anbuckets);
- ink64 s = anbuckets * sizeof(DList(RamCacheLRUEntry, hash_link));
+ int64 s = anbuckets * sizeof(DList(RamCacheLRUEntry, hash_link));
DList(RamCacheLRUEntry, hash_link) *new_bucket = (DList(RamCacheLRUEntry, hash_link) *)xmalloc(s);
memset(new_bucket, 0, s);
if (bucket) {
- for (ink64 i = 0; i < nbuckets; i++) {
+ for (int64 i = 0; i < nbuckets; i++) {
RamCacheLRUEntry *e = 0;
while ((e = bucket[i].pop()))
new_bucket[e->key.word(3) % anbuckets].push(e);
@@ -83,13 +83,13 @@ void RamCacheLRU::resize_hashtable() {
bucket = new_bucket;
nbuckets = anbuckets;
if (seen) xfree(seen);
- int size = bucket_sizes[ibuckets] * sizeof(inku16);
- seen = (inku16*)xmalloc(size);
+ int size = bucket_sizes[ibuckets] * sizeof(uint16);
+ seen = (uint16*)xmalloc(size);
memset(seen, 0, size);
}
void
-RamCacheLRU::init(ink64 abytes, Part *apart) {
+RamCacheLRU::init(int64 abytes, Part *apart) {
part = apart;
max_bytes = abytes;
DDebug("ram_cache", "initializing ram_cache %lld bytes", abytes);
@@ -99,10 +99,10 @@ RamCacheLRU::init(ink64 abytes, Part *ap
}
int
-RamCacheLRU::get(INK_MD5 * key, Ptr<IOBufferData> *ret_data, inku32 auxkey1, inku32 auxkey2) {
+RamCacheLRU::get(INK_MD5 * key, Ptr<IOBufferData> *ret_data, uint32 auxkey1, uint32 auxkey2) {
if (!max_bytes)
return 0;
- inku32 i = key->word(3) % nbuckets;
+ uint32 i = key->word(3) % nbuckets;
RamCacheLRUEntry *e = bucket[i].head;
while (e) {
if (e->key == *key && e->auxkey1 == auxkey1 && e->auxkey2 == auxkey2) {
@@ -122,7 +122,7 @@ RamCacheLRU::get(INK_MD5 * key, Ptr<IOBu
RamCacheLRUEntry * RamCacheLRU::remove(RamCacheLRUEntry *e) {
RamCacheLRUEntry *ret = e->hash_link.next;
- inku32 b = e->key.word(3) % nbuckets;
+ uint32 b = e->key.word(3) % nbuckets;
bucket[b].remove(e);
lru.remove(e);
bytes -= e->data->block_size();
@@ -135,10 +135,10 @@ RamCacheLRUEntry * RamCacheLRU::remove(R
}
// ignore 'len' and 'copy' since we don't touch the data
-int RamCacheLRU::put(INK_MD5 *key, IOBufferData *data, inku32, bool, inku32 auxkey1, inku32 auxkey2) {
+int RamCacheLRU::put(INK_MD5 *key, IOBufferData *data, uint32, bool, uint32 auxkey1, uint32 auxkey2) {
if (!max_bytes)
return 0;
- inku32 i = key->word(3) % nbuckets;
+ uint32 i = key->word(3) % nbuckets;
RamCacheLRUEntry *e = bucket[i].head;
while (e) {
if (e->key == *key) {
@@ -176,10 +176,10 @@ int RamCacheLRU::put(INK_MD5 *key, IOBuf
return 1;
}
-int RamCacheLRU::fixup(INK_MD5 * key, inku32 old_auxkey1, inku32 old_auxkey2, inku32 new_auxkey1, inku32 new_auxkey2) {
+int RamCacheLRU::fixup(INK_MD5 * key, uint32 old_auxkey1, uint32 old_auxkey2, uint32 new_auxkey1, uint32 new_auxkey2) {
if (!max_bytes)
return 0;
- inku32 i = key->word(3) % nbuckets;
+ uint32 i = key->word(3) % nbuckets;
RamCacheLRUEntry *e = bucket[i].head;
while (e) {
if (e->key == *key && e->auxkey1 == old_auxkey1 && e->auxkey2 == old_auxkey2) {
Modified: trafficserver/traffic/trunk/iocore/cache/Store.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/Store.cc?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/Store.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/Store.cc Wed May 19 21:06:35 2010
@@ -217,7 +217,7 @@ Store::sort()
}
int
-Span::path(char *filename, ink64 * aoffset, char *buf, int buflen)
+Span::path(char *filename, int64 * aoffset, char *buf, int buflen)
{
ink_assert(!aoffset);
Span *ds = this;
@@ -264,7 +264,7 @@ Span::~Span()
}
inline int
-get_ink64(int fd, ink64 & data)
+get_int64(int fd, int64 & data)
{
char buf[PATH_NAME_MAX + 1];
if (ink_file_fd_readline(fd, PATH_NAME_MAX, buf) <= 0)
@@ -358,7 +358,7 @@ Store::read_config(int fd)
char *e = strpbrk(n, " \t\n");
int len = e ? e - n : strlen(n);
(void) len;
- ink64 size = -1;
+ int64 size = -1;
while (e && *e && !ParseRules::is_digit(*e))
e++;
if (e && *e) {
@@ -424,7 +424,7 @@ Store::write_config_data(int fd)
for (int i = 0; i < n_disks; i++)
for (Span * sd = disk[i]; sd; sd = sd->link.next) {
char buf[PATH_NAME_MAX + 64];
- snprintf(buf, sizeof(buf), "%s %lld\n", sd->pathname, (ink64) sd->blocks * (ink64) STORE_BLOCK_SIZE);
+ snprintf(buf, sizeof(buf), "%s %lld\n", sd->pathname, (int64) sd->blocks * (int64) STORE_BLOCK_SIZE);
if (ink_file_fd_writestring(fd, buf) == -1)
return (-1);
}
@@ -453,7 +453,7 @@ Store::write_config_data(int fd)
#include <string.h>
const char *
-Span::init(char *an, ink64 size)
+Span::init(char *an, int64 size)
{
int devnum = 0;
const char *err = NULL;
@@ -517,7 +517,7 @@ Span::init(char *an, ink64 size)
#endif
disk_block_size = fs.f_bsize;
- ink64 fsize = (ink64) fs.f_blocks * (ink64) fs.f_bsize;
+ int64 fsize = (int64) fs.f_blocks * (int64) fs.f_bsize;
switch ((s.st_mode & S_IFMT)) {
@@ -561,11 +561,11 @@ Span::init(char *an, ink64 size)
goto LpartError;
if (slice >= (int) ds.dss_nslices || !ds.dss_slices[slice].ds_size)
goto LpartError;
- fsize = (ink64) ds.dss_slices[slice].ds_size * dl.d_secsize;
+ fsize = (int64) ds.dss_slices[slice].ds_size * dl.d_secsize;
} else {
if (part < 0)
goto LpartError;
- fsize = (ink64) dl.d_partitions[part].p_size * dl.d_secsize;
+ fsize = (int64) dl.d_partitions[part].p_size * dl.d_secsize;
}
devnum = s.st_rdev;
if (size <= 0)
@@ -584,7 +584,7 @@ Span::init(char *an, ink64 size)
case S_IFDIR:
case S_IFREG:
if (size <= 0 || size > fsize) {
- Warning("bad or missing size for '%s': size %lld fsize %lld", n, (ink64) size, fsize);
+ Warning("bad or missing size for '%s': size %lld fsize %lld", n, (int64) size, fsize);
err = "bad or missing size";
goto Lfail;
}
@@ -629,7 +629,7 @@ Lfail:
const char *
-Span::init(char *filename, ink64 size)
+Span::init(char *filename, int64 size)
{
int devnum = 0, fd, arg;
int ret = 0, is_disk = 0;
@@ -985,7 +985,7 @@ Span::read(int fd)
return (-1);
}
pathname = xstrdup(p);
- if (get_ink64(fd, blocks) < 0) {
+ if (get_int64(fd, blocks) < 0) {
return -1;
}
@@ -999,7 +999,7 @@ Span::read(int fd)
return (-1);
file_pathname = (b ? true : false);
- if (get_ink64(fd, offset) < 0) {
+ if (get_int64(fd, offset) < 0) {
return -1;
}
Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterCache.cc Wed May 19 21:06:35 2010
@@ -243,8 +243,8 @@ ClusterVConnectionCache::init()
inline int
ClusterVConnectionCache::MD5ToIndex(INK_MD5 * p)
{
- inku64 i = p->fold();
- ink32 h, l;
+ uint64 i = p->fold();
+ int32 h, l;
h = i >> 32;
l = i & 0xFFFFFFFF;
return ((h ^ l) % MAX_TABLE_ENTRIES) & (MAX_TABLE_ENTRIES - 1);
@@ -477,7 +477,7 @@ CacheContinuation::do_op(Continuation *
m->frag_type = ((CacheOpArgs_General *) args)->frag_type;
if (opcode == CACHE_OPEN_WRITE) {
m->nbytes = nbytes;
- m->data = (inku32) ((CacheOpArgs_General *) args)->pin_in_cache;
+ m->data = (uint32) ((CacheOpArgs_General *) args)->pin_in_cache;
} else {
m->nbytes = 0;
m->data = 0;
@@ -535,8 +535,8 @@ CacheContinuation::do_op(Continuation *
cc->url_md5 = m->url_md5;
m->seq_number = (c ? cc->seq_number : CACHE_NO_RESPONSE);
m->nbytes = nbytes;
- m->data = (inku32) ((CacheOpArgs_General *) args)->pin_in_cache;
- m->frag_type = (inku32) ((CacheOpArgs_General *) args)->frag_type;
+ m->data = (uint32) ((CacheOpArgs_General *) args)->pin_in_cache;
+ m->frag_type = (uint32) ((CacheOpArgs_General *) args)->frag_type;
if (opcode == CACHE_OPEN_READ_LONG) {
//
@@ -1512,7 +1512,7 @@ CacheContinuation::VCdataRead(int event,
VConnection *vc = target_vio->vc_server;
int reply = CACHE_EVENT_OPEN_READ;
- ink32 object_size;
+ int32 object_size;
switch (event) {
case VC_EVENT_EOS:
@@ -1748,7 +1748,7 @@ CacheContinuation::replyOpEvent(int even
msg->token.clear(); // Tell sender no conn established
// Reallocate reply message, allowing for marshalled data
- len += sizeof(ink32);
+ len += sizeof(int32);
CacheOpReplyMsg *reply = (CacheOpReplyMsg *) ALLOCA_DOUBLE(flen + len);
// Initialize reply message header
@@ -1767,7 +1767,7 @@ CacheContinuation::replyOpEvent(int even
write_cluster_vc->remote_closed = 1; // avoid remote close msg
write_cluster_vc->do_io(VIO::CLOSE);
}
- *((ink32 *) reply->moi) = (ink32) ((uintptr_t) cvc & 0xffffffff); // code describing failure
+ *((int32 *) reply->moi) = (int32) ((uintptr_t) cvc & 0xffffffff); // code describing failure
}
// Make reply message the current message
msg = reply;
@@ -1985,7 +1985,7 @@ cache_op_result_ClusterFunction(ClusterM
int flen, len = l;
CacheHTTPInfo ci;
CacheOpReplyMsg *msg = (CacheOpReplyMsg *) data;
- ink32 op_result_error = 0;
+ int32 op_result_error = 0;
ClusterMessageHeader *mh = (ClusterMessageHeader *) data;
if (mh->GetMsgVersion() != CacheOpReplyMsg::CACHE_OP_REPLY_MESSAGE_VERSION) { ////////////////////////////////////////////////
@@ -2025,10 +2025,10 @@ cache_op_result_ClusterFunction(ClusterM
case CACHE_EVENT_DEREF_FAILED:
{
// Unmarshal the error code
- ink_assert(((len - flen) == sizeof(ink32)));
- op_result_error = *(ink32 *) msg->moi;
+ ink_assert(((len - flen) == sizeof(int32)));
+ op_result_error = *(int32 *) msg->moi;
if (mh->NeedByteSwap())
- swap32((inku32 *) & op_result_error);
+ swap32((uint32 *) & op_result_error);
op_result_error = -op_result_error;
break;
}
@@ -2718,11 +2718,11 @@ CacheContinuation::replyLookupEvent(int
return EVENT_DONE;
}
-ink32 CacheContinuation::getObjectSize(VConnection * vc, int opcode, CacheHTTPInfo * ret_ci)
+int32 CacheContinuation::getObjectSize(VConnection * vc, int opcode, CacheHTTPInfo * ret_ci)
{
CacheHTTPInfo *
ci = 0;
- ink32
+ int32
object_size = 0;
if ((opcode == CACHE_OPEN_READ_LONG)
|| (opcode == CACHE_OPEN_READ_BUFFER_LONG)) {
Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterConfig.cc?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterConfig.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterConfig.cc Wed May 19 21:06:35 2010
@@ -155,7 +155,7 @@ make_cluster_connections(MachineList * l
//
// Connect to all new machines.
//
- inku32 ip = this_cluster_machine()->ip;
+ uint32 ip = this_cluster_machine()->ip;
if (l) {
for (int i = 0; i < l->n; i++)
#ifdef LOCAL_CLUSTER_TEST_MODE
Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterHandler.cc Wed May 19 21:06:35 2010
@@ -529,7 +529,7 @@ bool ClusterHandler::build_initial_vecto
CLUSTER_INCREMENT_DYN_STAT(CLUSTER_SLOW_CTRL_MSGS_RECVD_STAT);
}
// Mark message data as invalid
- *((inku32 *) ic->data) = UNDEFINED_CLUSTER_FUNCTION;
+ *((uint32 *) ic->data) = UNDEFINED_CLUSTER_FUNCTION;
incoming_control.enqueue(ic);
}
s.iov[new_n_iov].iov_base = 0;
@@ -848,7 +848,7 @@ ClusterHandler::swap_descriptor_bytes()
void
ClusterHandler::process_set_data_msgs()
{
- inku32 cluster_function_index;
+ uint32 cluster_function_index;
//
// Cluster set_data messages must always be processed ahead of all
// messages and data. By convention, set_data messages (highest priority
@@ -864,25 +864,25 @@ ClusterHandler::process_set_data_msgs()
char *endp = p + read.msg.control_bytes;
while (p < endp) {
if (needByteSwap) {
- swap32((inku32 *) p); // length
- swap32((inku32 *) (p + sizeof(ink32))); // function code
+ swap32((uint32 *) p); // length
+ swap32((uint32 *) (p + sizeof(int32))); // function code
}
- int len = *(ink32 *) p;
- cluster_function_index = *(inku32 *) (p + sizeof(ink32));
+ int len = *(int32 *) p;
+ cluster_function_index = *(uint32 *) (p + sizeof(int32));
- if ((cluster_function_index < (inku32) SIZE_clusterFunction)
+ if ((cluster_function_index < (uint32) SIZE_clusterFunction)
&& (cluster_function_index == SET_CHANNEL_DATA_CLUSTER_FUNCTION)) {
- clusterFunction[SET_CHANNEL_DATA_CLUSTER_FUNCTION].pfn(machine, p + (2 * sizeof(inku32)), len - sizeof(inku32));
+ clusterFunction[SET_CHANNEL_DATA_CLUSTER_FUNCTION].pfn(machine, p + (2 * sizeof(uint32)), len - sizeof(uint32));
// Mark message as processed.
- *((inku32 *) (p + sizeof(inku32))) = ~*((inku32 *) (p + sizeof(inku32)));
- p += (2 * sizeof(inku32)) + (len - sizeof(inku32));
+ *((uint32 *) (p + sizeof(uint32))) = ~*((uint32 *) (p + sizeof(uint32)));
+ p += (2 * sizeof(uint32)) + (len - sizeof(uint32));
p = (char *) DOUBLE_ALIGN(p);
} else {
// Reverse swap since this message will be reprocessed.
if (needByteSwap) {
- swap32((inku32 *) p); // length
- swap32((inku32 *) (p + sizeof(ink32))); // function code
+ swap32((uint32 *) p); // length
+ swap32((uint32 *) (p + sizeof(int32))); // function code
}
break; // End of set_data messages
}
@@ -898,31 +898,31 @@ ClusterHandler::process_set_data_msgs()
while (ic) {
if (needByteSwap) {
- swap32((inku32 *) ic->data); // function code
+ swap32((uint32 *) ic->data); // function code
}
- cluster_function_index = *((inku32 *) ic->data);
+ cluster_function_index = *((uint32 *) ic->data);
- if ((cluster_function_index < (inku32) SIZE_clusterFunction)
+ if ((cluster_function_index < (uint32) SIZE_clusterFunction)
&& (cluster_function_index == SET_CHANNEL_DATA_CLUSTER_FUNCTION)) {
char *p = ic->data;
clusterFunction[SET_CHANNEL_DATA_CLUSTER_FUNCTION].pfn(machine,
- (void *) (p + sizeof(ink32)), ic->len - sizeof(ink32));
+ (void *) (p + sizeof(int32)), ic->len - sizeof(int32));
// Reverse swap since this will be processed again for deallocation.
if (needByteSwap) {
- swap32((inku32 *) p); // length
- swap32((inku32 *) (p + sizeof(ink32))); // function code
+ swap32((uint32 *) p); // length
+ swap32((uint32 *) (p + sizeof(int32))); // function code
}
// Mark message as processed.
// Defer dellocation until entire read is complete.
- *((inku32 *) p) = ~*((inku32 *) p);
+ *((uint32 *) p) = ~*((uint32 *) p);
ic = (IncomingControl *) ic->link.next;
} else {
// Reverse swap action this message will be reprocessed.
if (needByteSwap) {
- swap32((inku32 *) ic->data); // function code
+ swap32((uint32 *) ic->data); // function code
}
break;
}
@@ -950,15 +950,15 @@ ClusterHandler::process_small_control_ms
// incoming queue for processing by callout threads.
/////////////////////////////////////////////////////////////////
if (needByteSwap) {
- swap32((inku32 *) p); // length
- swap32((inku32 *) (p + sizeof(ink32))); // function code
+ swap32((uint32 *) p); // length
+ swap32((uint32 *) (p + sizeof(int32))); // function code
}
- int len = *(ink32 *) p;
- p += sizeof(ink32);
- inku32 cluster_function_index = *(inku32 *) p;
+ int len = *(int32 *) p;
+ p += sizeof(int32);
+ uint32 cluster_function_index = *(uint32 *) p;
ink_release_assert(cluster_function_index != SET_CHANNEL_DATA_CLUSTER_FUNCTION);
- if (cluster_function_index >= (inku32) SIZE_clusterFunction) {
+ if (cluster_function_index >= (uint32) SIZE_clusterFunction) {
Warning("1Bad cluster function index (small control)");
p += len;
@@ -966,9 +966,9 @@ ClusterHandler::process_small_control_ms
//////////////////////////////////////////////////////////////////////
// Cluster function, can only be processed in ET_CLUSTER thread
//////////////////////////////////////////////////////////////////////
- p += sizeof(inku32);
- clusterFunction[cluster_function_index].pfn(machine, p, len - sizeof(ink32));
- p += (len - sizeof(ink32));
+ p += sizeof(uint32);
+ clusterFunction[cluster_function_index].pfn(machine, p, len - sizeof(int32));
+ p += (len - sizeof(int32));
} else {
///////////////////////////////////////////////////////
@@ -1001,16 +1001,16 @@ ClusterHandler::process_large_control_ms
// incoming queue for processing by callout threads.
////////////////////////////////////////////////////////////////
IncomingControl *ic = NULL;
- inku32 cluster_function_index;
+ uint32 cluster_function_index;
while ((ic = incoming_control.dequeue())) {
if (needByteSwap) {
- swap32((inku32 *) ic->data); // function code
+ swap32((uint32 *) ic->data); // function code
}
- cluster_function_index = *((inku32 *) ic->data);
+ cluster_function_index = *((uint32 *) ic->data);
ink_release_assert(cluster_function_index != SET_CHANNEL_DATA_CLUSTER_FUNCTION);
- if (cluster_function_index == (inku32) ~ SET_CHANNEL_DATA_CLUSTER_FUNCTION) {
+ if (cluster_function_index == (uint32) ~ SET_CHANNEL_DATA_CLUSTER_FUNCTION) {
// SET_CHANNEL_DATA_CLUSTER_FUNCTION already processed.
// Just do memory deallocation.
@@ -1019,14 +1019,14 @@ ClusterHandler::process_large_control_ms
continue;
}
- if (cluster_function_index >= (inku32) SIZE_clusterFunction) {
+ if (cluster_function_index >= (uint32) SIZE_clusterFunction) {
Warning("Bad cluster function index (large control)");
ic->freeall();
} else if (clusterFunction[cluster_function_index].ClusterFunc) {
// Cluster message, process in ET_CLUSTER thread
- clusterFunction[cluster_function_index].pfn(machine, (void *) (ic->data + sizeof(ink32)),
- ic->len - sizeof(ink32));
+ clusterFunction[cluster_function_index].pfn(machine, (void *) (ic->data + sizeof(int32)),
+ ic->len - sizeof(int32));
// Deallocate memory
if (!clusterFunction[cluster_function_index].fMalloced)
@@ -1207,15 +1207,15 @@ ClusterHandler::process_incoming_callout
if (small_control_msg) {
int len = ic->len;
char *p = ic->data;
- inku32 cluster_function_index = *(inku32 *) p;
- p += sizeof(inku32);
+ uint32 cluster_function_index = *(uint32 *) p;
+ p += sizeof(uint32);
- if (cluster_function_index < (inku32) SIZE_clusterFunction) {
+ if (cluster_function_index < (uint32) SIZE_clusterFunction) {
////////////////////////////////
// Invoke processing function
////////////////////////////////
ink_assert(!clusterFunction[cluster_function_index].ClusterFunc);
- clusterFunction[cluster_function_index].pfn(machine, p, len - sizeof(ink32));
+ clusterFunction[cluster_function_index].pfn(machine, p, len - sizeof(int32));
now = ink_get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CTRL_MSGS_RECV_TIME_STAT, now - ic->recognized_time);
} else {
@@ -1227,17 +1227,17 @@ ClusterHandler::process_incoming_callout
} else {
ink_assert(ic->len > 4);
- inku32 cluster_function_index = *(inku32 *) ic->data;
+ uint32 cluster_function_index = *(uint32 *) ic->data;
bool valid_index;
- if (cluster_function_index < (inku32) SIZE_clusterFunction) {
+ if (cluster_function_index < (uint32) SIZE_clusterFunction) {
valid_index = true;
////////////////////////////////
// Invoke processing function
////////////////////////////////
ink_assert(!clusterFunction[cluster_function_index].ClusterFunc);
- clusterFunction[cluster_function_index].pfn(machine, (void *) (ic->data + sizeof(ink32)),
- ic->len - sizeof(ink32));
+ clusterFunction[cluster_function_index].pfn(machine, (void *) (ic->data + sizeof(int32)),
+ ic->len - sizeof(int32));
now = ink_get_hrtime();
CLUSTER_SUM_DYN_STAT(CLUSTER_CTRL_MSGS_RECV_TIME_STAT, now - ic->recognized_time);
} else {
@@ -1561,7 +1561,7 @@ ClusterHandler::update_channels_written(
invoke_remote_data_args *args;
OutgoingControl *hdr_oc;
while ((hdr_oc = write.msg.outgoing_callout.dequeue())) {
- args = (invoke_remote_data_args *) (hdr_oc->data + sizeof(ink32));
+ args = (invoke_remote_data_args *) (hdr_oc->data + sizeof(int32));
ink_assert(args->magicno == invoke_remote_data_args::MagicNo);
// Free data descriptor
@@ -1735,17 +1735,17 @@ ClusterHandler::build_controlmsg_descrip
continue;
} else {
- compound_msg = (*((ink32 *) c->data) == -1); // (msg+chan data)?
+ compound_msg = (*((int32 *) c->data) == -1); // (msg+chan data)?
}
if (!compound_msg && c->len <= SMALL_CONTROL_MESSAGE &&
// check if the receiving cluster function will want to malloc'ed data
- !clusterFunction[*(ink32 *) c->data].fMalloced && control_bytes + c->len + sizeof(ink32) * 2 + 7 < CONTROL_DATA) {
+ !clusterFunction[*(int32 *) c->data].fMalloced && control_bytes + c->len + sizeof(int32) * 2 + 7 < CONTROL_DATA) {
write.msg.outgoing_small_control.enqueue(c);
- control_bytes += c->len + sizeof(ink32) * 2 + 7; // safe approximation
+ control_bytes += c->len + sizeof(int32) * 2 + 7; // safe approximation
control_msgs_built++;
- if (clusterFunction[*(ink32 *) c->data].post_pfn) {
- clusterFunction[*(ink32 *) c->data].post_pfn(machine, c->data + sizeof(ink32), c->len);
+ if (clusterFunction[*(int32 *) c->data].post_pfn) {
+ clusterFunction[*(int32 *) c->data].post_pfn(machine, c->data + sizeof(int32), c->len);
}
continue;
}
@@ -1754,7 +1754,7 @@ ClusterHandler::build_controlmsg_descrip
//
if (compound_msg) {
// Extract out components of compound message.
- invoke_remote_data_args *cmhdr = (invoke_remote_data_args *) (c->data + sizeof(ink32));
+ invoke_remote_data_args *cmhdr = (invoke_remote_data_args *) (c->data + sizeof(int32));
OutgoingControl *oc_header = c;
OutgoingControl *oc_msg = cmhdr->msg_oc;
OutgoingControl *oc_data = cmhdr->data_oc;
@@ -1841,8 +1841,8 @@ ClusterHandler::build_controlmsg_descrip
tcount++;
control_msgs_built++;
- if (clusterFunction[*(ink32 *) c->data].post_pfn) {
- clusterFunction[*(ink32 *) c->data].post_pfn(machine, c->data + sizeof(ink32), c->len);
+ if (clusterFunction[*(int32 *) c->data].post_pfn) {
+ clusterFunction[*(int32 *) c->data].post_pfn(machine, c->data + sizeof(int32), c->len);
}
}
}
@@ -1859,8 +1859,8 @@ ClusterHandler::add_small_controlmsg_des
OutgoingControl *c = NULL;
while ((c = write.msg.outgoing_small_control.dequeue())) {
- *(ink32 *) p = c->len;
- p += sizeof(ink32);
+ *(int32 *) p = c->len;
+ p += sizeof(int32);
memcpy(p, c->data, c->len);
c->free_data();
c->mutex = NULL;
Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterHandlerBase.cc Wed May 19 21:06:35 2010
@@ -66,20 +66,20 @@ Continuation(NULL), len(0), size_index(-
}
void
-ClusterControl::real_alloc_data(int read_access, bool align_ink32_on_non_ink64_boundary)
+ClusterControl::real_alloc_data(int read_access, bool align_int32_on_non_int64_boundary)
{
EThread *thread = this_ethread();
ProxyMutex *mutex = thread->mutex;
ink_assert(!data);
- if ((len + DATA_HDR + sizeof(ink32)) <= DEFAULT_MAX_BUFFER_SIZE) {
- size_index = buffer_size_to_index(len + DATA_HDR + sizeof(ink32), MAX_BUFFER_SIZE_INDEX);
+ if ((len + DATA_HDR + sizeof(int32)) <= DEFAULT_MAX_BUFFER_SIZE) {
+ size_index = buffer_size_to_index(len + DATA_HDR + sizeof(int32), MAX_BUFFER_SIZE_INDEX);
iob_block = new_IOBufferBlock();
iob_block->alloc(size_index); // aligns on 8 byte boundary
- real_data = (ink64 *) iob_block->buf();
+ real_data = (int64 *) iob_block->buf();
- if (align_ink32_on_non_ink64_boundary) {
- data = ((char *) real_data) + sizeof(ink32) + DATA_HDR;
+ if (align_int32_on_non_int64_boundary) {
+ data = ((char *) real_data) + sizeof(int32) + DATA_HDR;
} else {
data = ((char *) real_data) + DATA_HDR;
}
@@ -87,14 +87,14 @@ ClusterControl::real_alloc_data(int read
memset((char *) real_data, 0, BUFFER_SIZE_FOR_INDEX(size_index));
#endif
} else {
- int size = sizeof(ink64) * (((len + DATA_HDR + sizeof(ink32) + sizeof(ink64) - 1) / sizeof(ink64)) + 1);
+ int size = sizeof(int64) * (((len + DATA_HDR + sizeof(int32) + sizeof(int64) - 1) / sizeof(int64)) + 1);
size_index = -1;
iob_block = new_IOBufferBlock();
iob_block->alloc(BUFFER_SIZE_FOR_XMALLOC(size));
- real_data = (ink64 *) iob_block->buf();
+ real_data = (int64 *) iob_block->buf();
- if (align_ink32_on_non_ink64_boundary) {
- data = (char *) DOUBLE_ALIGN(real_data) + sizeof(ink32) + DATA_HDR;
+ if (align_int32_on_non_int64_boundary) {
+ data = (char *) DOUBLE_ALIGN(real_data) + sizeof(int32) + DATA_HDR;
} else {
data = (char *) DOUBLE_ALIGN(real_data) + DATA_HDR;
}
@@ -140,8 +140,8 @@ ClusterControl::free_data()
return;
}
if (real_data) {
- ink_release_assert(*(((inku8 *) data) - DATA_HDR + 1) == (inku8) ALLOC_DATA_MAGIC);
- *(((inku8 *) data) - DATA_HDR + 1) = (inku8) ~ ALLOC_DATA_MAGIC;
+ ink_release_assert(*(((uint8 *) data) - DATA_HDR + 1) == (uint8) ALLOC_DATA_MAGIC);
+ *(((uint8 *) data) - DATA_HDR + 1) = (uint8) ~ ALLOC_DATA_MAGIC;
if (size_index >= 0) {
ink_release_assert(*(((char *) data) - DATA_HDR) == size_index);
@@ -205,8 +205,8 @@ OutgoingControl::startEvent(int event, E
if (!ch || !ch->thread)
return EVENT_DONE;
- ink32 cluster_fn = *(ink32 *) this->data;
- ink32 pri = ClusterFuncToQpri(cluster_fn);
+ int32 cluster_fn = *(int32 *) this->data;
+ int32 pri = ClusterFuncToQpri(cluster_fn);
ink_atomiclist_push(&ch->outgoing_control_al[pri], (void *) this);
return EVENT_DONE;
@@ -267,7 +267,7 @@ n_byte_bank(0), byte_bank_size(0), misse
iob_iov = new_IOBufferData(BUFFER_SIZE_FOR_XMALLOC(size));
iov = (IOVec *) iob_iov->data();
- inku64 page_addr = (inku64) (((inku64) ((int_pointer) iov) + (inku64) pagesize) & ~(pagesize - 1));
+ uint64 page_addr = (uint64) (((uint64) ((int_pointer) iov) + (uint64) pagesize) & ~(pagesize - 1));
iov = (IOVec *) ((int_pointer) page_addr);
#if (defined(__sparc) || defined(__alpha))
@@ -285,13 +285,13 @@ n_byte_bank(0), byte_bank_size(0), misse
msg.iob_descriptor_block->alloc(BUFFER_SIZE_FOR_XMALLOC(size));
char *a = msg.iob_descriptor_block->data->data();
- page_addr = (inku64) (((inku64) ((int_pointer) a) + (inku64) pagesize) & ~(pagesize - 1));
+ page_addr = (uint64) (((uint64) ((int_pointer) a) + (uint64) pagesize) & ~(pagesize - 1));
#if (defined(__sparc) || defined(__alpha))
if (mprotect((char *) page_addr, pagesize, PROT_NONE))
perror("ClusterState mprotect failed");
#endif
- a = (char *) ((int_pointer) (page_addr + (inku64) pagesize));
+ a = (char *) ((int_pointer) (page_addr + (uint64) pagesize));
memset(a, 0, size - (2 * pagesize));
msg.descriptor = (Descriptor *) (a + sizeof(ClusterMsgHeader));
@@ -1386,7 +1386,7 @@ ClusterHandler::dump_write_msg(int res)
// Debug support for inter cluster message trace
unsigned char x[4];
memset(x, 0, sizeof(x));
- *(inku32 *) & x = (inku32) net_vc->get_remote_addr().sin_addr.s_addr;
+ *(uint32 *) & x = (uint32) net_vc->get_remote_addr().sin_addr.s_addr;
fprintf(stderr,
"[W] %u.%u.%u.%u SeqNo=%d, Cnt=%d, CntlCnt=%d Todo=%d, Res=%d\n",
@@ -1405,7 +1405,7 @@ ClusterHandler::dump_read_msg()
// Debug support for inter cluster message trace
unsigned char x[4];
memset(x, 0, sizeof(x));
- *(inku32 *) & x = (inku32) net_vc->get_remote_addr().sin_addr.s_addr;
+ *(uint32 *) & x = (uint32) net_vc->get_remote_addr().sin_addr.s_addr;
fprintf(stderr, "[R] %u.%u.%u.%u SeqNo=%d, Cnt=%d, CntlCnt=%d\n",
x[0], x[1], x[2], x[3], read.sequence_number, read.msg.count, read.msg.control_bytes);
Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterMachine.cc Wed May 19 21:06:35 2010
@@ -132,7 +132,7 @@ clusterHandler(0)
if (r == NULL) {
unsigned char x[4];
memset(x, 0, sizeof(x));
- *(inku32 *) & x = (inku32) ip;
+ *(uint32 *) & x = (uint32) ip;
Debug("machine_debug", "unable to reverse DNS %u.%u.%u.%u: %d", x[0], x[1], x[2], x[3], data.herrno);
} else
hostname = xstrdup(r->h_name);
Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterProcessor.cc Wed May 19 21:06:35 2010
@@ -67,14 +67,14 @@ ClusterProcessor::internal_invoke_remote
OutgoingControl *c;
ClusterHandler *ch = m->clusterHandler;
- if (!ch || (!malloced && !((unsigned int) cluster_fn < (inku32) SIZE_clusterFunction))) {
+ if (!ch || (!malloced && !((unsigned int) cluster_fn < (uint32) SIZE_clusterFunction))) {
// Invalid message or node is down, free message data
if (malloced) {
xfree(data);
}
if (cmsg) {
invoke_remote_data_args *args = (invoke_remote_data_args *)
- (((OutgoingControl *) cmsg)->data + sizeof(ink32));
+ (((OutgoingControl *) cmsg)->data + sizeof(int32));
ink_assert(args->magicno == invoke_remote_data_args::MagicNo);
args->data_oc->freeall();
@@ -100,15 +100,15 @@ ClusterProcessor::internal_invoke_remote
c->set_data((char *) data, len);
} else {
if (!data_in_ocntl) {
- c->len = len + sizeof(ink32);
+ c->len = len + sizeof(int32);
c->alloc_data();
}
if (!c->fast_data()) {
CLUSTER_INCREMENT_DYN_STAT(CLUSTER_SLOW_CTRL_MSGS_SENT_STAT);
}
- *(ink32 *) c->data = cluster_fn;
+ *(int32 *) c->data = cluster_fn;
if (!data_in_ocntl) {
- memcpy(c->data + sizeof(ink32), data, len);
+ memcpy(c->data + sizeof(int32), data, len);
}
}
@@ -119,7 +119,7 @@ ClusterProcessor::internal_invoke_remote
/////////////////////////////////////
if (cmsg) {
invoke_remote_data_args *args = (invoke_remote_data_args *)
- (((OutgoingControl *) cmsg)->data + sizeof(ink32));
+ (((OutgoingControl *) cmsg)->data + sizeof(int32));
ink_assert(args->magicno == invoke_remote_data_args::MagicNo);
args->msg_oc = c;
c = (OutgoingControl *) cmsg;
@@ -189,10 +189,10 @@ ClusterProcessor::invoke_remote_data(Clu
OutgoingControl *chdr = OutgoingControl::alloc();
chdr->submit_time = ink_get_hrtime();
- chdr->len = sizeof(ink32) + sizeof(mh);
+ chdr->len = sizeof(int32) + sizeof(mh);
chdr->alloc_data();
- *(ink32 *) chdr->data = -1; // always -1 for compound message
- memcpy(chdr->data + sizeof(ink32), (char *) &mh, sizeof(mh));
+ *(int32 *) chdr->data = -1; // always -1 for compound message
+ memcpy(chdr->data + sizeof(int32), (char *) &mh, sizeof(mh));
return internal_invoke_remote(m, cluster_fn, data, data_len, options, (void *) chdr);
}
@@ -200,10 +200,10 @@ ClusterProcessor::invoke_remote_data(Clu
void
ClusterProcessor::free_remote_data(char *p, int l)
{
- char *d = p - sizeof(ink32); // reset to ptr to function code
+ char *d = p - sizeof(int32); // reset to ptr to function code
int data_hdr = ClusterControl::DATA_HDR;
- ink_release_assert(*((inku8 *) (d - data_hdr + 1)) == (inku8) ALLOC_DATA_MAGIC);
+ ink_release_assert(*((uint8 *) (d - data_hdr + 1)) == (uint8) ALLOC_DATA_MAGIC);
char size_index = *(d - data_hdr);
if (size_index >= 0) {
ink_release_assert((0 <= size_index) && (size_index <= (DEFAULT_BUFFER_SIZES - 1)));
@@ -862,7 +862,7 @@ ClusterProcessor::send_machine_list(Clus
}
msg->n_ip = n;
data = (void *) msg;
- len = msg->sizeof_fixedlen_msg() + (n * sizeof(inku32));
+ len = msg->sizeof_fixedlen_msg() + (n * sizeof(uint32));
} else {
//////////////////////////////////////////////////////////////
Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterRPC.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterRPC.cc?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterRPC.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterRPC.cc Wed May 19 21:06:35 2010
@@ -68,7 +68,7 @@ machine_list_ClusterFunction(ClusterMach
if (m->NeedByteSwap())
m->SwapBytes();
- ink_assert(m->n_ip == ((len - m->sizeof_fixedlen_msg()) / sizeof(inku32)));
+ ink_assert(m->n_ip == ((len - m->sizeof_fixedlen_msg()) / sizeof(uint32)));
//
// The machine list is a vector of ip's stored in network byte order.
@@ -127,7 +127,7 @@ test_ClusterFunction(ClusterMachine * m,
}
CacheVC *
-ChannelToCacheWriteVC(ClusterHandler * ch, int channel, inku32 channel_seqno, ClusterVConnection ** cluster_vc)
+ChannelToCacheWriteVC(ClusterHandler * ch, int channel, uint32 channel_seqno, ClusterVConnection ** cluster_vc)
{
EThread *thread = this_ethread();
ProxyMutex *mutex = thread->mutex;
@@ -172,7 +172,7 @@ set_channel_data_ClusterFunction(Cluster
ic->len = tlen;
ic->alloc_data();
- data = ic->data + sizeof(ink32); // free_remote_data expects d+sizeof(ink32)
+ data = ic->data + sizeof(int32); // free_remote_data expects d+sizeof(int32)
memcpy(data, tdata, tlen);
len = tlen;
Modified: trafficserver/traffic/trunk/iocore/cluster/ClusterVConnection.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/ClusterVConnection.cc?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/ClusterVConnection.cc (original)
+++ trafficserver/traffic/trunk/iocore/cluster/ClusterVConnection.cc Wed May 19 21:06:35 2010
@@ -70,7 +70,7 @@ int
#endif
VIO *
-ClusterVConnectionBase::do_io_read(Continuation * acont, ink64 anbytes, MIOBuffer * abuffer)
+ClusterVConnectionBase::do_io_read(Continuation * acont, int64 anbytes, MIOBuffer * abuffer)
{
ink_assert(!closed);
read.vio.buffer.writer_for(abuffer);
@@ -87,7 +87,7 @@ ClusterVConnectionBase::do_io_read(Conti
}
VIO *
-ClusterVConnectionBase::do_io_pread(Continuation * acont, ink64 anbytes, MIOBuffer * abuffer, ink64 off)
+ClusterVConnectionBase::do_io_pread(Continuation * acont, int64 anbytes, MIOBuffer * abuffer, int64 off)
{
ink_assert(!"implemented");
return 0;
@@ -115,7 +115,7 @@ ClusterVConnection::get_single_data(void
}
VIO *
-ClusterVConnectionBase::do_io_write(Continuation * acont, ink64 anbytes, IOBufferReader * abuffer, bool owner)
+ClusterVConnectionBase::do_io_write(Continuation * acont, int64 anbytes, IOBufferReader * abuffer, bool owner)
{
ink_assert(!closed);
ink_assert(!owner);
Modified: trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h (original)
+++ trafficserver/traffic/trunk/iocore/cluster/P_ClusterCache.h Wed May 19 21:06:35 2010
@@ -106,44 +106,44 @@
// Miscellaneous byte swap routines
//////////////////////////////////////////////////////////////
inline void
-swap16(inku16 * d)
+swap16(uint16 * d)
{
unsigned char *p = (unsigned char *) d;
*d = ((p[1] << 8) | p[0]);
}
-inline inku16
-swap16(inku16 d)
+inline uint16
+swap16(uint16 d)
{
swap16(&d);
return d;
}
inline void
-swap32(inku32 * d)
+swap32(uint32 * d)
{
unsigned char *p = (unsigned char *) d;
*d = ((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]);
}
-inline inku32
-swap32(inku32 d)
+inline uint32
+swap32(uint32 d)
{
swap32(&d);
return d;
}
inline void
-swap64(inku64 * d)
+swap64(uint64 * d)
{
unsigned char *p = (unsigned char *) d;
- *d = (((inku64) p[7] << 56) | ((inku64) p[6] << 48) |
- ((inku64) p[5] << 40) | ((inku64) p[4] << 32) |
- ((inku64) p[3] << 24) | ((inku64) p[2] << 16) | ((inku64) p[1] << 8) | (inku64) p[0]);
+ *d = (((uint64) p[7] << 56) | ((uint64) p[6] << 48) |
+ ((uint64) p[5] << 40) | ((uint64) p[4] << 32) |
+ ((uint64) p[3] << 24) | ((uint64) p[2] << 16) | ((uint64) p[1] << 8) | (uint64) p[0]);
}
-inline inku64
-swap64(inku64 d)
+inline uint64
+swap64(uint64 d)
{
swap64(&d);
return d;
@@ -284,8 +284,8 @@ struct ClusterVCToken
//
// Marshal this data to send the token across the cluster
//
- inku32 ip_created;
- inku32 sequence_number;
+ uint32 ip_created;
+ uint32 sequence_number;
bool is_clear()
{
@@ -350,15 +350,15 @@ struct ClusterVConnectionBase:CacheVConn
// creation callback.
//
- virtual VIO *do_io_read(Continuation * c, ink64 nbytes, MIOBuffer * buf);
- virtual VIO *do_io_write(Continuation * c, ink64 nbytes, IOBufferReader * buf, bool owner = false);
+ virtual VIO *do_io_read(Continuation * c, int64 nbytes, MIOBuffer * buf);
+ virtual VIO *do_io_write(Continuation * c, int64 nbytes, IOBufferReader * buf, bool owner = false);
virtual void do_io_shutdown(ShutdownHowTo_t howto)
{
(void) howto;
ink_assert(!"shutdown of cluster connection");
}
virtual void do_io_close(int lerrno = -1);
- virtual VIO* do_io_pread(Continuation*, ink64, MIOBuffer*, ink64);
+ virtual VIO* do_io_pread(Continuation*, int64, MIOBuffer*, int64);
// Set the timeouts associated with this connection.
// active_timeout is for the total elasped time of the connection.
@@ -615,7 +615,7 @@ struct ClusterVConnection:ClusterVConnec
struct ClusterRemoteDataHeader
{
- ink32 cluster_function;
+ int32 cluster_function;
};
//
// ClusterProcessor
@@ -994,13 +994,13 @@ ClusterFuncToQpri(int cluster_func)
//////////////////////////////////////////////
struct ClusterHelloMessage
{
- inku16 _NativeByteOrder;
- inku16 _major;
- inku16 _minor;
- inku16 _min_major;
- inku16 _min_minor;
+ uint16 _NativeByteOrder;
+ uint16 _major;
+ uint16 _minor;
+ uint16 _min_major;
+ uint16 _min_minor;
#ifdef LOCAL_CLUSTER_TEST_MODE
- ink16 _port;
+ int16 _port;
char _pad[116]; // pad out to 128 bytes
#else
char _pad[118]; // pad out to 128 bytes
@@ -1034,10 +1034,10 @@ struct ClusterHelloMessage
///////////////////////////////////////////////////////////////////
struct ClusterMessageHeader
{
- inku16 _InNativeByteOrder; // always non-zero
- inku16 _MsgVersion; // always non-zero
+ uint16 _InNativeByteOrder; // always non-zero
+ uint16 _MsgVersion; // always non-zero
- void _init(inku16 msg_version)
+ void _init(uint16 msg_version)
{
_InNativeByteOrder = 1;
_MsgVersion = msg_version;
@@ -1045,7 +1045,7 @@ struct ClusterMessageHeader
ClusterMessageHeader():_InNativeByteOrder(0), _MsgVersion(0)
{
}
- ClusterMessageHeader(inku16 msg_version) {
+ ClusterMessageHeader(uint16 msg_version) {
_init(msg_version);
}
int MsgInNativeByteOrder()
@@ -1085,7 +1085,7 @@ struct PingMessage:public ClusterMessage
PING_MESSAGE_VERSION = MAX_VERSION
};
- PingMessage(inku16 vers = PING_MESSAGE_VERSION)
+ PingMessage(uint16 vers = PING_MESSAGE_VERSION)
: ClusterMessageHeader(vers), fn(NULL) {
data[0] = '\0';
}
@@ -1101,7 +1101,7 @@ struct PingMessage:public ClusterMessage
// Maybe use offsetof here instead. /leif
return (uintptr_t) (&p->data[0]);
}
- void init(inku16 vers = PING_MESSAGE_VERSION) {
+ void init(uint16 vers = PING_MESSAGE_VERSION) {
_init(vers);
}
inline void SwapBytes()
Modified: trafficserver/traffic/trunk/iocore/cluster/P_ClusterCacheInternal.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/P_ClusterCacheInternal.h?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/P_ClusterCacheInternal.h (original)
+++ trafficserver/traffic/trunk/iocore/cluster/P_ClusterCacheInternal.h Wed May 19 21:06:35 2010
@@ -110,7 +110,7 @@ struct CacheContinuation:public Continua
int result_error; // error code associated with event
ClusterVCToken token;
unsigned int seq_number;
- inku16 cfl_flags; // Request flags; see CFL_XXX defines
+ uint16 cfl_flags; // Request flags; see CFL_XXX defines
CacheFragType frag_type;
int nbytes;
unsigned int target_ip;
@@ -336,7 +336,7 @@ CacheContinuation():
static int setup_local_vc(char *data, int data_len, CacheContinuation * cc, ClusterMachine * mp, Action **);
static void disposeOfDataBuffer(void *buf);
static int handleDisposeEvent(int event, CacheContinuation * cc);
- static ink32 getObjectSize(VConnection *, int, CacheHTTPInfo *);
+ static int32 getObjectSize(VConnection *, int, CacheHTTPInfo *);
};
/////////////////////////////////////////
@@ -357,7 +357,7 @@ struct CacheOpArgs_General
INK_MD5 *url_md5;
time_t pin_in_cache; // open_write() specific arg
CacheFragType frag_type;
- inku16 cfl_flags;
+ uint16 cfl_flags;
CacheOpArgs_General():url_md5(NULL), pin_in_cache(0), frag_type(CACHE_FRAG_TYPE_NONE), cfl_flags(0)
{
@@ -368,7 +368,7 @@ struct CacheOpArgs_Link
{
INK_MD5 *from;
INK_MD5 *to;
- inku16 cfl_flags; // see CFL_XXX defines
+ uint16 cfl_flags; // see CFL_XXX defines
CacheFragType frag_type;
CacheOpArgs_Link():from(NULL), to(NULL), cfl_flags(0), frag_type(CACHE_FRAG_TYPE_NONE)
@@ -379,7 +379,7 @@ struct CacheOpArgs_Link
struct CacheOpArgs_Deref
{
INK_MD5 *md5;
- inku16 cfl_flags; // see CFL_XXX defines
+ uint16 cfl_flags; // see CFL_XXX defines
CacheFragType frag_type;
CacheOpArgs_Deref():md5(NULL), cfl_flags(0), frag_type(CACHE_FRAG_TYPE_NONE)
@@ -393,16 +393,16 @@ struct CacheOpArgs_Deref
struct CacheLookupMsg:public ClusterMessageHeader
{
INK_MD5 url_md5;
- inku32 seq_number;
- inku32 frag_type;
- inku8 moi[4];
+ uint32 seq_number;
+ uint32 frag_type;
+ uint8 moi[4];
enum
{
MIN_VERSION = 1,
MAX_VERSION = 1,
CACHE_LOOKUP_MESSAGE_VERSION = MAX_VERSION
};
- CacheLookupMsg(inku16 vers = CACHE_LOOKUP_MESSAGE_VERSION):
+ CacheLookupMsg(uint16 vers = CACHE_LOOKUP_MESSAGE_VERSION):
ClusterMessageHeader(vers), seq_number(0), frag_type(0) {
memset(moi, 0, sizeof(moi));
}
@@ -420,7 +420,7 @@ struct CacheLookupMsg:public ClusterMess
// Maybe use offsetoff here instead. /leif
return (int) ALIGN_DOUBLE(&p->moi[0]);
}
- void init(inku16 vers = CACHE_LOOKUP_MESSAGE_VERSION) {
+ void init(uint16 vers = CACHE_LOOKUP_MESSAGE_VERSION) {
_init(vers);
}
inline void SwapBytes()
@@ -436,24 +436,24 @@ struct CacheLookupMsg:public ClusterMess
struct CacheOpMsg_long:public ClusterMessageHeader
{
- inku8 opcode;
- inku8 frag_type;
- inku16 cfl_flags; // see CFL_XXX defines
+ uint8 opcode;
+ uint8 frag_type;
+ uint16 cfl_flags; // see CFL_XXX defines
INK_MD5 url_md5;
- inku32 seq_number;
- inku32 nbytes;
- inku32 data; // used by open_write()
- ink32 channel; // used by open interfaces
+ uint32 seq_number;
+ uint32 nbytes;
+ uint32 data; // used by open_write()
+ int32 channel; // used by open interfaces
ClusterVCToken token;
- ink32 buffer_size; // used by open read interface
- inku8 moi[4];
+ int32 buffer_size; // used by open read interface
+ uint8 moi[4];
enum
{
MIN_VERSION = 1,
MAX_VERSION = 1,
CACHE_OP_LONG_MESSAGE_VERSION = MAX_VERSION
};
- CacheOpMsg_long(inku16 vers = CACHE_OP_LONG_MESSAGE_VERSION):
+ CacheOpMsg_long(uint16 vers = CACHE_OP_LONG_MESSAGE_VERSION):
ClusterMessageHeader(vers),
opcode(0), frag_type(0), cfl_flags(0), seq_number(0), nbytes(0), data(0), channel(0), buffer_size(0) {
memset(moi, 0, sizeof(moi));
@@ -472,7 +472,7 @@ struct CacheOpMsg_long:public ClusterMes
// Change to offsetof maybe? /leif
return (int) ALIGN_DOUBLE(&p->moi[0]);
}
- void init(inku16 vers = CACHE_OP_LONG_MESSAGE_VERSION) {
+ void init(uint16 vers = CACHE_OP_LONG_MESSAGE_VERSION) {
_init(vers);
}
inline void SwapBytes()
@@ -483,10 +483,10 @@ struct CacheOpMsg_long:public ClusterMes
swap32(&seq_number);
swap32(&nbytes);
swap32(&data);
- swap32((inku32 *) & channel);
+ swap32((uint32 *) & channel);
token.SwapBytes();
- swap32((inku32 *) & buffer_size);
- swap32((inku32 *) & frag_type);
+ swap32((uint32 *) & buffer_size);
+ swap32((uint32 *) & frag_type);
}
}
//////////////////////////////////////////////////////////////////////////
@@ -494,26 +494,26 @@ struct CacheOpMsg_long:public ClusterMes
struct CacheOpMsg_short:public ClusterMessageHeader
{
- inku8 opcode;
- inku8 frag_type; // currently used by open_write() (low level)
- inku16 cfl_flags; // see CFL_XXX defines
+ uint8 opcode;
+ uint8 frag_type; // currently used by open_write() (low level)
+ uint16 cfl_flags; // see CFL_XXX defines
INK_MD5 md5;
- inku32 seq_number;
- inku32 nbytes;
- inku32 data; // currently used by open_write() (low level)
- ink32 channel; // used by open interfaces
+ uint32 seq_number;
+ uint32 nbytes;
+ uint32 data; // currently used by open_write() (low level)
+ int32 channel; // used by open interfaces
ClusterVCToken token; // used by open interfaces
- ink32 buffer_size; // used by open read interface
+ int32 buffer_size; // used by open read interface
// Variable portion of message
- inku8 moi[4];
+ uint8 moi[4];
enum
{
MIN_VERSION = 1,
MAX_VERSION = 1,
CACHE_OP_SHORT_MESSAGE_VERSION = MAX_VERSION
};
- CacheOpMsg_short(inku16 vers = CACHE_OP_SHORT_MESSAGE_VERSION):
+ CacheOpMsg_short(uint16 vers = CACHE_OP_SHORT_MESSAGE_VERSION):
ClusterMessageHeader(vers),
opcode(0), frag_type(0), cfl_flags(0), seq_number(0), nbytes(0), data(0), channel(0), buffer_size(0) {
memset(moi, 0, sizeof(moi));
@@ -531,7 +531,7 @@ struct CacheOpMsg_short:public ClusterMe
// Use offsetof. /leif
return (int) ALIGN_DOUBLE(&p->moi[0]);
}
- void init(inku16 vers = CACHE_OP_SHORT_MESSAGE_VERSION) {
+ void init(uint16 vers = CACHE_OP_SHORT_MESSAGE_VERSION) {
_init(vers);
}
inline void SwapBytes()
@@ -543,8 +543,8 @@ struct CacheOpMsg_short:public ClusterMe
swap32(&nbytes);
swap32(&data);
if (opcode == CACHE_OPEN_READ) {
- swap32((inku32 *) & buffer_size);
- swap32((inku32 *) & channel);
+ swap32((uint32 *) & buffer_size);
+ swap32((uint32 *) & channel);
token.SwapBytes();
}
}
@@ -554,20 +554,20 @@ struct CacheOpMsg_short:public ClusterMe
struct CacheOpMsg_short_2:public ClusterMessageHeader
{
- inku8 opcode;
- inku8 frag_type;
- inku16 cfl_flags; // see CFL_XXX defines
+ uint8 opcode;
+ uint8 frag_type;
+ uint16 cfl_flags; // see CFL_XXX defines
INK_MD5 md5_1;
INK_MD5 md5_2;
- inku32 seq_number;
- inku8 moi[4];
+ uint32 seq_number;
+ uint8 moi[4];
enum
{
MIN_VERSION = 1,
MAX_VERSION = 1,
CACHE_OP_SHORT_2_MESSAGE_VERSION = MAX_VERSION
};
- CacheOpMsg_short_2(inku16 vers = CACHE_OP_SHORT_2_MESSAGE_VERSION)
+ CacheOpMsg_short_2(uint16 vers = CACHE_OP_SHORT_2_MESSAGE_VERSION)
: ClusterMessageHeader(vers), opcode(0), frag_type(0), cfl_flags(0), seq_number(0) {
memset(moi, 0, sizeof(moi));
}
@@ -583,7 +583,7 @@ struct CacheOpMsg_short_2:public Cluster
// Use offsetof already. /leif
return (int) ALIGN_DOUBLE(&p->moi[0]);
}
- void init(inku16 vers = CACHE_OP_SHORT_2_MESSAGE_VERSION) {
+ void init(uint16 vers = CACHE_OP_SHORT_2_MESSAGE_VERSION) {
_init(vers);
}
inline void SwapBytes()
@@ -600,17 +600,17 @@ struct CacheOpMsg_short_2:public Cluster
struct CacheOpReplyMsg:public ClusterMessageHeader
{
- inku32 seq_number;
- ink32 result;
+ uint32 seq_number;
+ int32 result;
ClusterVCToken token;
- inku8 moi[4]; // Used by CACHE_OPEN_READ & CACHE_LINK reply
+ uint8 moi[4]; // Used by CACHE_OPEN_READ & CACHE_LINK reply
enum
{
MIN_VERSION = 1,
MAX_VERSION = 1,
CACHE_OP_REPLY_MESSAGE_VERSION = MAX_VERSION
};
- CacheOpReplyMsg(inku16 vers = CACHE_OP_REPLY_MESSAGE_VERSION):
+ CacheOpReplyMsg(uint16 vers = CACHE_OP_REPLY_MESSAGE_VERSION):
ClusterMessageHeader(vers), seq_number(0), result(0) {
memset(moi, 0, sizeof(moi));
}
@@ -627,14 +627,14 @@ struct CacheOpReplyMsg:public ClusterMes
// Use offsetof. /leif
return (int) ALIGN_DOUBLE(&p->moi[0]);
}
- void init(inku16 vers = CACHE_OP_REPLY_MESSAGE_VERSION) {
+ void init(uint16 vers = CACHE_OP_REPLY_MESSAGE_VERSION) {
_init(vers);
}
inline void SwapBytes()
{
if (NeedByteSwap()) {
swap32(&seq_number);
- swap32((inku32 *) & result);
+ swap32((uint32 *) & result);
token.SwapBytes();
}
}
Modified: trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h?rev=946395&r1=946394&r2=946395&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h (original)
+++ trafficserver/traffic/trunk/iocore/cluster/P_ClusterHandler.h Wed May 19 21:06:35 2010
@@ -49,7 +49,7 @@ struct ClusterControl:Continuation
{
int len;
char size_index;
- ink64 *real_data;
+ int64 *real_data;
char *data;
void (*free_proc) (void *);
void *free_proc_arg;
@@ -72,7 +72,7 @@ struct ClusterControl:Continuation
{
// DATA_HDR = size_index (1 byte) + magicno (1 byte) + sizeof(this)
- DATA_HDR = (sizeof(ink64) * 2) // must be multiple of sizeof(ink64)
+ DATA_HDR = (sizeof(int64) * 2) // must be multiple of sizeof(int64)
};
ClusterControl();
@@ -89,8 +89,8 @@ struct OutgoingControl:ClusterControl
static OutgoingControl *alloc();
OutgoingControl();
- void alloc_data(bool align_ink32_on_non_ink64_boundary = true) {
- real_alloc_data(1, align_ink32_on_non_ink64_boundary); /* read access */
+ void alloc_data(bool align_int32_on_non_int64_boundary = true) {
+ real_alloc_data(1, align_int32_on_non_int64_boundary); /* read access */
}
void set_data(char *adata, int alen)
@@ -131,8 +131,8 @@ struct IncomingControl:ClusterControl
static IncomingControl *alloc();
IncomingControl();
- void alloc_data(bool align_ink32_on_non_ink64_boundary = true) {
- real_alloc_data(0, align_ink32_on_non_ink64_boundary); /* write access */
+ void alloc_data(bool align_int32_on_non_int64_boundary = true) {
+ real_alloc_data(0, align_int32_on_non_int64_boundary); /* write access */
}
virtual void freeall();
};
@@ -142,7 +142,7 @@ struct IncomingControl:ClusterControl
//
struct invoke_remote_data_args
{
- ink32 magicno;
+ int32 magicno;
OutgoingControl *msg_oc;
OutgoingControl *data_oc;
int dest_channel;
@@ -169,27 +169,27 @@ struct invoke_remote_data_args
struct Descriptor
{ // Note: Over the Wire structure
- inku32 type:1;
- inku32 channel:15;
- inku16 sequence_number; // lower 16 bits of the ClusterVCToken.seq
- inku32 length;
+ uint32 type:1;
+ uint32 channel:15;
+ uint16 sequence_number; // lower 16 bits of the ClusterVCToken.seq
+ uint32 length;
inline void SwapBytes()
{
- swap16((inku16 *) this); // Hack
- swap16((inku16 *) & sequence_number);
- swap32((inku32 *) & length);
+ swap16((uint16 *) this); // Hack
+ swap16((uint16 *) & sequence_number);
+ swap32((uint32 *) & length);
}
};
struct ClusterMsgHeader
{ // Note: Over the Wire structure
- inku16 count;
- inku16 descriptor_cksum;
- inku16 control_bytes_cksum;
- inku16 unused;
- inku32 control_bytes;
- inku32 count_check;
+ uint16 count;
+ uint16 descriptor_cksum;
+ uint16 control_bytes_cksum;
+ uint16 unused;
+ uint32 control_bytes;
+ uint32 count_check;
void clear()
{
@@ -205,12 +205,12 @@ struct ClusterMsgHeader
}
inline void SwapBytes()
{
- swap16((inku16 *) & count);
- swap16((inku16 *) & descriptor_cksum);
- swap16((inku16 *) & control_bytes_cksum);
- swap16((inku16 *) & unused);
- swap32((inku32 *) & control_bytes);
- swap32((inku32 *) & count_check);
+ swap16((uint16 *) & count);
+ swap16((uint16 *) & descriptor_cksum);
+ swap16((uint16 *) & control_bytes_cksum);
+ swap16((uint16 *) & unused);
+ swap32((uint32 *) & control_bytes);
+ swap32((uint32 *) & count_check);
}
};
@@ -291,9 +291,9 @@ struct ClusterMsg
did_large_control_msgs = 0;
did_freespace_msgs = 0;
}
- inku16 calc_control_bytes_cksum()
+ uint16 calc_control_bytes_cksum()
{
- inku16 cksum = 0;
+ uint16 cksum = 0;
char *p = (char *) &descriptor[count];
char *endp = p + control_bytes;
while (p < endp) {
@@ -302,9 +302,9 @@ struct ClusterMsg
}
return cksum;
}
- inku16 calc_descriptor_cksum()
+ uint16 calc_descriptor_cksum()
{
- inku16 cksum = 0;
+ uint16 cksum = 0;
char *p = (char *) &descriptor[0];
char *endp = (char *) &descriptor[count];
while (p < endp) {
@@ -431,7 +431,7 @@ struct ClusterHandler:public ClusterHand
ClusterMachine *machine;
int ifd;
- ink32 active; // handler currently running
+ int32 active; // handler currently running
bool on_stolen_thread;
struct ChannelData