Coda Distributed File System
Classes | Macros | Enumerations | Functions | Variables
comm.h File Reference
#include <stdio.h>
#include <sys/time.h>
#include <rpc2/rpc2.h>
#include <rpc2/se.h>
#include <callback.h>
#include <vice.h>
#include <olist.h>
#include <rec_olist.h>
#include <ohash.h>
#include <rec_ohash.h>
#include <inconsist.h>
#include "refcounted.h"
#include "fso.h"
#include "venusrecov.h"
#include "venus.private.h"
#include "vproc.h"
Include dependency graph for comm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  connent
 
struct  ConnKey
 
class  conn_iterator
 
class  srvent
 
class  srv_iterator
 
class  probeslave
 
struct  CommQueueStruct
 

Macros

#define ASYNCCOP1   (COPModes & 1)
 
#define ASYNCCOP2   (COPModes & 2)
 
#define PIGGYCOP2   (COPModes & 4)
 
#define COMM_YIELD   1
 
#define START_COMMSYNC()
 
#define END_COMMSYNC()
 
#define MULTI_START_MESSAGE(viceop)
 
#define UNI_START_MESSAGE(viceop)
 
#define MULTI_END_MESSAGE(viceop)
 
#define UNI_END_MESSAGE(viceop)
 
#define MULTI_RECORD_STATS(viceop)
 
#define UNI_RECORD_STATS(viceop)
 
#define VENUS_MAXBSLEN   1024 /* For use in ARG_MARSHALL_BS */
 

Enumerations

enum  ProbeSlaveTask { ProbeUpServers , ProbeDownServers , BindToServer }
 

Functions

void ConnPrint ()
 
void ConnPrint (FILE *)
 
void ConnPrint (int)
 
void ServerPrint ()
 
void ServerPrint (FILE *)
 
void CommInit ()
 
void Conn_Wait ()
 
void Conn_Signal ()
 
void PutConn (connent **)
 
void Srvr_Wait () EXCLUDES_TRANSACTION
 
void Srvr_Signal ()
 
srventFindServer (struct in_addr *host)
 
srventFindServerByCBCid (RPC2_Handle)
 
srventGetServer (struct in_addr *host, RealmId realmid)
 
void PutServer (srvent **)
 
void ProbeServers (int) EXCLUDES_TRANSACTION
 
void DoProbes (int, struct in_addr *) EXCLUDES_TRANSACTION
 
void MultiBind (int, struct in_addr *, connent **) EXCLUDES_TRANSACTION
 
void MultiProbe (int, RPC2_Handle *) EXCLUDES_TRANSACTION
 
long HandleProbe (int, RPC2_Handle Handles[], long, long,...)
 
void ServerProbe (long *=0, long *=0) EXCLUDES_TRANSACTION
 
void DownServers (char *, unsigned int *)
 
void DownServers (int, struct in_addr *, char *, unsigned int *)
 
void CheckServerBW (long)
 
int FailDisconnect (int, struct in_addr *)
 
int FailReconnect (int, struct in_addr *)
 
void PROD_Init (void)
 
void ProbeDaemon (void) EXCLUDES_TRANSACTION
 

Variables

const int DFLT_RT = 5
 
const int UNSET_RT = 0
 
const int DFLT_TO = 60
 
const int UNSET_TO = 0
 
const int DFLT_WS = 32
 
const int UNSET_WS = 0
 
const int DFLT_SA = 8
 
const int UNSET_SA = -1
 
const int DFLT_AP = 8
 
const int UNSET_AP = -1
 
const int DFLT_PS = (1024 + 60 )
 
const int UNSET_PS = -1
 
const int UNSET_ST = -1
 
const int UNSET_MT = -1
 
const int DFLT_ST = 0
 
const int DFLT_MT = 0
 
const unsigned int INIT_BW = 10000000
 
const unsigned int UNSET_WCT = 0
 
const unsigned int DFLT_WCT = 50000
 
const int UNSET_WCS = -1
 
const int DFLT_WCS = 1800
 
int COPModes
 
char myHostName []
 
int rpc2_retries
 
int rpc2_timeout
 
int sftp_windowsize
 
int sftp_sendahead
 
int sftp_ackpoint
 
int sftp_packetsize
 
int rpc2_timeflag
 
int mrpc2_timeflag
 
struct CommQueueStruct CommQueue
 

Macro Definition Documentation

