Permalink
Browse files

TS-1685 Remove TS_MICRO and fellas

  • Loading branch information...
zwoop committed Jul 30, 2013
1 parent 7485e0b commit b4d411e07953fd3a7f9bea60f4c822360658a1aa
@@ -79,9 +79,7 @@ ClusterMachine::ClusterMachine(char *ahostname, unsigned int aip, int aport)
{
EThread *thread = this_ethread();
ProxyMutex *mutex = thread->mutex;
-#ifndef INK_NO_CLUSTER
CLUSTER_INCREMENT_DYN_STAT(CLUSTER_MACHINES_ALLOCATED_STAT);
-#endif
if (!aip) {
char localhost[1024];
if (!ahostname) {
@@ -172,7 +170,6 @@ ClusterMachine::~ClusterMachine()
ats_free(clusterHandlers);
}
-#ifndef INK_NO_CLUSTER
struct MachineTimeoutContinuation;
typedef int (MachineTimeoutContinuation::*McTimeoutContHandler) (int, void *);
struct MachineTimeoutContinuation: public Continuation
@@ -290,4 +287,3 @@ read_MachineList(char *filename, int afd)
}
return (afd != -1) ? (MachineList *) NULL : l;
}
-#endif // INK_NO_CLUSTER
@@ -110,12 +110,10 @@ void free_MachineList(MachineList * l);
struct clusterConfigFile
{
-#ifndef INK_NO_CLUSTER
char *parseFile(int fd)
{
return (char *) read_MachineList(NULL, fd);
}
-#endif
};
inkcoreapi ClusterMachine *this_cluster_machine();
@@ -68,7 +68,6 @@ enum AllocType
CONSTANT
};
-#ifndef TS_MICRO
#if TS_USE_RECLAIMABLE_FREELIST
#define DEFAULT_BUFFER_NUMBER 64
#else
@@ -78,17 +77,6 @@ enum AllocType
#define MAX_MIOBUFFER_READERS 5
#define DEFAULT_BUFFER_ALIGNMENT 8192 // should be disk/page size
#define DEFAULT_BUFFER_BASE_SIZE 128
-#else
-#define DEFAULT_BUFFER_NUMBER 4
-#if TS_USE_RECLAIMABLE_FREELIST
-#define DEFAULT_HUGE_BUFFER_NUMBER 4
-#else
-#define DEFAULT_HUGE_BUFFER_NUMBER 32
-#endif
-#define MAX_MIOBUFFER_READERS 3
-#define DEFAULT_BUFFER_BASE_SIZE 128
-#define DEFAULT_BUFFER_ALIGNMENT 8 // should be disk/page size
-#endif
////////////////////////////////////////////////
// These are defines so that code that used 2 //
@@ -124,8 +124,6 @@ EventProcessor::spawn_event_threads(int n_threads, const char* et_name, size_t s
}
-#define INK_NO_CLUSTER
-
class EventProcessor eventProcessor;
int
@@ -110,12 +110,10 @@ void free_MachineList(MachineList * l);
#ifdef FIXME_CONFIG
struct clusterConfigFile: configFile
{
-#ifndef INK_NO_CLUSTER
char *parseFile(int fd)
{
return (char *) read_MachineList(NULL, fd);
}
-#endif
};
#endif
View
@@ -98,7 +98,6 @@ register_net_stats()
RECD_INT, RECP_NULL, (int) net_calls_to_write_nodata_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(net_calls_to_write_nodata_stat);
-#ifndef INK_NO_SOCKS
RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.socks.connections_successful",
RECD_INT, RECP_NULL, (int) socks_connections_successful_stat, RecRawStatSyncSum);
@@ -108,7 +107,6 @@ register_net_stats()
RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.socks.connections_currently_open",
RECD_INT, RECP_NON_PERSISTENT, (int) socks_connections_currently_open_stat, RecRawStatSyncSum);
NET_CLEAR_DYN_STAT(socks_connections_currently_open_stat);
-#endif
RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.inactivity_cop_lock_acquire_failure",
RECD_INT, RECP_NULL, (int) inactivity_cop_lock_acquire_failure_stat,
@@ -201,7 +201,6 @@ UnixNetProcessor::connect_re_internal(
// virtual function used to upgrade etype to ET_SSL for SSLNetProcessor.
upgradeEtype(opt->etype);
-#ifndef INK_NO_SOCKS
bool using_socks = (socks_conf_stuff->socks_needed && opt->socks_support != NO_SOCKS
#ifdef SOCKS_WITH_TS
&& (opt->socks_version != SOCKS_DEFAULT_VERSION ||
@@ -213,15 +212,15 @@ UnixNetProcessor::connect_re_internal(
#endif
);
SocksEntry *socksEntry = NULL;
-#endif
+
NET_SUM_GLOBAL_DYN_STAT(net_connections_currently_open_stat, 1);
vc->id = net_next_connection_number();
vc->submit_time = ink_get_hrtime();
vc->setSSLClientConnection(true);
ats_ip_copy(&vc->server_addr, target);
vc->mutex = cont->mutex;
Action *result = &vc->action_;
-#ifndef INK_NO_SOCKS
+
if (using_socks) {
char buff[INET6_ADDRPORTSTRLEN];
Debug("Socks", "Using Socks ip: %s\n", ats_ip_nptop(target, buff, sizeof(buff)));
@@ -241,9 +240,6 @@ UnixNetProcessor::connect_re_internal(
Debug("Socks", "Not Using Socks %d \n", socks_conf_stuff->socks_needed);
vc->action_ = cont;
}
-#else
- vc->action_ = cont;
-#endif /*INK_NO_SOCKS */
if (t->is_event_type(opt->etype)) {
MUTEX_TRY_LOCK(lock, cont->mutex, t);
@@ -252,21 +248,17 @@ UnixNetProcessor::connect_re_internal(
if (lock2) {
int ret;
ret = vc->connectUp(t);
-#ifndef INK_NO_SOCKS
if ((using_socks) && (ret == CONNECT_SUCCESS))
return &socksEntry->action_;
else
-#endif
return ACTION_RESULT_DONE;
}
}
}
eventProcessor.schedule_imm(vc, opt->etype);
-#ifndef INK_NO_SOCKS
if (using_socks) {
return &socksEntry->action_;
} else
-#endif
return result;
}
@@ -422,7 +414,6 @@ UnixNetProcessor::start(int, size_t)
change_net_connections_throttle(NULL, RECD_INT, d, NULL);
// Socks
-#ifndef INK_NO_SOCKS
if (!netProcessor.socks_conf_stuff) {
socks_conf_stuff = NEW(new socks_conf_struct);
loadSocksConfiguration(socks_conf_stuff);
@@ -434,7 +425,7 @@ UnixNetProcessor::start(int, size_t)
socks_conf_stuff = netProcessor.socks_conf_stuff;
}
}
-#endif /*INK_NO_SOCKS */
+
// commented by vijay - bug 2489945
/*if (use_accept_thread) // 0
{ NetAccept * na = createNetAccept();
View
@@ -80,26 +80,10 @@
#define TS_HAS_128BIT_CAS @has_128bit_cas@
/* API */
-#define TS_IS_MICRO_BUILD @is_micro_build@
#define TS_HAS_STANDALONE_IOCORE @has_standalone_iocore@
#define TS_HAS_TESTS @has_tests@
#define TS_HAS_WCCP @has_wccp@
-/* XXX: Should make those individually selectable ? */
-/* TODO: Use TS prefix instead no prefix or INK */
-#if TS_IS_MICRO_BUILD
-# define TS_MICRO 1
-# define INK_NO_ACL 1
-# define INK_NO_CLUSTER 1
-# define TS_USE_DIAGS 0
-# define INK_NO_HOSTDB 1
-# define INK_NO_ICP 1
-# define INK_NO_LOG 1
-# define INK_NO_SOCKS 1
-# define INK_NO_STAT_PAGES 1
-# define INK_USE_MUTEX_FOR_ATOMICLISTS 1
-#endif
-
#define TS_MAX_THREADS_IN_EACH_THREAD_TYPE @max_threads_per_type@
#define TS_MAX_NUMBER_EVENT_THREADS @max_event_threads@
View
@@ -369,21 +369,13 @@ ink_freelists_dump(FILE * f)
void
ink_atomiclist_init(InkAtomicList * l, const char *name, uint32_t offset_to_next)
{
-#if defined(INK_USE_MUTEX_FOR_ATOMICLISTS)
- ink_mutex_init(&(l->inkatomiclist_mutex), name);
-#endif
l->name = name;
l->offset = offset_to_next;
SET_FREELIST_POINTER_VERSION(l->head, FROM_PTR(0), 0);
}
-#if defined(INK_USE_MUTEX_FOR_ATOMICLISTS)
-void *
-ink_atomiclist_pop_wrap(InkAtomicList * l)
-#else /* !INK_USE_MUTEX_FOR_ATOMICLISTS */
void *
ink_atomiclist_pop(InkAtomicList * l)
-#endif /* !INK_USE_MUTEX_FOR_ATOMICLISTS */
{
head_p item;
head_p next;
@@ -394,17 +386,11 @@ ink_atomiclist_pop(InkAtomicList * l)
return NULL;
SET_FREELIST_POINTER_VERSION(next, *ADDRESS_OF_NEXT(TO_PTR(FREELIST_POINTER(item)), l->offset),
FREELIST_VERSION(item) + 1);
-#if !defined(INK_USE_MUTEX_FOR_ATOMICLISTS)
#if TS_HAS_128BIT_CAS
result = ink_atomic_cas((__int128_t*) & l->head.data, item.data, next.data);
#else
result = ink_atomic_cas((int64_t *) & l->head.data, item.data, next.data);
#endif
-#else
- l->head.data = next.data;
- result = 1;
-#endif
-
}
while (result == 0);
{
@@ -414,13 +400,8 @@ ink_atomiclist_pop(InkAtomicList * l)
}
}
-#if defined(INK_USE_MUTEX_FOR_ATOMICLISTS)
-void *
-ink_atomiclist_popall_wrap(InkAtomicList * l)
-#else /* !INK_USE_MUTEX_FOR_ATOMICLISTS */
void *
ink_atomiclist_popall(InkAtomicList * l)
-#endif /* !INK_USE_MUTEX_FOR_ATOMICLISTS */
{
head_p item;
head_p next;
@@ -430,17 +411,11 @@ ink_atomiclist_popall(InkAtomicList * l)
if (TO_PTR(FREELIST_POINTER(item)) == NULL)
return NULL;
SET_FREELIST_POINTER_VERSION(next, FROM_PTR(NULL), FREELIST_VERSION(item) + 1);
-#if !defined(INK_USE_MUTEX_FOR_ATOMICLISTS)
#if TS_HAS_128BIT_CAS
result = ink_atomic_cas((__int128_t*) & l->head.data, item.data, next.data);
#else
result = ink_atomic_cas((int64_t *) & l->head.data, item.data, next.data);
#endif
-#else
- l->head.data = next.data;
- result = 1;
-#endif
-
}
while (result == 0);
{
@@ -456,13 +431,8 @@ ink_atomiclist_popall(InkAtomicList * l)
}
}
-#if defined(INK_USE_MUTEX_FOR_ATOMICLISTS)
-void *
-ink_atomiclist_push_wrap(InkAtomicList * l, void *item)
-#else /* !INK_USE_MUTEX_FOR_ATOMICLISTS */
void *
ink_atomiclist_push(InkAtomicList * l, void *item)
-#endif /* !INK_USE_MUTEX_FOR_ATOMICLISTS */
{
volatile_void_p *adr_of_next = (volatile_void_p *) ADDRESS_OF_NEXT(item, l->offset);
head_p head;
@@ -476,30 +446,19 @@ ink_atomiclist_push(InkAtomicList * l, void *item)
ink_assert(item != TO_PTR(h));
SET_FREELIST_POINTER_VERSION(item_pair, FROM_PTR(item), FREELIST_VERSION(head));
INK_MEMORY_BARRIER;
-#if !defined(INK_USE_MUTEX_FOR_ATOMICLISTS)
#if TS_HAS_128BIT_CAS
result = ink_atomic_cas((__int128_t*) & l->head, head.data, item_pair.data);
#else
result = ink_atomic_cas((int64_t *) & l->head, head.data, item_pair.data);
#endif
-#else
- l->head.data = item_pair.data;
- result = 1;
-#endif
-
}
while (result == 0);
return TO_PTR(h);
}
-#if defined(INK_USE_MUTEX_FOR_ATOMICLISTS)
-void *
-ink_atomiclist_remove_wrap(InkAtomicList * l, void *item)
-#else /* !INK_USE_MUTEX_FOR_ATOMICLISTS */
void *
ink_atomiclist_remove(InkAtomicList * l, void *item)
-#endif /* !INK_USE_MUTEX_FOR_ATOMICLISTS */
{
head_p head;
void *prev = NULL;
@@ -514,16 +473,12 @@ ink_atomiclist_remove(InkAtomicList * l, void *item)
while (TO_PTR(FREELIST_POINTER(head)) == item) {
head_p next;
SET_FREELIST_POINTER_VERSION(next, item_next, FREELIST_VERSION(head) + 1);
-#if !defined(INK_USE_MUTEX_FOR_ATOMICLISTS)
#if TS_HAS_128BIT_CAS
result = ink_atomic_cas((__int128_t*) & l->head.data, head.data, next.data);
#else
result = ink_atomic_cas((int64_t *) & l->head.data, head.data, next.data);
#endif
-#else
- l->head.data = next.data;
- result = 1;
-#endif
+
if (result) {
*addr_next = NULL;
return item;
Oops, something went wrong.

0 comments on commit b4d411e

Please sign in to comment.