◆ ASYNCCOP1

#define ASYNCCOP1   (COPModes & 1)

◆ ASYNCCOP2

#define ASYNCCOP2   (COPModes & 2)

◆ COMM_YIELD

#define COMM_YIELD   1

◆ END_COMMSYNC

#define END_COMMSYNC ( )
Value:
{ \
vproc *vp = VprocSelf(); \
CommQueue.count[vp->lwpri]--; \
LOG(10, ("CommQueue: remove pri %d count = %d\n", vp->lwpri, \
CommQueue.count[vp->lwpri])); \
VprocSignal(&CommQueue.sync); \
}
struct CommQueueStruct CommQueue
Definition: comm.cc:95
char sync
Definition: comm.h:373
int count[LWP_MAX_PRIORITY+1]
Definition: comm.h:372
vproc * VprocSelf()
Definition: vproc.cc:161

◆ MULTI_END_MESSAGE

#define MULTI_END_MESSAGE (   viceop)
Value:
LOG(10, ("(Multi)%s: code = %d\n", RPCOpStats.RPCOps[viceop].name, code));
#define END_COMMSYNC()
Definition: comm.h:412
char name[RPCOPSTATNAMELEN]
Definition: venusstats.h:99
RPCOpStat RPCOps[srvOPARRAYSIZE]
Definition: venusstats.h:111
RPCOpStatistics RPCOpStats
Definition: venusutil.cc:88

◆ MULTI_RECORD_STATS

#define MULTI_RECORD_STATS (   viceop)
Value:
if (code < 0) \
RPCOpStats.RPCOps[viceop].Mrpc_retries++; \
else if (code > 0) \
RPCOpStats.RPCOps[viceop].Mbad++; \
else \
RPCOpStats.RPCOps[viceop].Mgood++;

◆ MULTI_START_MESSAGE

#define MULTI_START_MESSAGE (   viceop)
Value:
LOG(10, ("(Multi)%s: start\n", RPCOpStats.RPCOps[viceop].name));
#define START_COMMSYNC()
Definition: comm.h:388

◆ PIGGYCOP2

#define PIGGYCOP2   (COPModes & 4)

◆ START_COMMSYNC

#define START_COMMSYNC ( )
Value:
{ \
vproc *vp = VprocSelf(); \
if (COMM_YIELD) { \
int pri = LWP_MAX_PRIORITY; \
while (pri > vp->lwpri) { \
if (CommQueue.count[pri]) { /* anyone bigger than me? */ \
LOG(0, ("WAITING(CommQueue) pri = %d, for %d at pri %d\n", \
vp->lwpri, CommQueue.count[pri], pri)); \
START_TIMING(); \
VprocWait(&CommQueue.sync); \
END_TIMING(); \
LOG(0, ("WAIT OVER, elapsed = %3.1f\n", elapsed)); \
} else { \
pri--; \
} \
} \
} \
CommQueue.count[vp->lwpri]++; \
LOG(10, ("CommQueue: insert pri %d count = %d\n", vp->lwpri, \
CommQueue.count[vp->lwpri])); \
}
#define COMM_YIELD
Definition: comm.h:387
#define LWP_MAX_PRIORITY
Definition: lwp.h:83

◆ UNI_END_MESSAGE

#define UNI_END_MESSAGE (   viceop)
Value:
LOG(10, ("%s: code = %d\n", RPCOpStats.RPCOps[viceop].name, code));

◆ UNI_RECORD_STATS

#define UNI_RECORD_STATS (   viceop)
Value:
if (code < 0) \
RPCOpStats.RPCOps[viceop].rpc_retries++; \
else if (code > 0) \
RPCOpStats.RPCOps[viceop].bad++; \
else \
RPCOpStats.RPCOps[viceop].good++;

◆ UNI_START_MESSAGE

#define UNI_START_MESSAGE (   viceop)
Value:
LOG(10, ("%s: start\n", RPCOpStats.RPCOps[viceop].name));

◆ VENUS_MAXBSLEN

#define VENUS_MAXBSLEN   1024 /* For use in ARG_MARSHALL_BS */

Enumeration Type Documentation

◆ ProbeSlaveTask

Enumerator
ProbeUpServers 
ProbeDownServers 
BindToServer 

Function Documentation

◆ CheckServerBW()

void CheckServerBW ( long  curr_time)

◆ CommInit()

void CommInit ( )

◆ Conn_Signal()

void Conn_Signal ( )

◆ Conn_Wait()

void Conn_Wait ( )

◆ ConnPrint() [1/3]

void ConnPrint ( )

◆ ConnPrint() [2/3]

void ConnPrint ( FILE *  fp)

◆ ConnPrint() [3/3]

void ConnPrint ( int  fd)

◆ DoProbes()

void DoProbes ( int  HowMany,
struct in_addr *  Hosts 
)

◆ DownServers() [1/2]

void DownServers ( char *  buf,
unsigned int *  bufsize 
)

◆ DownServers() [2/2]

void DownServers ( int  nservers,
struct in_addr *  hostids,
char *  buf,
unsigned int *  bufsize 
)

◆ FailDisconnect()

int FailDisconnect ( int  nservers,
struct in_addr *  hostids 
)

◆ FailReconnect()

int FailReconnect ( int  nservers,
struct in_addr *  hostids 
)

◆ FindServer()

srvent * FindServer ( struct in_addr *  host)

◆ FindServerByCBCid()

srvent * FindServerByCBCid ( RPC2_Handle  connid)

◆ GetServer()

srvent * GetServer ( struct in_addr *  host,
RealmId  realmid 
)

◆ HandleProbe()

long HandleProbe ( int  HowMany,
RPC2_Handle  Handles[],
long  offset,
long  rpcval,
  ... 
)

◆ MultiBind()

void MultiBind ( int  HowMany,
struct in_addr *  Hosts,
connent **  Connections 
)

◆ MultiProbe()

void MultiProbe ( int  HowMany,
RPC2_Handle Handles 
)

◆ ProbeDaemon()

void ProbeDaemon ( void  )

◆ ProbeServers()

void ProbeServers ( int  Up)

◆ PROD_Init()

void PROD_Init ( void  )

◆ PutConn()

void PutConn ( connent **  cpp)

◆ PutServer()

void PutServer ( srvent **  spp)

◆ ServerPrint() [1/2]

void ServerPrint ( )

◆ ServerPrint() [2/2]

void ServerPrint ( FILE *  fp)

◆ ServerProbe()

void ServerProbe ( long *  lastupp = 0,
long *  lastdownp = 0 
)

◆ Srvr_Signal()

void Srvr_Signal ( )

◆ Srvr_Wait()

void Srvr_Wait ( )

Variable Documentation

◆ CommQueue

struct CommQueueStruct CommQueue
extern

◆ COPModes

int COPModes
extern

◆ DFLT_AP

const int DFLT_AP = 8

◆ DFLT_MT

const int DFLT_MT = 0

◆ DFLT_PS

const int DFLT_PS = (1024 + 60 )

◆ DFLT_RT

const int DFLT_RT = 5

◆ DFLT_SA

const int DFLT_SA = 8

◆ DFLT_ST

const int DFLT_ST = 0

◆ DFLT_TO

const int DFLT_TO = 60

◆ DFLT_WCS

const int DFLT_WCS = 1800

◆ DFLT_WCT

const unsigned int DFLT_WCT = 50000

◆ DFLT_WS

const int DFLT_WS = 32

◆ INIT_BW

const unsigned int INIT_BW = 10000000

◆ mrpc2_timeflag

int mrpc2_timeflag
extern

◆ myHostName

char myHostName[]
extern

◆ rpc2_retries

int rpc2_retries
extern

◆ rpc2_timeflag

int rpc2_timeflag
extern

◆ rpc2_timeout

int rpc2_timeout
extern

◆ sftp_ackpoint

int sftp_ackpoint
extern

◆ sftp_packetsize

int sftp_packetsize
extern

◆ sftp_sendahead

int sftp_sendahead
extern

◆ sftp_windowsize

int sftp_windowsize
extern

◆ UNSET_AP

const int UNSET_AP = -1

◆ UNSET_MT

const int UNSET_MT = -1

◆ UNSET_PS

const int UNSET_PS = -1

◆ UNSET_RT

const int UNSET_RT = 0

◆ UNSET_SA

const int UNSET_SA = -1

◆ UNSET_ST

const int UNSET_ST = -1

◆ UNSET_TO

const int UNSET_TO = 0

◆ UNSET_WCS

const int UNSET_WCS = -1

◆ UNSET_WCT

const unsigned int UNSET_WCT = 0

◆ UNSET_WS

const int UNSET_WS = 0